Archived topic
Local fonts not loading
6 replies · Started by bjbowen on July 12, 2022
Hey there...
- I built the site with Google Fonts
- Afterward, I added the exact same fonts locally following this https://docs.generatepress.com/article/adding-local-fonts/
- Performance testing shows that the fonts are still loading from gstatic -- and it looks like it's coming from the theme, although I'm not 100% sure about that. I can't seem to decipher what exactly is calling the gstatic fonts.
- I've flushed the cache, regenerated used CSS, and regenerated CSS in Generate Blocks.
Now I'm just stumped. Can you help me find out what is wrong here?
Hi there,
i can see Montserrat being loaded locally and from google fonts. The google font request is being made by a preload link which i reckon has been added by WP Rocket. Can you check in its settings ?
I've tried:
-Adding local fonts to the Preload Fonts section of WP Rocket = Still loading Google Fonts
-Bypassing WP Rocket https://carolinabutchershop.com?nowprocket = Still loading Google Fonts
-Deactivating WP Rocket = Still loading Google Fonts
This is in the header:
<link rel='stylesheet' id='generateblocks-google-fonts-css' href='https://fonts.googleapis.com/css?family=Montserrat:100,100italic,200,200italic,300,300italic,regular,italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic&display=swap' media='all' />
ugh. hahaha I'm stumped
OK so the preload link i pointed out - check the preload options in WP:
https://docs.wp-rocket.me/article/1317-preload-fonts
You do not want those preloads...
But that link you found is coming from GenerateBlocks, which means that somewhere in your page content or in a block element, you selected a Font in one of the GB Blocks settings. You will need to find it and remove it....
Okay... so this is how they say to deactivate the automatic preload of Google Fonts: https://docs.wp-rocket.me/article/1312-optimize-google-fonts#deactivate
I'm going to see if I can find the Generate Blocks culprit. Why wouldn't it go ahead and reassign the font after I made the switch in Customizer?
Okay!! I found the problem in Generate Blocks! Thanks so much! I didn't know how to determine where the issue originated. Thanks so much for your help.
We will be adding a filter in GB 1.6 so GBs font requests can be disabled if they are not required.
Glad to hear you got it resolved.