Archived topic
How To Disable Google Fonts In Generatepress Theme? Full Guide Please
14 replies · Started by Nithin on December 10, 2021
How To Disable Google Fonts In Generatepress Theme? Full Guide Please
Hi
I used PHP in Code Snippet to remove google fonts but it didn't work. Also in function.php. What can I do wrong?
greetings
I used PHP in Code Snippet to remove google fonts but it didn’t work
Can you explain what didn't work?
Can you link us to your site?
Hi
The website is torun.salezjanie.pl
Looks like you are using Open sans font in some or one block of GenerateBlocks, so the plugin is requesting Google fonts.
https://www.screencast.com/t/a1chGOYt
Hi
Is there any way to identify this block? I searched block by block for example on the home page, also in Elements.
1. https://www.screencast.com/t/YGZwzEDlE
2. https://www.screencast.com/t/sBBcg17U
3. https://www.screencast.com/t/jM48bP5G
...
You actually have more than 30 places using open sans on homepage.
If you can disable your cache plugin, it might be easier to search using the developer tool to find out which blocks are using google fonts.
The places you show are Open Sans but not Google Fonts just locally loaded. Like Ubuntu.
I have disabled the cache plugin, do you need access to the cockpit?
If so, I can't tell where exactly the open sans google font is being called.
https://www.screencast.com/t/vJxUs9aRq2XY
Maybe you need to check one block by one block to see if there's any of them toggled the google fonts option.
Because GB or GP won't load google fonts if there's no Google font is set anywhere on the site.
I checked block by block many times. Why did PHP fragments not work?
https://docs.generatepress.com/article/remove-google-fonts/
I also used a code that was supposed to remove Google Fonts from Customizer. And they're still there.
Looks like a css from GB.
The PHP snippets are out of date, because we introduced the new typography system to GP, so the snippets are no longer needed.
And the snippets were for GP, not GB.
Can you try disable GB to see if the site still requests google fonts?
Thanks for the hint. Tomorrow I will make a site clone and check without GB.
Tomorrow I will make a site clone and check without GB.
Making a staging site is a good idea :)