• Resolved johnthedocs

    (@johnthedocs)


    Hello,

    When the plugin is enabled to lazy load images, it also lazy loads the featured image, which cause a large LCP. Is it possible to pre-load the featured image and disable lazy loading for it?

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor WP Rocket

    (@wp_rocket)

    Hi @johnthedocs,

    Jurica from WP Rocket here. Thank you for contacting WP Rocket’s support.

    `You have several options to exclude images from being lazyloaded:

    – You can simply add a data-no-lazy="1" property in your img or iframe tag.

    – You can also use the filters rocket_lazyload_excluded_attributes or rocket_lazyload_excluded_src to exclude specific patterns.

    – For iframes, the filter is rocket_lazyload_iframe_excluded_patterns

    You can read how to preload an image in this article: Preload Largest Contentful Paint image.

    I hope this information helps!

    Best Regards,

    Thread Starter johnthedocs

    (@johnthedocs)

    Hello @wp_rocket

    Thanks for the reply.

    Can you please give some examples on how to do this globally, for the entire site? I am interested in doing this on every page because they all have a featured image. Can it be done with a snippet?

    I am not that experienced, so maybe you could help with providing the snippet code that excludes the featured image from lazy loading?

    The Preload LCP image link is helpful, but adding every image manually is a bit hard. Isn’t there a way to add this globally?

    Thanks

    Plugin Contributor WP Rocket

    (@wp_rocket)

    Hi @johnthedocs!

    Jorge from WP Rocket here.

    You could use any of the following helper plugins depending on your needs:

    • This reply was modified 3 years, 4 months ago by WP Rocket.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to enable pre-load for Featured Image’ is closed to new replies.