Google Fonts keep loading 2.1.6

Hi Themeco,

I would like to remove all Google Font references from the Theme, because i uploaded the fonts to my own server.

It’s about this one:

I already read the topics about this on the forum and added this:

// Deregister X Google Fonts //
add_action( ‘wp_print_styles’, ‘my_deregister_styles’, 100 );
function my_deregister_styles() {
wp_deregister_style( ‘x-google-fonts’ );
wp_deregister_style( ‘hstl-roboto’ );
wp_deregister_style( ‘hstl-opensans’ );
wp_dequeue_style(‘hstl-roboto’);
wp_dequeue_style(‘hstl-opensans’);
wp_dequeue_style( ‘x-font-custom’ );
wp_dequeue_style( ‘x-font-standard’ );
}

Can you help me? Thanks!

  • Menno

Hi Menno,

Thanks for writing in! Did you also purge your server cache before testing? Also there could be google fonts loading from your other plugins as well. You may try disabling your 3rd party plugins and test your issue again.

If that does not help, could you please provide us with your WordPress login credentials in a secure note to check your issue further.

Thanks!

Yes i purged the cache. I see my topic missed this line:

< link rel=“stylesheet” href="//fonts.googleapis.com/css?family=Open+Sans:400,400i,700,700i&subset=latin,latin-ext" type=“text/css” media=“all” data-x-google-fonts / >

As you can see it has data-x-google-fonts in it. How to remove this line? I disabled the font manager already.

Hi @mennobouma

If you followed these steps, you shouldn’t have any reference to Google Fonts:

  • Go to Theme Options → Typography
  • Enable use of the Font Manager
  • Click the Settings icon in the Bar and navigate to Fonts
  • Modify each font to reference a system font instead of a Google font.

Also, you can add this line to functions.php in your child theme directory to do the same job:
add_filter( 'cs_load_google_fonts', '__return_false' );

Thanks.

1 Like

@Alaa Yes this works! Really thanks :slight_smile:

Have a nice weekend!

You’re most welcome. Have a nice weekend as well.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.