Speed & performance · Guide
How Lazy Loading Works in WordPress (And When to Turn It Off)
Short answer
WordPress adds loading=“lazy” to most images by default, so the browser only downloads each image as the visitor scrolls near it. That saves bandwidth on long pages, but the first image should load at once, so WordPress skips lazy loading for the first few images and marks the likely largest image with fetchpriority=“high”. Turn lazy loading off only for images in the first screen, and leave it on for everything below the fold.
Key takeaways
- WordPress has added loading=“lazy” to images by default since version 5.5, when they carry width and height attributes.
- WordPress skips lazy loading for the first 3 content images and marks the likely largest image with fetchpriority=“high” since version 6.3.
- Never lazy load the hero image, because the browser must lay out the page before it can fetch a lazy image, which delays LCP.
- Check lazy loading in the page source for loading=“lazy” and in the Network tab, where lazy images load only as you scroll.
- A good LCP is 2.5 seconds or less and a good CLS score is 0.1 or less, both judged at the 75th percentile.
- Turn lazy loading off site-wide only as a short test, since every image then loads at once and costs bandwidth.
What is lazy loading in WordPress?
Lazy loading means the browser waits to download an image until the visitor scrolls near it, instead of loading every image when the page opens.
A long post with 20 images only needs the first few at once. The rest can wait until the reader scrolls down to them.
MDN describes lazy loading as a way to shorten the critical rendering path by holding back resources the first screen does not need. Images are the usual case, since most of them sit below the fold on a long page.
WordPress uses the native browser method, not JavaScript. It adds a loading attribute to the image tag, and the browser does the rest.
The loading attribute works on img, iframe, video and audio elements, according to MDN. For images, the two values that matter are lazy, which waits, and eager, which loads at once.
Does WordPress lazy load images by default?
Yes, WordPress adds loading="lazy" to images by default, so most sites already use lazy loading without any setting or plugin.
The change arrived in WordPress 5.5, which added loading="lazy" to every img tag that has width and height attributes, according to the Make WordPress Core dev note. Images without both dimensions get no attribute.
WordPress adds the attribute to:
- Images in post content (
the_content) - Images in post excerpts (
the_excerpt) - Images in text widgets
- Avatar images
- Template images from
wp_get_attachment_image()
Iframes joined in WordPress 5.7, so embedded videos and maps can wait too, according to the Make WordPress Core note on the 5.9 changes.
How does WordPress decide which images to lazy load?
WordPress skips lazy loading for the first few images on the page and adds loading="lazy" to the rest, because the first images are usually in view at once.
| Image position | What WordPress adds | Why |
|---|---|---|
| First 3 content images | No loading attribute | Likely in the first screen |
| First large image | fetchpriority="high" | Likely the largest content element |
| Later images | loading="lazy" | Below the fold, so they can wait |
The count of 3 comes from the wp_omit_loading_attr_threshold filter, whose default rose from 1 in WordPress 5.9 to 3 in WordPress 6.3, according to the Make WordPress Core 6.3 note.
WordPress 5.9 first skipped only the very first content image or iframe. An analysis of 50 popular themes showed LCP gains of up to 30 percent from that change, according to the Make WordPress Core 5.9 note.
An image with no width and height gets no loading attribute at all. WordPress 5.5 also back-fills those dimensions on attachment images so the browser can reserve space, according to the Make WordPress Core 5.5 note.
Size matters before lazy loading does. Give each image its real display size so the browser reserves the right box before the file arrives.
What does fetchpriority=“high” do for the first image?
It tells the browser to fetch that image before other resources, even before the page layout is worked out, so the main image appears sooner.
WordPress 6.3 added this automatically for the image it judges most likely to be the largest content element, and the Make WordPress Core note says it typically improves LCP by 5 to 10 percent.
Only images above a size limit qualify. The limit is 50,000 pixels of width times height, so a 300 by 200 image qualifies at 60,000 while a 200 by 200 image does not at 40,000, according to the same 6.3 note.
WordPress never puts fetchpriority="high" and loading="lazy" on the same image. The two clash, and core raises a warning if a theme sets both, according to the Make WordPress Core 6.3 note.
The image with high priority is usually the LCP element. How to improve Largest Contentful Paint in WordPress shows how to find which element that is on your pages.
How do you check lazy loading is working?
Open the page in your browser, view the page source, and look for loading="lazy" on the images below the fold.
You need admin access to your site and a desktop browser with developer tools. The checks below take about 15 minutes for one page.
- Open a post with several images in Chrome or Firefox.
- Right-click the page and choose View page source.
- Press Ctrl+F and search for
loading="lazy". - Check that images near the top have no lazy attribute while images further down carry it.
- Open DevTools with F12, go to the Network tab, filter by Img, and reload the page.
- Scroll down slowly and watch new image requests appear as each image nears the screen.
Images that load before you scroll to them are not lazy. Images that appear in the Network tab only as you scroll are working as intended.
Then run the page through PageSpeed Insights and read the LCP number. A good LCP is 2.5 seconds or less at the 75th percentile, according to web.dev.
If the score misses, our Core Web Vitals guide lists the fixes in order, starting with the largest content element.
How do you turn off lazy loading for one image?
WordPress core has no lazy loading switch in the block editor, so one image needs a small code snippet or a plugin that adds the choice.
The editor lets you set alt text, size and alignment, but not the loading attribute. The Make WordPress Core 5.5 note lists filters, not an editor setting, as the way to change it.
Use code when you are happy editing your theme. Add this filter to your child theme functions.php file or a code snippets plugin, changing hero.jpg to your image file name:
add_filter( 'wp_img_tag_add_loading_attr', function( $value, $image, $context ) {
if ( 'the_content' === $context && false !== strpos( $image, 'hero.jpg' ) ) {
return false;
}
return $value;
}, 10, 3 );
Returning false drops the attribute entirely, which the Make WordPress Core 5.5 note recommends over setting loading="eager".
Use a plugin when you want a checkbox instead of code. As of November 2026, the Disable Lazy Load plugin adds one per image, according to its WordPress.org page:
- Install and activate Disable Lazy Load from Plugins, then Add New.
- Go to Media, then Library, and open the image.
- Tick the Disable default lazy-loading feature checkbox at the bottom.
- Save the image and reload the page to confirm the attribute is gone.
How do you turn off lazy loading for your whole site?
Add one filter that returns false for wp_lazy_loading_enabled, and WordPress stops adding loading="lazy" to every image.
- Add the snippet below to your child theme
functions.phpfile or a code snippets plugin. - Save the file and clear any cache plugin.
- Reload a page and view the page source.
- Confirm that no
loading="lazy"remains on any image.
add_filter( 'wp_lazy_loading_enabled', '__return_false' );
The filter takes a default of true, so returning false switches the whole feature off, according to the Make WordPress Core 5.5 note.
Do this only as a short test or when another tool already handles lazy loading. Turning it off site-wide loads every image at once, which costs bandwidth on long pages.
The trade-off is real. In a web.dev A/B test on a WordPress archive page, turning lazy loading off cut desktop LCP from 2,029 ms to 1,759 ms, but image bytes rose from 577 KB to 1,173 KB.
How do you lazy load images with a plugin?
A plugin adds lazy loading where core does not reach, such as background images, and gives you an exclusion list for the first screen.
WP Rocket adds a LazyLoad switch for CSS background images as well as normal images, according to its knowledge base. Core handles content images, so the plugin covers the gaps.
As of November 2026, the WP Rocket settings path is Settings, then WP Rocket, then the Media tab. The steps are:
- Go to Settings, then WP Rocket, in your dashboard.
- Open the Media tab.
- Tick Enable for images and Enable for iframes and videos.
- Add the hero image file name or class to Excluded images or iframes.
- Save changes and clear the cache.
A plugin cannot fix an image that is far too large. How to serve images in next-gen formats in WordPress shows how to cut the bytes first.
What mistakes make lazy loading slow your site?
The most common mistake is lazy loading the hero image, which delays the largest element on the page and hurts LCP.
The mistakes to avoid are:
- Lazy loading the hero or logo image in the first screen.
- Lazy loading every image by hand, including the first three that core already exempts.
- Missing
widthandheight, so content jumps when images arrive. - Adding a second lazy loader on top of core without checking the result.
- Lazy loading images in a slider that shows them without any scrolling.
The web.dev A/B test showed the fix clearly: loading only below-fold images lazily cut archive desktop LCP to 1,749 ms while keeping image bytes at 577 KB.
Missing dimensions cause layout shift. WordPress 5.5 back-fills width and height on attachment images so the browser can reserve space before the image loads, according to the Make WordPress Core 5.5 note.
If text still jumps as images load, our guide to fixing Cumulative Layout Shift in WordPress walks through the causes one by one.
A good CLS score is 0.1 or less, according to web.dev. That is the number to watch after you fix image sizes.
When should you turn lazy loading off?
Turn it off for images in the first screen, and leave it on for everything else, because the first screen is what LCP measures.
Pages where the hero is the LCP element need the hero eager. WordPress 6.3 already marks the likely LCP image with fetchpriority="high", so check before you change anything, according to the Make WordPress Core 6.3 note.
Adoption is wide. Built-in lazy loading is used by 29 percent of websites, and 84 percent of those sites run WordPress, according to web.dev.
As of November 2026, native lazy loading is supported by most major browsers, and MDN lists the loading property as Baseline Widely available.
For the wider speed picture, our WordPress speed guide covers caching, images and hosting in one place.
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 WordPress 5.7 it does the same for iframes. You do not need a plugin or a setting to switch it on. The first few images on the page are skipped so the top of the page still loads at once.
How do I check if lazy loading is working on my site?
Open the page, right-click and choose View page source, then search for loading=“lazy”. Images near the top should have no lazy attribute, while images further down should carry it. In DevTools, open the Network tab, filter by Img, reload, and scroll to watch new image requests appear only as each image nears the screen.
How do I stop lazy loading on one image only?
Core has no switch for this in the block editor. Use the wp_img_tag_add_loading_attr filter to drop the attribute for one image, or install the Disable Lazy Load plugin, which adds a Disable default lazy-loading feature checkbox to each image in the Media Library. Use either route only for images in the first screen.
Should I lazy load the hero image?
Yes, but only for images in the first screen, such as the hero image or logo. Lazy loading the largest content element delays LCP, which is the metric that measures when the main content appears. Images below the fold should stay lazy so they do not compete with the hero for bandwidth.
Do I still need a lazy load plugin if WordPress does it already?
No. WordPress core already lazy loads content images, avatars and template images, so a plugin is only needed for gaps such as CSS background images or for an exclusion list. Running two lazy loaders on the same images can cause odd results, so pick one loader and check the page after turning it on.
Can lazy loading cause layout shift?
Look for missing width and height attributes first, since images without reserved space push content down as they load. WordPress 5.5 back-fills those dimensions on attachment images. Keep lazy loading off the hero image, and check the CLS score in PageSpeed Insights, where 0.1 or less is good.
Sources
- Lazy-loading images in 5.5 Make WordPress Core
- Enhanced lazy-loading performance in 5.9 Make WordPress Core
- Image performance enhancements in WordPress 6.3 Make WordPress Core
- The performance effects of too much lazy loading web.dev
- Web Vitals web.dev
- Lazy loading MDN
- HTMLImageElement: loading property MDN
- Defer offscreen images WP Rocket
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
