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.
2
Answers
In recent Divi update, this theme comes 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:
Full plugin link: https://wordpress.org/plugins/gdpr-cache-scripts-styles/