Archived topic
LCP is lazy loaded
1 reply · Started by Dennis on June 13, 2022
Hi there,
I'm using Generatepress with a basic template for high speed. I'm trying to get very good results on 3G and 4G speeds too.
However, GTmetrix gives me the error message that the largest contentful paint (LCP) should not be lazy loaded, but it seems that Wordpress is now automatically lazy loading all images and they leave it up for theme developers to exclude them if they're laoded above the fold (if I understand that correctly: https://make.wordpress.org/core/2021/07/15/refining-wordpress-cores-lazy-loading-implementation/).
Is there a way, to add this feature? The images that are being loaded are the featured images and loaded through the header section. So I'd only need these "hero" images to not lazy load.
Thanks in advance :-)
Best regards,
Dennis
Hi there,
i think GT Metrix maybe a little out of date on that.
The native browser lazy loading on Chromium browsers ignores images above the fold - see here for more info:
https://web.dev/browser-level-image-lazy-loading/#distance-from-viewport-thresholds
But if you want to remove the attribute then see the snippet one user provided here: