lazysizes is a WordPress plugin for the fast (jank-free), SEO-friendly and self-initializing lazyloader with the same name. Support includes images (including responsive images with srcset and the picture tag), iframes, scripts/widgets and much more. It also prioritizes resources by differentiating between crucial in view and near view elements to make perceived performance even faster.

This plugin works by loading the lazysizes script and replacing the src and srcset attributes with data-src and data-srcset on the front end of a WordPress site. When a post or page is loaded, the lazysizes javascript will load the images, iframes etc. dynamically when needed.

Thanks to aFarkas and contributors for making the lazysizes project possible, and for letting me use the same name.

Also thanks to dbhynds who made the Lazy Load XT plugin, which this plugin is based on.


  1. Install and activate the plugin through the ‚Plugins’ menu in WordPress


  1. Download and unzip lazysizes.
  2. Upload the lazysizes folder to the /wp-content/plugins/ directory
  3. Activate the plugin through the ‚Plugins’ menu in WordPress


Why aren’t my images lazy loading?

Lazysizes filters images added to the page using the_content, post_thumbnail_html, widget_text and get_avatar. If your images are added using another function (wp_get_attachment_image for example), lazysizes does not filter them by default. There are several options for changing what lazysizes filters, like enabling it to filter acf_the_content for WYSIWYG content from Advanced Custom Fields, and enabling wp_get_attachment_image support (somewhat limited, see below). For unsupported use cases you can also filter the HTML yourself by passing it to get_lazysizes_html.

While this plugin has opt-in support for wp_get_attachment_image, it doesn’t add a no-Javascript fallback, which causes images to become invisible for users where Javascript is disabled or unsupported. We cannot fix this for you automatically, but you can fix this with a couple of changes to the code that uses wp_get_attachment_image. For example, if a theme has: echo wp_get_attachment_image($id);, changing it to the following would lazy load the image and add no-Javascript fallback if enabled in settings: echo get_lazysizes_html( wp_get_attachment_image($id) );

But this plugin looks like Lazy Load XT!

Yes, it does. The PHP code for this plugin is heavily based on that of Lazy Load XT. The main difference is that this plugin is a bit simplified, and is using a completely different lazy loading library, with no jQuery dependency.

Thanks to dbhynds for making the Lazy Load XT plugin. Without that project, this one would not be possible.

Why is this plugin called the same as the lazysizes JS library?

There are a couple of reasons:

  1. I think it’s a good name.
  2. I’m hoping it will help people discovering the plugin. I originally tried searching for a WordPress plugin using the library myself, and other people might be trying the same.

This plugin is not affiliated with the lazysizes project. I got permission by aFarkas to use the name, but that’s as far as any connection between the two go.


30 kwietnia 2019
Works great, even with picture tags! The fade-in effect of the lazyloaded images is really nice! And the developer is really active and helped me a lot! Thanks again, Patrick 🙂
22 grudnia 2018
As a developer I knew the lib js that does a very good job. So I'm not surprised to have a plugin that does a good job too. (Except, video loading does not work)
1 listopada 2018
I already tested some other plugins against this plugin for my site load speed and request counts. This plugin is greatly reducing my page load speed I really don't know why they couldn't beat this plugins performance on gtmetrix. Performance is really high as author mentioned!
3 września 2018
LazySizes is lazyloading done right. I've used it before and was pleased to see that it's now available as a WordPress plugin. For me, this is the best lazy-load script on the planet. I've tried many WordPress plugins and all failed except LazySlides. Excellent!
Przeczytaj 6 recenzji

Kontrybutorzy i deweloperzy

„lazysizes” jest oprogramowaniem open source. Poniższe osoby miały wkład w rozwój wtyczki.


Wtyczka “lazysizes” została przetłumaczona na 2 języki. Podziękuj tłumaczom za ich wkład.

Przetłumacz wtyczkę “lazysizes” na swój język.

Interesuje cię rozwój wtyczki?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Log zmian


  • Improve logic for skipping transforming images inside noscript tags. Should fix compatibility issues with Envira Gallery’s noscript fallback. Thanks to snippet24 for reporting.
  • Fix default options not being selected. If you were affected by this bug, see a list of recommended default options here. Thanks to snippet24 for reporting.


  • Upgrade lazysizes library to version 5.2.0.
  • Add opt-in support for Advanced Custom Fields.
  • The plugin now uses namespaces for PHP classes.
  • Confirmed working with WordPress 5.3 and PHP 7.4.


  • Upgrade lazysizes library to version 5.0.0.
  • Add experimental support for native lazy loading.
  • Fix fatal error during ajax processing. Thanks to @eastgate for reporting.
  • Fix PHP warning on certain pages, like the events page from the plugin The Events Calendar. Thanks @julian_wave for reporting.


Big thanks to martychc23 and dutze for their help and patience in making this release as good as it is.

  • Proper support for the picture tag, by popular request. Big refactoring of the HTML transforming code was done to make picture element support possible.
  • Improve and fix support for audio/video elements. The plugin now handles the preload attribute and leaves the src attribute alone on source elements inside video/audio.
  • Opt-in support for get_attachment_image. Please note that the plugin cannot add a no-js fallback for images lazy-loaded using this method.
  • Add option to enable/disable noscript fallback
  • Fix plugin action links
  • Several fixes to improve compatibility


  • Add support for the aspectratio plugin for lazysizes, which makes images have the right height while loading. Thanks to Teemu Suoranta (@teemusuoranta) for implementing.
  • If Javascript is turned off, the image tag that would normally be lazy loaded is now hidden properly. Thanks to @diegocanal for reporting and fixing.


  • Update the lazysizes library to version 4.1.5
  • Fix lazy loading of elements without a class attribute, like some iframes
  • Fix translation loading


  • Remove unused code for advanced settings


  • Fix text domain loading


  • Updated readme


  • Initial version of the plugin