Built-in Lazy Loading Functionality Landing in WordPress 5.5

Built-in lazy loading in WordPress 5.5

One of the most awaited default features, Built-in Lazy Loading of the images will be landing in the next major release, WordPress 5.5. The patch for adding loading attribute to img tags is now committed to the core. It means we might be seeing the built-in lazy loading functionality in v.5.5.

The new attribute loading on img tags will help you quickly lazy load images while providing a standardized user experience without content shifting. Prior to this new solution, lazy loading images compulsorily required a custom JavaScript-based approach.

The loading attribute indicates how the browser should load the image; either eager or lazy. When you go for eager, your images will load immediately, even it is not visible on the viewport. Whereas, the lazy value in the loading attribute will automatically lazy load all images. The implementation will enable lazy-loading images by default with lazy value on the loading attribute under the img tag.

The attribute, loading=“lazy”, will only be added if the respective tag does not yet include a loading attribute. In other words, to prevent an image from being lazy-loaded, it is recommended to specify loading=“eager”.

The lazy loading feature was previously planned to be shipped in 5.4. However, since the testings were still on, the developers took a little time and decided not to implement it in the core just yet. And now, the core team has finally decided to implement it in the core. Click here to know more about this.

More details on this will be publicized soon.

Leave a Reply

Your email address will not be published. Required fields are marked *