Site logo

Archived topic

How to remove Google Fonts

12 replies · Started by Haissam on September 26, 2022

Viewing posts 1–13 of 13

Hello,
I want to completely remove google fonts and use default system fonts instead such as Arial.
The idea is to improve loading time for my pages.
Can you please let me know how in a step by step as usual?

So if i make sure in the customizer-> typography that there are not google fonts selected, it should stop loading google fonts libraries?

Yes, it should.

However, if you also set a Google Font through the Block settings of GenerateBlocks Block, you should also remove that.

When no Google font is loaded from GP and GB, Google font wont be loaded in your site.

I have the same problem and would like to remove Google Fonts from customizer.
Google Fonts are stored local, in GenerateBlocks the Fonts are removed.

My function.php from generatepress_child has following code:

add_action( 'admin_init', function() {
add_filter( 'generate_google_fonts_array', '__return_empty_array' );
} );
add_filter( 'generate_typography_default_fonts', function( $fonts ) {
$fonts[] = 'Open Sans';

return $fonts;
} );

But Google Fonts are still in the customizer and still there is still a link to google:

<meta name="viewport" content="width=device-width, initial-scale=1"><link rel='dns-prefetch' href='//fonts.googleapis.com' />

<link rel='stylesheet' id='generateblocks-google-fonts-css' href='https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,regular,italic,600,600italic,700,700italic,800,800italic&display=swap' media='all' />

What can I do? The Website is https://mootiv.de

I have the same problem and would like to remove Google Fonts from customizer.

1. Make sure you are using the dynamic typography system of GP:
https://docs.generatepress.com/article/dynamic-typography-overview/

If you are still using the old typography system, you can switch it to the dynamic one:
https://docs.generatepress.com/article/switching-to-dynamic-typography/

2. You don't need any PHP code to remove Google fonts, if there's no Google fonts are selected at customizer > typography > fonts manager.

3. In the customizer > typography > fonts manager, if you choose the ‘Open Sans’ font, make sure the Google fonts option is disabled.
https://www.screencast.com/t/LHgnKGr7uNl

4. Make sure you don't choose the font in any individual GenerateBlocks block, otherwise the GB plugin would send request for Google fonts.

Thank you Ying,

Google fonts options is disabled and I didn't found, where GenerateBlocks uses Google Fonts.
I solved it with the Plugin "Disable and remove Google Fonts"
But the Google Fonts are still visible in the Customizer. No Matter - the DSGVO-Problem ist solved.

Dynamic typography is not avalable in GP-Premium 2.2.0

Do I have to buy a new License for GP-Premium 3.2.0?
Can't find something about it.

Can I update my 2.2.0 GeneratePress-Premium Theme to 3.2.0 without loosing my layout and settings?

3.2.0 Premium doesn't exist? Then I loose my Premium-Tools when updating?
Can't find informations about this.

To cover there is the Theme and there is the Plugin. They are two separate things and they have different version numbers:

GeneratePress Theme latest version is 3.2.0
GeneratePress Premium Plugin latest version is 2.2.0

You can update the Theme and the Plugin to the latest versions without losing your layout and settings.

Ah, now I understand :-)
Many Thanks, David!

Then I already have the Theme 3.2.0
But NO Checkbox for "Use dynamic typography system"

Furthermore I would like to erase the Google fonts from Font Manager in Customizer > Typography so that I can't select any Google Font which isn't local installed.
Google Fonts and connecting to google server ist a very big problem here in Germany with DSGVO and I would like to make sure, that my customers don't select a Google font with server connection.

Is there any way to do this?

The following Code didn't work:
add_action( 'admin_init', function() {
add_filter( 'generate_google_fonts_array', '__return_empty_array' );
} );

Ok - many thanks !!!

This archived topic is closed to new replies.