• Resolved roxer82

    (@roxer82)


    Hello. I’m using AMP in Reader mode, and even if I’m not using any optimizer it use lazy load of featured images.
    In PageSpeed Insights google recommend not to lazy load it, because it makes increase the LCP.
    How could I make AMP Plugin stop lazy loading the featured image?

    The message is:

    Largest Contentful Paint image was lazily loaded
    Above-the-fold images that are lazily loaded render later in the page lifecycle, which can delay the largest contentful paint. Learn more about optimal lazy loading. [LCP]
    Element:
    article.amp-wp-article > figure.amp-wp-article-featured-image > amp-img.attachment-large > img.i-amphtml-fill-content

    <img class="i-amphtml-fill-content i-amphtml-replaced-content" decoding="async" loading="lazy" alt="" src="https://www.site.com/wp-content/uploads/2023/10/image-768x432…" srcset="https://www.site.com/wp-content/uploads/2023/10/image-1024x57…" sizes="(max-width: 1024px) 100vw, 1024px" data-hero-candidate="" data-hero="">

    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Milind More

    (@milindmore22)

    Hello @roxer82

    Thank you for contacting us, the ideal would be to make that image a hero image, AMP already does that optimization

    In case you are using premium themes such as Newspaper which adds overwrite original AMP template, it might create issues.

    We will recommend sharing link to your website or Support UUID by visiting AMP->Support so we can guide you further

    Thread Starter roxer82

    (@roxer82)

    I’m using Reader mode, so, I’m not using another theme.
    Google marks the featured should not be lazy loaded.

    Plugin Support Milind More

    (@milindmore22)

    Hello @roxer82

    Sorry for the delayed response can you please try the below code snippet and check if that fixes your issue, add the code snippet in your child themes functions.php or in a custom plugin.

    add_filter(
    	'amp_post_template_data',
    	function( $data ) {
    		$data['featured_image']['amp_html'] = str_replace( 'loading="lazy"', '', $data['featured_image']['amp_html'] );
    		return $data;
    	}
    );
    Plugin Support Milind More

    (@milindmore22)

    @roxer82 As we didn’t receive a response I’ll mark this as resolved. Feel free to open a new support topic if you require any further assistance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Disabling featured image lazy load’ is closed to new replies.