• I was starting to notice that when I looked at sitemaps it was showing 70+ images per page when I knew there were only around 20 on the page. I then started to look at the page html and there was loads of code for each image to do with lazyload.

    I switched off lazyload in Autoptimize thinking it would correct the issue, but the images still show in sitemap and the html. If I delete an image on the page and re-add it the lazy load code disappears for that image.

    I can’t understand if I switch off lazy load in the plugin, it doesn’t leave the code and then I’m left with adding all the images again…

    Is there anyone in support that can help with this issue?

    Thanks

    • This topic was modified 6 years, 4 months ago by nycmw.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    AO adds images between noscript tags to ensure maximum discoverabilty of images by whatever visits your page. If you have 20 images, this would mean you would see those 20 images lazyloaded + 20 noscript tags (which are not rendered for normal users, only for those that have JS off somehow). The plugin that generates the sitemap _should_ know the difference between real, lazyloaded images and the noscript variation really.

    The fact the “doubles” don’t get removed when disabling lazyload but to disappear when you edit the post, is due to the fact that the sitemap-generating plugin only acts on posts being saved.

    Lastly I can provide you with a code snippet that will stop the noscript-images from being added.

    hope this helps,
    frank

    Thread Starter nycmw

    (@nycmw)

    Frank
    Thanks for that. Very helpful

    But shouldn’t the lazyload code on the pages delete when we disable lazyload in autoptimize or disable the plugin?

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    depends on how the sitemap works; if it gets generated on the fly, yes, if it gets generated upon post saves, no and it looks like it works the latter manner?

    Thread Starter nycmw

    (@nycmw)

    The coding issue is not the sitemap, it’s the WP sites page html.

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Ah, in that case you very likely have a page cache. As long as you don’t clear that, you’ll see “old” HTML 🙂

    Thread Starter nycmw

    (@nycmw)

    Can we please move this to email, cause it’s nothing to do with the page cache

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    sorry, didn’t see this response @nycmw , feel free to contact me at futtta-at-gmail-dot-com 🙂

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

The topic ‘Switching off lazyload leaves code in html’ is closed to new replies.