Hello,
I’m currently using WP Rocket for performance optimization and XStore for my WooCommerce theme.
I want to exclude the main product image from lazy loading on single product pages only, in order to improve the Largest Contentful Paint (LCP) metric.
The image in question is rendered with the following structure:
img width=”430″ height=”505″ src=”…” class=”attachment-woocommerce_single size-woocommerce_single wp-post-image” … loading=”lazy”
I’ve tried adding the following keywords under LazyLoad → Excluded images or iframes in WP Rocket:
wp-post-image
woocommerce_single
attachment-woocommerce_single
etheme-single-main
However, the loading=”lazy” attribute is still being applied.
Ideally, I want to keep LazyLoad for all other images site-wide, but completely exclude it only for the main product image on single product pages.
Could you advise the proper method or hook/filter to make this exclusion specific to single product pages only?
Thank you!