• Hi there,

    I’m using Imagify to create WebP images and use the option to add them within a <picture> element. This sometimes results in an element <picture loading="lazy">, which is invalid according to validator.w3.org.

    How can I prevent the lazy loading attribute from being set in the <picture> element?

    Best regards,

    Matthias

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author WP Media

    (@wp_media)

    Hey Matthias,

    What you can try is to use this helper plugin as it should move all attributes back to <img> tag.

    Simply download ZIP file and activate it via Plugins > Add New > Upload

    That should be all, no need to make any changes or further setup.

    Please let me know how it goes.

    Best Regards
    Marko

    Thread Starter Matthias Kittsteiner

    (@kittmedia)

    That works well, thank you!

    Is it planned to include this into Imagify itself rather than using an additional plugin for it?

    Plugin Author WP Media

    (@wp_media)

    Hey Matthias,

    Awesome, thanks for letting me know.

    Not for now, as the default behaviour usually works well. This helper is just the easier way to implement the change, and it will not affect your site SEO, performance, security or any other aspect.

    In fact, you can apply the code (with some minor changes) as mu-plugin or directly in your theme’s functions.php file it you don’t like to see it as a standard plugin.

    Let me know what you think.

    Best Regards
    Marko

    Thread Starter Matthias Kittsteiner

    (@kittmedia)

    Hi Marko,

    it’s not that I particularly am against an additional plugin, but I think if a plugin creates invalid HTML (and this is the only thing I’m interested in here) and this is a known issue, should also be fixed by this exact same plugin, not something else.

    Best regards,
    Matthias

    Plugin Author WP Media

    (@wp_media)

    Hey Matthias,

    I understand what you mean. I have consulted with colleague – indeed, this could be something to work on as it would improve the user experience and code quality.

    We will discuss this further internally and proceed with next steps.

    I marked this thread as “Not Resolved” for now. As soon as we get a new info or make a plan to tackle it down, I will let you know.

    Thanks for your feedback on this!

    Best Regards
    Marko

    Thread Starter Matthias Kittsteiner

    (@kittmedia)

    Hi Marko,

    thank you for your feedback! I appreciate that. \o/

    Best regards,
    Matthias

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘picture loading=”lazy” is invalid HTML’ is closed to new replies.