Site logo

Archived topic

Google Fonts Showing Up in Dev Tools

2 replies · Started by Michael on June 12, 2020

Viewing posts 1–3 of 3

Hi guys,

I'm having a devil of a time in removing google fonts. I am serving them locally and have included excerpts to remove Google Fonts from GP and one to include the local fonts in customizer:

add_action( 'wp_enqueue_scripts', function() {
    wp_dequeue_style( 'generate-fonts' );
} );
add_filter( 'generate_typography_default_fonts', function( $fonts ) {
    $fonts[] = 'Open Sans';
    $fonts[] = 'Carrois Gothic';
	$fonts[] = 'Ico Moon';

    return $fonts;
} );
add_action( 'admin_init', function() {
    add_filter( 'generate_google_fonts_array', '__return_empty_array' );
} );

If I check on a tool like GTMetrix for example the google font api doesn't show as loading. However, when I check in Chrome dev tools it shows:

https://www.screencast.com/t/m6GXaUIDtf8

After clearing caches it is still being called. I have been unable to work out where this call is coming from.

I have tried a couple of plugin options to remove as well, but none have worked.

Please can you advise if there is something left in GP that I need to remove?

Thanks again you for your help.

Michael.

It turns out it was the Moz Bar creating the call for google fonts. So that's sorted. Sorry for any confusion - hopefully if anyone else comes up against a similar issue they will find this post to save them some hours!

Glad you've figured out :)

This archived topic is closed to new replies.