March 30, 2021 at 10:10 am
Hi, I’m trying to manually change the HTML tag from loading=”lazy” to loading=”eager” for the front page SVG image by editing it in the code editor. I do use Perfmatters and WP Rocket that both have the option for lazy loading, yet not on this page – it’s OFF. Also, I tried to disable the native lazy loading from WP core by adding add_filter( ‘wp_lazy_loading_enabled’, ‘__return_false’ ); to Code snippets, yet I still see loading=”lazy” default attribute on the image in chrome dev tools.
However, when I manually add the loading=”eager” tag by editing the SVG in HTML edit mode, the browser does display the tag as such but at the same time, I get an “Attempt Block Recovery” warning. Unless I click it, the tag is visible in chrome dev tools and the image is loaded immediately. If I click to recover the block the tag is removed from it. I read your support article on the subject yet it does not explain or help in my case.
How can I sustainably manually add or edit any HTML tag without causing the IMG block to break? Is this something that only affects SVG?
Thanks for your input.