javascript - How to remove all google fonts in divi? - Stack Overflow

During the new GDPR (DSGVO in Germany). We have to remove all the google fonts (if loaded from google).

During the new GDPR (DSGVO in Germany). We have to remove all the google fonts (if loaded from google).

To do so I searched a little in the SC of Divi.

For all of you who need a quick fix.

Here is something for you're functions.php(child theme please)

// REMOVE ALL DIVI GOOGLE FONTS FROM DIVI
function et_builder_get_google_fonts() {return array();}
function et_get_google_fonts() {return array();}
function disable_gfonts_divi() {
wp_dequeue_style( 'divi-fonts' );
wp_dequeue_style('et-builder-googlefonts');
wp_dequeue_style('et-builder-googlefonts-cached');
}

add_action( 'wp_enqueue_scripts', 'disable_gfonts_divi', 20 );
// END GOOGLE FONTS REMOVE

During the new GDPR (DSGVO in Germany). We have to remove all the google fonts (if loaded from google).

To do so I searched a little in the SC of Divi.

For all of you who need a quick fix.

Here is something for you're functions.php(child theme please)

// REMOVE ALL DIVI GOOGLE FONTS FROM DIVI
function et_builder_get_google_fonts() {return array();}
function et_get_google_fonts() {return array();}
function disable_gfonts_divi() {
wp_dequeue_style( 'divi-fonts' );
wp_dequeue_style('et-builder-googlefonts');
wp_dequeue_style('et-builder-googlefonts-cached');
}

add_action( 'wp_enqueue_scripts', 'disable_gfonts_divi', 20 );
// END GOOGLE FONTS REMOVE

If one of you has some to add or if it could be done a little nicer please tell me.

Share Improve this question edited Jun 4, 2018 at 8:52 Partha 4024 silver badges15 bronze badges asked Jun 4, 2018 at 8:21 Axel LodygaAxel Lodyga 111 silver badge3 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 6

In recent Divi update, this theme es with an option to enable or disable the google font.

You can get that option in Divi > theme option > general settings. Please go to Divi > theme option > General settings > Use Google font > Disable the option > save and check

An alternative to disabling Google Fonts is, to embed those fonts in your WordPress website.

I've created a plugin for that, which solves that GDPR requirement and integrates smoothly with Divi. All you need to do is:

  1. Install the plugin GDPR Cache Scripts & Styles
  2. Activate the plugin
  3. Wait 4-5 minutes for the plugin to download all fonts

Full plugin link: https://wordpress/plugins/gdpr-cache-scripts-styles/

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744774564a4592967.html

相关推荐

  • javascript - How to remove all google fonts in divi? - Stack Overflow

    During the new GDPR (DSGVO in Germany). We have to remove all the google fonts (if loaded from google).

    7天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信