Stop Divi From Loading Google Fonts
Turns off Divi's Google Fonts option and removes the default Open Sans stylesheet, so no font requests go to Google from your Divi site.
Opens WPIDE on
Code
add_filter( 'option_et_divi', function ( $options ) {
if ( is_array( $options ) ) {
$options['et_use_google_fonts'] = 'off';
}
return $options;
} );
add_action( 'wp_enqueue_scripts', function () {
wp_dequeue_style( 'divi-fonts' );
}, 20 );
Notes
Text falls back to your theme's other fonts; upload your own fonts in Divi if you need a specific typeface.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.