Home › Forums › WoodMart support forum › How to replace with tag for main product image in WoodMart?
How to replace with tag for main product image in WoodMart?
- This topic has 2 replies, 2 voices, and was last updated 22 hours, 52 minutes ago by
Luke Nielsen.
-
AuthorPosts
-
April 18, 2025 at 1:35 am #655062
LQWParticipantI’m using the WoodMart theme with Elementor and WooCommerce.
Currently, on single product pages, the main product image is rendered inside a <figure> tag with a data-thumb attribute, and the image itself is inserted dynamically via JavaScript.
Example output:
<figure data-thumb=”image-url.jpg” class=”woocommerce-product-gallery__image”></figure>This causes the image to not appear as an
tag directly in the HTML source, which leads to poor SEO and a lower score in tools like Google PageSpeed (the image is not recognized as LCP).
What I want to achieve:
Render the main product image directly in the HTML like this:
I already tested that the correct image is loaded when I bypass the JS.
Is there a setting in WoodMart to force this behavior, or do I need to override a WooCommerce template like product-image.php?If yes, which part of the theme controls this rendering?
Thanks in advance for any help!
April 18, 2025 at 1:45 am #655065
LQWParticipantI’m using the WoodMart theme with Elementor and WooCommerce.
Currently, on single product pages, the main product image is rendered inside a <figure> tag with a data-thumb attribute, and the actual image is inserted dynamically via JavaScript.
Example output:
<figure data-thumb=”image-url.jpg” class=”woocommerce-product-gallery__image”></figure>
This causes the image not to appear as a proper
tag in the HTML source, which negatively impacts SEO and tools like Google PageSpeed (the image is not detected as LCP).
What I want to achieve:
I would like the main product image to be rendered directly in HTML like this:
img src=”image-url.jpg” alt=”…” /
I already confirmed that the image is correctly loaded when JavaScript is bypassed.
Question: Is there a setting in WoodMart to achieve this?
Or do I need to override a WooCommerce template such as product-image.php?
If so, which part of the theme handles this rendering?Thank you for any help!
April 18, 2025 at 11:52 am #655175
Luke NielsenKeymasterHello,
The WooCommerce by default sets such a tag – https://prnt.sc/5o7GWGZ3SSU6
LCP(Largest Contentful Paint) message doesn’t mean that this particular element is loaded slowly. It just indicates which element is the Larger Contentful Paint. Read more here https://developer.chrome.com/docs/lighthouse/performance/lighthouse-largest-contentful-paint/?utm_source=lighthouse&utm_medium=lr
Our guide on how to optimize your website using our themes can be found here: https://xtemos.com/wordpress-performance-optimization-the-ultimate-guide-in-2021/.
Kind Regards
-
AuthorPosts
Tagged: img-tag, lcp, product image, SEO, woodmart-gallery
- You must be logged in to create new topics. Login / Register