Lazyload not working with ShortPixel
-
When using ShortPixel to create webp images and setting it to rewrite the
<img>
tag to a<picture>
tag will no longer allow the LazyLoading of Autoptimize to work as expected.I have also confirmed this is a problem when hard coding a
<picture>
/<source>
tags into the WordPress content too, so this isn’t only related to the ShortPixel Plugin – but is the easiest way to replicate.When loading a page of the website, the jpg version of the image download immediately – then once scrolled to the webp image will download as expected.
I have tested and confirmed this in a fresh install of WordPress with the Twenty Twenty and only the ShortPixel and Autoptimize plugins installed. ShortPixel has the following advanced settings activated:
- Also create WebP versions of the images, for free.
- Deliver the WebP versions of the images in the front-end:
- Global (processes the whole output buffer before sending the HTML to the browser)
- The topic ‘Lazyload not working with ShortPixel’ is closed to new replies.