Saijo George

Curated by Saijo George

Read more

thursday30 Jan 2020

Lazy-Loading Images in Coming to WordPress Core

https://make.wordpress.org

While historically lazy-loading images has required a custom JavaScript-based approach, there is now a native web solution which relies solely on the presence of a new loading attribute on img tags and provides a standardized user experience without content shifting. The HTML specification for the loading attribute is near completion and is already supported by several browsers, including Chrome and Edge.

The implementation seeks to enable lazy-loading images by default, providing the loading attribute with value lazy on the following img tags:

  • Images in post content
  • Images in post excerpts
  • Images in comments
  • Images in text widget content
  • Individual images rendered via wp_get_attachment_image()
  • Avatar images rendered via get_avatar()

While the images outlined above will be lazy-loaded by default, developers will be able to override this behavior both globally and on a per-image basis.

The proposed solution is available as a feature plugin WP Lazy Loading in the plugin repository. Β The current goal is to get this feature released as part of WordPress 5.4, merging in the next two weeks.

General
No Media


I love tl;dr Marketing because I can get all the latest SEO news and trends in one spot without having to read lengthy articles. I really look forward to the daily emails to see what's new in our industry!

Google Will Show You Search Tips When They Don't Have Good Results for You Query 1 - SEO News

Ryan Mews SEO Manager Merkle