Remove Google Fonts And Use Standard Fallback Fonts

Hi Guys.

Actually: I just want a relatively simple thing, but it turns out to be pretty awful…

I searched your entire "sidney" forum and read every relevant post on this topic. Unfortunately, everything does not work 100% :frowning:

This post is more about the integration of Google Fonts in footer, because of page speed:

And this post seems to be specifically for the deactivation of the link to fonts[dot]googleapis[dot]com:

But it works, if only partially = info’s from the second post! The question is just…what it is exactly that it only partially works? What confuses me are two different source codes for the functions.php (child) you have published…

First one:

function sydney_child_remove_google_fonts() {

wp_dequeue_style( 'sydney-fonts' );

}

add_action( 'wp_enqueue_scripts', 'sydney_child_remove_google_fonts', 999 );

Second one:

function sydney_child_remove_googlefont() {

wp_dequeue_style( 'sydney-fonts' );

}

add_action( 'wp_enqueue_scripts', 'sydney_child_remove_googlefont', 999 );

The two source codes differ in the following point:

google_fonts vs. googlefont

Both have the same result: The call of fonts[dot]googleapis[dot]com disappears completely from the source code. This concerns the following code:

<link rel=‘dns-prefetch’ href=’//fonts[dot]googleapis[dot]com’ />

However, this only affects the font Source Sans Pro and not the font Raleway! The Raleway will continue to be read as a style sheet, see the following source code from my site.

<link rel=‘stylesheet’ id=‘google-fonts-1-css’ href=‘https[colon]//fonts[dot]googleapis[dot]com/css?family=Raleway%3A100%2C100italic%2C200%2C200italic%2C300%2C300italic%2C400%2C400italic%2C500%2C500italic%2C600%2C600italic%2C700%2C700italic%2C800%2C800italic%2C900%2C900italic&#038;ver=5.0.3’ type=‘text/css’ media=‘all’ />

I would like to do the following: Remove Google Fonts 100% and at any point from the Sidney teme, forcing the WP-system to use fallback fonts defined in the standard CSS …

There are two simple reasons for this:

1. DSGVO/GDPR.

2. Page speed (rendering, above the fold).

Please: Give me a clear source code or command for it and name me the file in which it must be included.

How does such a command affect the fonts settings in the customizer? The fonts settings only refer to Google Fonts, which are then no longer available …?

Do I have to specify the fallback fonts in the customizer? After the complete cut-off from Google fonts?

P.S. I’m not interested in how to load the Google fonts from my own server. I do not want them anymore and nowhere to automatically use the fallback fonts :wink:

I look forward to a timely feedback

Thanks in advance

Big Greetz from Germany

Tobi

Hello Tobi,

I’ll ask our Developer if there is an easy way to do that, let’s see what he says.

Kind Regards, Roman.

Hi Roman,

many thanks for your fast reply!

Yes, that would be really nice of you :wink:

I am sure that is in the sense of the other post-creators. In any case, with my two example links, because it just does not work 100%…

There has to be a more or less simple way, because an absolutely simple plug-in can do some of the work already = Remove Google Fonts References (WP plug-in)

Here is an additional info for you:

Last night I tried around a bit further and achieved the following result: If the plug-in is activated and I additionally install one of your two code snippets (wp_dequeue_style

) in the child-functions-php, no matter which one, the Google fonts are completely removed from the source code!

Even via the Google chrome console there is no call (source) on Google fonts anymore. But: The Google fonts still seem to be there no matter how many times I empty the browser cache.

They are still specified in the customizer and are still used in the header-slider and in the headlines, although according to source code and Google console there is no call for Google fonts anymore …!? I hope that helps your developer a bit further, so that he can helps us :wink:

P.S. The plug-in is so simple that it does not even have a setting because it can only do this one thing. Consequently, the code / instruction for this function cannot be great either. Unfortunately I could not discover anything in the parent-functions-php, what was written by this plug-in …

P.P.S. Besides I would like to solve this "little prob" without another plug-in :wink:

I look forward to a new feedback

Big Greetz from Germany

Tobi

Hi there,

Sorry for the delay.

Can you share a link to your site please so I can do a quick check?
If you managed to remove all calls to Google Fonts, then it doesn’t matter what it says in the Customizer, they will not be loaded.
They will still be set by CSS but they won’t show if they are not loaded. If they do show, it’s possible that you have them installed on your system.

Let me know.

Vlad

Hi Vlad,

many thanks for your reply.

Okay, then the topic is actually done for me…

There is certainly no call of Google Fonts anymore and I have not installed them locally.

Still a pity that you cannot provide me with a short snippet code to replace the plug-in (Remove Google Fonts References By Bruno Xu).

I’m still sure that this is in the sense of many “Sidney”-users who value the GDPR and Google Page Speed! Please ask your developers again, there must be something like this in your house…

At least that would save you a lot of forum answers that will arise on this subject again and again :wink:

I am looking forward to a new feedback from you.

Big Greetz from Germany

Tobi

Hi there,

I actually noted this issue in our task list and we’ll think for a bit about how to tackle this most efficiently. Probably we’ll have an option in the Customizer to disable loading Google Fonts.

Vlad

Hi Vlad,

that sounds really wonderful, can’t wait for it…

Again: The effort is worth it, because every Sidney user will thank you :wink: (Google page speed, GDPR)

Still something on this topic, even if it really does not belong here. But there are some threads on this topic in your forum : render blocking = above the fold.

I notice that ALL major theme developers have the same problems with it. It’s always the same resources that block rendering, e.g.:

style.CSS

style.min.css

font-awesome.min.css

page-builder.min.css (in your case elementor)

Of course, this can be fixed manually, but that could be very tricky and can do a lot of damage to the theme … However, this can be a huge effort, which does not bring the desired result in the end …

In any case, this is not for beginners and not so easy solved with a plug-in, such as Autoptimize.

However, it is quite easy for the theme developer to move the scripts already in the core code, e.g. in the footer. Why does not a theme developer do that? Why is the topic so neglected when it is so immensely important!?

After all, the most beautiful website does not bother you if nobody finds it on Google! At Google, one thing counts first and foremost: speed. This concerns in particular exactly the rendering resources that prevent the browser from reading the HTML documents.

The premium theme developer, who first offers a working solution for this, will certainly catch the eye of most webmasters, even those who still use the themes of their competitors.

I am looking forward to a new feedback from you.

Big Greetz from Germany

Tobi