WordPress lazy loads images and iframes automatically, so on most sites there is nothing to install or turn on. It has added loading="lazy" to images since version 5.5 and to iframes since 5.7. Since 6.3 it also skips the images most likely to be visible when the page first loads and gives the biggest of them fetchpriority="high", because lazy loading the top image makes a page slower, not faster.
This guide explains exactly how WordPress 7.1 decides what to lazy load, how to check it is working, how to turn it off or tune it without a plugin, and when a plugin is worth adding. The details come from the WordPress 7.1 source code.
- WordPress lazy loads images (since 5.5) and iframes (since 5.7) on its own, so most sites have nothing to switch on.
- It deliberately skips the images most likely to be on screen when the page opens: header images and the first three images in your content. The first large one gets
fetchpriority="high"instead. - Images need width and height attributes to be lazy loaded. Images inserted by JavaScript or set as CSS backgrounds are never lazy loaded by core.
- One line turns it off:
add_filter( 'wp_lazy_loading_enabled', '__return_false' );. A second filter changes how many images are skipped. - Plugins like WP Rocket and a3 Lazy Load add what core cannot, such as CSS background images. WP Rocket switches core lazy loading off when its own is on.
What is lazy loading?
Lazy loading tells the browser not to download an image or iframe until it is about to scroll into view. A long post with 20 images only downloads the few near the top at first, and the rest load as the reader scrolls. The page becomes usable sooner and readers who never scroll to the bottom never download those images.
Modern browsers do this natively through the loading attribute, which is what WordPress uses. No JavaScript library is involved, which is why core lazy loading adds no weight to your pages.
Does WordPress lazy load images by default?
Yes, and it has grown smarter with almost every release since:
| WordPress version | What changed |
|---|---|
| 5.5 (2020) | Adds loading="lazy" to images in post content, widgets and theme templates that use WordPress’s image functions. |
| 5.7 | Iframes, such as embedded videos and maps, are lazy loaded too. |
| 5.9 | Stops lazy loading the first image in the content, since it is usually visible straight away. |
| 6.1 | Adds decoding="async" to images so decoding them does not hold up the rest of the page. |
| 6.3 | Skips the first three content images instead of one, and adds fetchpriority="high" to the first large image. |
| 6.7 | Adds sizes="auto" to lazy loaded images so the browser picks the right image size from the space it actually fills. |
The original 5.5 announcement explains the thinking behind the feature, but most of what makes it work well today arrived later.
How WordPress decides which images to lazy load
Lazy loading an image that is already on screen when the page opens delays it, which hurts your Largest Contentful Paint score. So for each image, WordPress first guesses whether it is likely to be visible when the page opens:
- Images in the header, including your header template part and custom header image, are treated as visible.
- The first three images in the main content are treated as visible. That number comes from the
wp_omit_loading_attr_thresholdfilter. - Visible images are not lazy loaded. The first of them that is at least 50,000 pixels in area, around 224 by 224, gets
fetchpriority="high"so the browser downloads it first. - Every other image with a width and height gets
loading="lazy", and since 6.7sizes="auto"as well.
Two kinds of image are never lazy loaded by core. Images without width and height attributes are skipped, because loading them late would make the page jump around as they appear. Images that JavaScript inserts, or that are set as CSS backgrounds, never pass through WordPress’s image filters at all. Since WordPress 7.0, images that already carry fetchpriority="low" or "auto" are left as they are.
How to check that lazy loading is working
Open a long post on your site, view the page source (Ctrl+U, or Cmd+Option+U on a Mac) and search for loading="lazy". On a working setup you should see:
- No
loading="lazy"on your logo, header image or first content image, andfetchpriority="high"on the main one. loading="lazy"on images and embeds further down the post.decoding="async"on images throughout the page.
To watch it happen, open your browser’s developer tools, switch to the Network tab and filter by images. Reload, then scroll: new image requests appear as you go. If every image loads immediately, check your caching or optimization plugin, since many of them replace core lazy loading with their own.
How to turn off lazy loading without a plugin
You might want this if a slider or gallery script breaks with lazy images, or if another plugin already handles lazy loading. Add one of these to your child theme’s functions.php file or with a code snippets plugin. To switch lazy loading off everywhere:
// Turn off WordPress lazy loading for images and iframes.
add_filter( 'wp_lazy_loading_enabled', '__return_false' );
To keep it for images but turn it off for iframes (or the other way around), check the tag name:
// Keep lazy loading for images, turn it off for iframes.
add_filter( 'wp_lazy_loading_enabled', function ( $default, $tag_name ) {
return 'iframe' === $tag_name ? false : $default;
}, 10, 2 );
If only the top of your pages is the problem, for example a layout with several large images near the top, raise the number of images WordPress skips instead of turning the feature off:
// Don't lazy load the first five content images (the default is three).
add_filter( 'wp_omit_loading_attr_threshold', function () {
return 5;
} );
In a theme template, you can control a single image by passing 'loading' => false to wp_get_attachment_image(), which leaves the attribute off that one image:
echo wp_get_attachment_image( $image_id, 'large', false, array( 'loading' => false ) );
Plugins for lazy loading what WordPress can’t
Core lazy loading covers normal images and iframes. A plugin earns its place when you need more than that, such as CSS background images or images from sources WordPress does not process.
WP Rocket
WP Rocket is a paid performance plugin with its own LazyLoad option. According to its documentation, it lazy loads images inside <img> tags including ones hosted on other domains, covers CSS background images as well, and automatically switches core lazy loading off when its own is enabled, so the two never overlap.
a3 Lazy Load
a3 Lazy Load is free, has 90,000+ active installs and was last updated in July 2026. It works alongside core rather than replacing it: it lazy loads images that do not come from your media library, plus iframes and videos that core misses, and it can lazy load images inside horizontally scrolling containers. It also has an option to switch core lazy loading off entirely.
Whichever you choose, run only one lazy loading system at a time, and check the page source afterwards to make sure your top image is not being lazy loaded.
Does lazy loading help SEO?
Indirectly. Google renders pages and handles the native loading attribute, so lazy loaded images are still found and indexed, as Google explains in its guide to fixing lazy-loaded content. The benefit is speed: fewer bytes up front and a faster page for readers.
The risk runs the other way. Lazy loading your main image hurts Largest Contentful Paint, one of the Core Web Vitals, which is exactly why WordPress now skips the images at the top. If a plugin or theme forces lazy loading on everything, your top image can end up slower than it would be with no lazy loading at all. Our guide to speeding up WordPress covers the rest of the page speed picture.
Frequently asked questions
Does WordPress lazy load images by default?
Yes. Since WordPress 5.5, core adds loading=”lazy” to images that have width and height attributes, and since 5.7 to iframes. It skips header images and the first three images in your content, which are likely to be visible when the page opens.
How do I disable lazy loading in WordPress without a plugin?
Add add_filter( ‘wp_lazy_loading_enabled’, ‘__return_false’ ); to your theme’s functions.php file or a code snippets plugin. To turn it off only for images or only for iframes, use the same filter and check the tag name it passes.
Should I lazy load images above the fold?
No. Lazy loading an image that is visible when the page opens delays it and hurts Largest Contentful Paint. WordPress skips those images automatically, and gives the main one fetchpriority=”high” instead.
Can WordPress lazy load background images?
Not on its own. Core lazy loading only works on img and iframe tags, so images set as CSS backgrounds load immediately. A plugin such as WP Rocket can lazy load them.
Why are some of my images not lazy loaded?
Usually one of four reasons: the image is one of the first three in your content or in the header, it has no width and height attributes, it is added by JavaScript or CSS rather than an img tag, or a caching or optimization plugin has replaced WordPress lazy loading with its own.



3 Responses
Thanks for the amazing info that you provided in this article. Loved it. I hope you will post more meaningful articles in the near future. https://sites.google.com/view/treasurehunt7808e/home
You are amazing. Keep up the good work. Because it influences a lot of people in a good way.
Great Resource! I am personally using WP Rocket and WPX CDN and it’s working the best for me site.
HII, I’m JASEELA
FREELANCE DIGITAL MARKETING STRATEGIST IN MALAPPURAM
AS A FREELANCE DIGITAL MARKETING STRATEGIST IN MALAPPURAM EMPOWERING BUSINESSES WITH STRATEGIC DIGITAL SOLUTIONS | YOUR GROWTH, OUR EXPERTISE
Let’s Connect : https://jazeelaap.com/