sandywp / plugins / rocket-lazy-load
LazyLoad Plugin
Lazy Load Images, Videos, and Iframes
The best free lazy load plugin for WordPress. Lazy load images, videos, and iframes to improve performance and Core Web Vitals scores.
Ready in seconds.
v2.4.0 100,000+ installs WP 4.9+ PHP 7.3+

About this plugin
LazyLoad is the best free lazy load plugin for WordPress to lazy load images, videos, and iframes on WordPress. In a nutshell, LazyLoad displays images, videos, and iframes on a page only when they are visible to the user – that’s one crucial way to speed up your WordPress site and optimize images for Google PageSpeed.
You can lazy load images in post content or widget text, plus thumbnails, avatars, and smilies. LazyLoad takes care of iframe lazy load, too: you’ll easily replace Youtube iframes with a preview thumbnail to further speed up the loading time of your website.
No JavaScript library such as jQuery is used, and the script weight is less than 10KB.
Why is lazy loading crucial for performance?
Lazy loading is a key performance technique to make your site faster. You’ll reduce loading time, improve your Lighthouse performance score and optimize your Core Web Vitals grades.
Lazy loading your images on WordPress will help you achieve a better PageSpeed Insights score for three main reasons:
- You’ll address a specific PageSpeed Insights recommendation: [Defer offscreen images](https://wp-rocket.me/google-core-web-vitals-wordpress/defer-offscreen-images/, which means image lazy loading.
- You’ll improve the performance of two key metrics: First Input Delay (Core Web Vital) and Total Blocking Time (Lighthouse metric).
- You’ll make fewer HTTP requests – that is another way to boost your site speed and improve the Largest Contentful Paint score (another Core Web Vital).
Take a look at our complete list of reasons why you should use lazy loading. Then, turn on LazyLoad and make your WordPress website faster!
Dependencies
LazyLoad script: https://github.com/verlok/lazyload
Questions
- How can I use native lazyload?
To use native lazyload on browsers supporting this feature, you need to use the following line:
add_filter( 'rocket_use_native_lazyload', '__return_true' );Browsers that do not support native lazyload will use the JS-based solution as before.
- How can I deactivate Lazy Load on some pages?
You can use the
do_rocket_lazyloadfilter.Here is an example to put in functions.php files that disable lazyload on posts:
add_action( 'wp', 'deactivate_rocket_lazyload_on_single' ); function deactivate_rocket_lazyload_on_single() { if ( is_single() ) { add_filter( 'do_rocket_lazyload', '__return_false' ); } }- How can I deactivate Lazy Load on some images?
Simply add a
data-no-lazy="1"property in youimgoriframetag.You can also use the filters
rocket_lazyload_excluded_attributesorrocket_lazyload_excluded_srcto exclude specific patterns.For iframes, the filter is
rocket_lazyload_iframe_excluded_patterns.- How can I change the threshold to trigger the load?
You can use the
rocket_lazyload_thresholdfilter.Code sample:
function rocket_lazyload_custom_threshold( $threshold ) { return 100; } add_filter( 'rocket_lazyload_threshold', 'rocket_lazyload_custom_threshold' );- I use plugin X and my images don’t show anymore
Some plugins are not compatible without lazy loading. Please open a support thread, and we will see how we can solve the issue by excluding lazy loading for this plugin.
- How can I lazy load a background-image?
The plugin will automatically lazy load background-images set with a
styleattribute to adivelement:<div style="background-image: url(image.jpg);">You can also apply it manually. The element you want to apply lazy load on must have this specific markup:
<div class="rocket-lazyload" data-bg="url(../img/image.jpg)"></div>The element must have the class
rocket-lazyload, and adata-bgattribute, which value is the CSS url for the image.- Where do I report security bugs found in this plugin?
You can report any security bugs found in the source code of the site-reviews plugin through the Patchstack Vulnerability Disclosure Program. The Patchstack team will assist you with verification, CVE assignment and take care of notifying the developers of this plugin.
- Related Plugins
- Imagify: The Best image optimizer to speed up your website with lighter images.
- WP Rocket: Best performance plugin to speed up your WordPress website.
- Heartbeat Control by WP Rocket: Heartbeat Control by WP Rocket: The best plugin to control the WordPress Heartbeat API and reduce CPU usage.
- RocketCDN: The best CDN plugin for WordPress to propel your content at the speed of light – no matter where your users are located in the world.
- Increase Max upload file size is the best plugin to increase the upload file size limit to any value with one click.
sandywp / also on the shelf
Try another plugin
4.3 · 500+ installs
Improves load speed of page and save the bandwidth.
Spin up a real WordPress site in seconds.
Test plugins, build a demo, hand a client a link — then squash it and start again. No local setup, no Docker.