Archived topic
Google Fonts display:swap
11 replies · Started by mogudasl on December 13, 2021
Hello,
I have added the code
add_filter( ‘generate_google_font_display’, function() {
return ‘swap’;
} );
on the child theme
and I still get the problem in pagespeed
…fonts/generatepress.woff2. (“web”). 10 ms
…v36/4UaGrENHs….woff2(fonts.gstatic.com). 0 ms
…v18/KFOmCnqEu….woff2(fonts.gstatic.com). 0 ms
…v36/4UaGrENHs….woff2(fonts.gstatic.com). 0 ms
…v36/4UabrENHs….woff2(fonts.gstatic.com). 10 ms
Hi there,
you can remove the generatepress.woff2 by going to Customizer > General and changing the Icon Type to SVG
And what is the issue being reported in Page Speed ?
Ok,
I have made the change.
The issue is :
"Make sure the text remains visible while the web font is loading"
Have you updated to the new typography settings in Customizer > General ?
SVG ? Yes
Go to Customizer > Typography - does it still look like the screenshots here?
I send screenshot
Hmmm....I cannot see the GeneratePress request for the Fonts.
Are you using any Optimization plugins that manage the font loading ?
I only use wp rocket.
Could you tell me what should appear " the GeneratePress request for the Fonts "?
Have a chat with WP Rocket support as their plugin should automatically do that for you - see here:
https://docs.wp-rocket.me/article/1312-optimize-google-fonts
Hello,
I have read the article,
the solution to the problem is to upload the plugin Change Google fonts display attribute ?.
In the latest version of wp rocket it does not appear to optimize fonts
Yep - looks like they changed it to a separate helper plugin you will need to install.