had not tried this myself yet, but below code snippet should accomplish this @piergio1 ;
add_filter( 'autoptimize_filter_metabox_screens', function( $screens ) {
$screens[] = 'product';
return $screens;
}, 10, 1 );
hope this helps,
frank
Great! I have to put this code in the functions.php file?
that should work yes, or you can use something like the code snippets plugin.
I put this on functions.php and the option appeared in the products!
Unluckly, I test the lighthouse test (after I choose the lcp product image to preload) and it didn’t preload it.
Maybe first of all make sure to clear the page cache. After that take a look at the HTML source to check if the link-preload tag for the image is present maybe?
I empty Autoptimize and Cloudflare cache… I searched in the Inspection tab but no “pre-load” appears. Maybe it’s a problem in the theme. Thank you anyway
can you share the URL of a product page which has an LCP image defined?
Hi,
I discover that the problem was on the theme code. Because the preload worked, but the image was into a gallery. So the gallery loaded very very late.
Thank you!