Title: Lazy Loading Bug
Last modified: March 15, 2022

---

# Lazy Loading Bug

 *  [sultan912](https://wordpress.org/support/users/sultan912/)
 * (@sultan912)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/lazy-loading-bug/)
 * Hello,
 * I noticed a bug in the image lazy loading feature, whereby, if there is a picture
   element with multiple sources in the HTML, and I change the value of the “Lazy-
   load from nth image” setting to any number that is larger than 1, like this for
   example:
 * [https://imgur.com/a/7Y4Dqvc](https://imgur.com/a/7Y4Dqvc)
 * the “srcset” attribute in the picture’s sources will be replaced with “data-srcset”
   in the rendered HTML, meaning that they will not render on the browser, like 
   this:
 * code file:
    [https://imgur.com/WGhRWec](https://imgur.com/WGhRWec)
 * rendered HTML in the chrome console:
    [https://imgur.com/c6sdINK](https://imgur.com/c6sdINK)
 * I managed to solve this bug by telling the plugin to exclude the “srcset” attribute,
   but I am not sure if this is an ideal solution.
 * [https://imgur.com/wHpeU1S](https://imgur.com/wHpeU1S)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/lazy-loading-bug/#post-15461445)
 * You’re right, it’s a bug. I added it as a Github issue so I can look into this
   sultan912 and will update here as well (if) when I have a solution.

Viewing 1 replies (of 1 total)

The topic ‘Lazy Loading Bug’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 1 reply
 * 4 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/lazy-loading-bug/#post-15461445)
 * Status: not resolved