Title: picture loading=&#8221;lazy&#8221; is invalid HTML
Last modified: February 3, 2022

---

# picture loading=”lazy” is invalid HTML

 *  Resolved [Matthias Kittsteiner](https://wordpress.org/support/users/kittmedia/)
 * (@kittmedia)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/is-invalid-html/)
 * 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
    -  This topic was modified 4 years, 4 months ago by [Matthias Kittsteiner](https://wordpress.org/support/users/kittmedia/).

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

 *  Plugin Author [WP Media](https://wordpress.org/support/users/wp_media/)
 * (@wp_media)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/is-invalid-html/#post-15323390)
 * Hey Matthias,
 * What you can try is to use [this helper plugin](https://github.com/wp-media/imagify-helpers/tree/master/webp/imagify-keep-attributes-on-img-tags)
   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](https://wordpress.org/support/users/kittmedia/)
 * (@kittmedia)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/is-invalid-html/#post-15323470)
 * 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](https://wordpress.org/support/users/wp_media/)
 * (@wp_media)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/is-invalid-html/#post-15323485)
 * 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](https://wordpress.org/support/users/kittmedia/)
 * (@kittmedia)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/is-invalid-html/#post-15323530)
 * 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](https://wordpress.org/support/users/wp_media/)
 * (@wp_media)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/is-invalid-html/#post-15324197)
 * 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](https://wordpress.org/support/users/kittmedia/)
 * (@kittmedia)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/is-invalid-html/#post-15324201)
 * 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.

 * ![](https://ps.w.org/imagify/assets/icon-256x256.gif?rev=3452959)
 * [Imagify: Optimize Images for Top Speed (Compress & Convert to WebP/AVIF)](https://wordpress.org/plugins/imagify/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/imagify/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/imagify/)
 * [Active Topics](https://wordpress.org/support/plugin/imagify/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/imagify/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/imagify/reviews/)

## Tags

 * [attributes](https://wordpress.org/support/topic-tag/attributes/)
 * [webp](https://wordpress.org/support/topic-tag/webp/)

 * 6 replies
 * 2 participants
 * Last reply from: [Matthias Kittsteiner](https://wordpress.org/support/users/kittmedia/)
 * Last activity: [4 years, 4 months ago](https://wordpress.org/support/topic/is-invalid-html/#post-15324201)
 * Status: resolved