Site logo

Archived topic

Ensure text remains visible during webfont load Page Insights

8 replies · Started by Sam on April 20, 2021

Viewing posts 1–9 of 9

Hello,

I am getting this error along with a couple of others in lighthouse page speed test. I have tested my home page and a couple of image heavy blog posts. I was hoping you could help. Linking my site below.

Thank you, that worked. Are there any fixes for some of the other errors coming up in lighthouse? I would attach the screen shot but I am no sure how.

Also, is the php you gave me the same as adding omgf google font plugin?

Thanks,
sam

Thank you, that worked. Are there any fixes for some of the other errors coming up in lighthouse?

Can you open up a new topic for it? I've checked your site and there's quite a lot to tackle.

...I would attach the screen shot but I am no sure how.

Check the recommendations here.
https://docs.generatepress.com/article/using-the-premium-support-forum/#uploading-screenshots

Or use CloudApp, Loom or Screencast.

Also, is the php you gave me the same as adding omgf google font plugin?

Not exactly sure what that plugin does but the principle is generally the same. It's all about preloading the font, or in this case, setting font-display: swap; on the requested Google fonts.

Hello - opening new ticket now. thanks!

No problem. :)

How to add this code
add_filter( 'generate_google_font_display', function() {
return 'swap';
} );

Hi there,

that is a PHP Snippet - this article explains how to add:

https://docs.generatepress.com/article/adding-php/

Please note: Adding display swap may remove the: Ensure text remains visible during webfont load Page Insights diagnostic on Google PSI. BUT it can lead to CLS issues. I would only use that option if i am 100% sure that the font swapping won't cause CLS.

This archived topic is closed to new replies.