Archived topic
Largest Contentful Paint image was lazily loaded
3 replies · Started by Lucia on April 21, 2022
Hello and good evening!
When we examine our home page with the Google Lighthouse, we get the message “Largest Contentful Paint image was lazily loaded”:
These are the .svg images in the Hero element.
<div class="wp-block-column is-vertically-aligned-center">
<figure class="wp-block-image alignwide size-large"><img loading="lazy" src="https://248414-769081-raikfcquaxqncofqfm.stackpathdns.com/blog/wp-content/uploads/2022/04/hp-r.svg" width="474" height="296" alt="" class="wp-image-35375" title="parliamo insieme di fitoterapia"></figure>
</div>
How can we solve it?
Many Thanks :-)
Lucia
Hi there,
the loading="lazy" attribute is for browser native lazy loading thats added by WordPress, in theory if the image is above them fold then the browser should ignore it. You can disable that core feature using this PHP Snippet:
add_filter( 'wp_lazy_loading_enabled', '__return_false' );
How to add PHP: https://docs.generatepress.com/article/adding-php/
Thank you David!
You're welcome