How to remove Google Fonts from Divi, Genesis and more topics

As you probably know, there are many, many themes that load Google Fonts sometimes in excess, but you have to understand it , and is that for a theme developer is very convenient to load fonts from Google to make their subject more visually attractive, without having to host them in the subject, reducing their weight. Now, this has a problem, or several.

Google Fonts and the WPO

If you have analyzed your website in any measurement service of optimization and speed you will have seen that detect the loading external resources from Google Fonts as a problem . This is because are external calls that your website does to finally display its content, since resources do not always have to be available and yes, it's a problem. One would think that the hell, if they are from Google, they will load fast! But what if Google deletes that source tomorrow for a problem of rights, profitability, or whatever? And it's only an example. It can also happen that the servers where the Google Fonts are hosted have load delays for any reason, which would affect the loading of your website, as there would be resources that would never end up being displayed / uploaded. So it's best to host the sources locally, or not to load them from Google Fonts .

Google Fonts and privacy

In case you did not know, it turns out that if your theme uses Google Fonts are sharing the IPs of your visitors with Google . Come on, that Google does not lose opportunity to obtain information about our Internet uses at any time. And of course, if you are committed to privacy, let's not say since the appearance of the RGPD you should or inform your users in your privacy policies that that is happening, or simply avoid loading Google Fonts on your website, and show it with the user's system sources.

How do I turn off the Google Fonts upload?

If you're clear, let's see how to prevent the Google Fonts load and consequently the recovery of private data of your visitors (IPs) with Google. What we will do, for both Divi and for any other tem a, is to use the WordPress function wp_dequeue_style with which we will avoid loading Google Fonts of the CSS stylesheet of the theme . For this we need to know the name to include in the $ handle of the function, and here is a list of the most used topics:

Topic Style sheet name with Google Fonts ($ handle)
Twenty Twelve twentytwelve-fonts
Twenty Thirteen twentythirteen-fonts
Twenty Fourteen twentyfourteen-fonts
Twenty Fifteen twentyfifteen-fonts
Twenty Sixteen twentysixteen-fonts
Twenty Seventeen twentyseventeen-fonts
Genesis Sample genesis-sample-fonts
Extra extra-fonts
Divi divi- fonts

Once we know the function to use and the $ handle we just have to add our code to the file functions.php of the active theme, like this:

In the previous example we are avoiding the loading of Google Fonts in Divi. To see another example, in Genesis would be like that :

Easy eh?

Would you rather use a plugin?

If you do not dare with the code you can also use a plugin like ] Disable Google Fonts but only if your theme is one of these: Twenty Twelve, Twenty Thirteen, Twenty Fourteen, Twenty Fifteen, Twenty Sixteen, Twenty Seventeen.

How do I host Google Fonts locally?

Another possibility, of course, would be to store locally the Google Fonts that your theme uses. In this way you fully maintain the aesthetics of your theme while respecting the privacy of your visitors facing Google. In this case the process passes by downloading the Google sources, hosting them on your server and changing the internal calls of the stylesheet, so that they point to the new address where the sources are, as we have already seen. It is somewhat more complicated but a good solution in any case.

Loading …

That may also help you: