Lazy Loading Explained: Images, Videos and Iframes in WordPress (and When Not to Use It)
Lazy loading in WordPress explained: how native lazy loading works, why the hero image should stay eager, and how to lazy-load videos and maps.

On this page
- What is lazy loading and why does it matter?
- How lazy loading works in WordPress
- When not to use lazy loading
- Always set image width and height
- Lazy loading YouTube videos and Google Maps
- Lazy loading on WooCommerce and Shopify stores
- Lazy loading with page builders and speed plugins
- Lazy loading and responsive images work together
- Common lazy loading problems and fixes
- Does lazy loading affect SEO?
- How to check lazy loading on your site
- Quick check: is lazy loading set up correctly?
- When to get help
- FAQs
- Lazy loading delays offscreen images, videos and iframes until the visitor scrolls near them, which saves data and speeds up the first view.
- Never lazy-load the main image visible on first load, because it delays Largest Contentful Paint; load it eagerly and give it high priority.
- Set width and height on every image, replace heavy YouTube and map embeds with click-to-load facades, and avoid stacking several lazy-load plugins.
Lazy loading in WordPress means images, videos and iframes below the visible screen are not downloaded until the visitor scrolls close to them. WordPress adds the browser's native loading="lazy" attribute to most images automatically, so many sites already have it. The real gains come from getting the details right: keeping the main above-the-fold image out of lazy loading, giving images dimensions, and replacing heavy video and map embeds with lightweight placeholders.
For Indian visitors on mid-range phones and variable mobile data, these details make a visible difference to how fast a page feels.
What is lazy loading and why does it matter?
A long page might contain dozens of images, a YouTube video and a Google Map. Without lazy loading, the browser fetches all of it at once, competing for bandwidth with the content the visitor actually sees first. With lazy loading, the browser fetches the visible content first and the rest only when needed. The benefits:
- Faster first view, because fewer files compete at the start.
- Less data used for visitors who never scroll to the bottom.
- Lower server and CDN load.
- Better Core Web Vitals when applied correctly. See Core Web Vitals explained.
How lazy loading works in WordPress
Since version 5.5, WordPress adds loading="lazy" to images in content, and later versions extended this to iframes. Since around version 6.3, WordPress also tries to skip lazy loading for the first large image and adds fetchpriority="high" to what it guesses is the main image. Themes and page builders can override this, so check what your site actually outputs by viewing the page source.
| Method | How it works | Notes |
|---|---|---|
| Native browser lazy loading | loading="lazy" attribute on img and iframe | No JavaScript, supported by modern browsers, WordPress adds it by default |
| JavaScript lazy loading | Script swaps placeholder for real image on scroll | Used by older plugins and some builders; adds script weight |
| Facade for embeds | Show a thumbnail; load the real player on click | Biggest saving for YouTube, Vimeo and maps |
| CSS background images | Not covered by native lazy loading | Need a plugin, a class-based script, or a switch to real img elements |
In short, lazy loading is about order: visible content first, everything else when needed.
When not to use lazy loading
Lazy loading the wrong image is one of the most common causes of a poor Largest Contentful Paint. Do not lazy-load:
- The hero or banner image at the top of the page.
- The logo and anything else in the header.
- The main product image on WooCommerce or Shopify product pages.
- The featured image of a blog post when it sits at the top.
- The first slide of a slider, if you must use a slider at all.
These should load eagerly, and the main one should carry fetchpriority="high" or be preloaded. Many speed plugins have an option to exclude the first few images from lazy loading; use it. How to fix Largest Contentful Paint goes deeper.
Always set image width and height
A lazy-loaded image without dimensions reserves no space. When it arrives, everything below jumps down, which hurts Cumulative Layout Shift and annoys readers mid-sentence. WordPress adds width and height to images inserted through the editor, but custom theme code, page builders and some sliders skip them. Check that every image has dimensions or a CSS aspect-ratio. Fixing layout shift covers the other common causes.
Lazy loading YouTube videos and Google Maps
A single YouTube embed can load a large amount of JavaScript before anyone presses play. A Google Maps iframe is similar. Native lazy loading helps only if the embed is below the fold. For embeds near the top, or many embeds on one page, use a facade:
- Show a static thumbnail of the video, or a static image of the map with your address.
- Add a play button or "View map" link.
- Load the real embed only when the visitor clicks.
Several WordPress performance plugins offer this for YouTube. For maps on a contact page, a simple static image linking to Google Maps is often enough and loads instantly. More in using video on a business website.
If product images look blurry or load at the wrong size in the shop grid, the cause is often the image sizes rather than lazy loading; see WooCommerce product images wrong size or blurry.
Lazy loading on WooCommerce and Shopify stores
Category pages with many product thumbnails benefit a lot, since visitors scroll through and only some images matter at first. Keep the first row of products eager and lazy-load the rest. On product pages, load the main image eagerly and lazy-load gallery thumbnails, related products and review photos. Shopify themes built on Online Store 2.0 generally include native lazy loading, but custom sections and apps may not follow the same rules, so check them. For store-wide speed work, see WooCommerce speed optimisation.
Lazy loading with page builders and speed plugins
Elementor, Divi and similar builders often add their own image handling, and caching plugins frequently include a lazy loading switch too. When two or three tools each try to lazy-load the same image, you can end up with placeholder images, delayed loading or scripts fighting each other. A sensible set-up:
- Leave WordPress native lazy loading on for normal content images.
- Use one performance plugin for extras: YouTube facades, background images and the "exclude first images" setting.
- Turn off duplicate lazy loading options in the builder and theme.
- Clear all caches, including any CDN cache, after changing settings, then test again.
Builder sections that set images as CSS backgrounds are a common blind spot. For the hero section, consider switching to a real image element so it can be prioritised. If you are unsure which plugins do what, WordPress caching explained clarifies how these tools overlap.
Lazy loading and responsive images work together
Lazy loading decides when an image downloads; responsive images decide which size downloads. WordPress generates several sizes and adds srcset and sizes attributes so a phone gets a smaller file than a desktop. If your theme outputs only the full-size image, lazy loading still leaves each image heavier than it needs to be. Check that thumbnails and content images use appropriately sized versions, and compress them in a modern format.
Common lazy loading problems and fixes
| Problem | Likely cause | Fix |
|---|---|---|
| PageSpeed warns "Largest Contentful Paint image was lazily loaded" | Hero image has loading="lazy" | Exclude it, add fetchpriority="high" |
| Images appear blank then pop in late | JavaScript lazy loader with a large threshold, or slow script | Switch to native lazy loading |
| Images never load for some visitors | Script conflict or blocked JavaScript | Use native loading, check console errors |
| Content jumps while scrolling | Missing width and height | Add dimensions or aspect-ratio |
| Double lazy loading | Theme, builder and speed plugin all applying it | Enable it in one place only |
| Background images not lazy | Set in CSS | Use a plugin feature or convert to img elements |
Does lazy loading affect SEO?
Native lazy loading is fine for SEO; Google's crawler renders pages and loads lazy images. Older JavaScript methods that keep the real image URL in a data attribute can, in some set-ups, hide images from search. If image search traffic matters to you, check URL Inspection in Search Console to see the rendered page, and keep important images as real img elements with good alt text. The image SEO guide covers alt text and file names.
How to check lazy loading on your site
- Open the page, right-click, view source and search for loading="lazy".
- Confirm the hero image does not have it and does have fetchpriority="high".
- Run PageSpeed Insights on mobile and read the LCP and image-related diagnostics.
- In browser developer tools, open the Network tab, filter by images and scroll to watch them load.
- Test on a real Android phone over mobile data, not just office Wi-Fi, and scroll at normal speed to spot late images.
Website speed test tools explained helps you read the results.
Quick check: is lazy loading set up correctly?
- View the page source (Ctrl+U) and search for
loading="lazy". The main hero image at the top should not have it. - Run the page through PageSpeed Insights (pagespeed.web.dev) and read the Mobile tab first and check whether it flags the Largest Contentful Paint image as lazily loaded.
- In Chrome DevTools Network, filter by Img and scroll to confirm images below the fold load as you reach them.
When to get help
Get help when hero images load late, when images or embeds flash in after scrolling, or when Core Web Vitals stay poor after a plugin change. WordPress speed optimisation covers this kind of work, with a written scope before anything starts. You can also send the details through the contact form.
FAQs
Does WordPress have lazy loading built in?
Yes. WordPress adds native lazy loading to images and iframes in content by default, and newer versions try to keep the first main image eager. Themes and builders can change this.
Should I lazy-load the hero image?
No. The hero image is usually your Largest Contentful Paint element. Load it eagerly and give it high fetch priority.
Do I need a lazy loading plugin?
Often not for images. A plugin is useful for YouTube facades, background images and excluding above-the-fold images, but enable lazy loading in only one tool.
Is lazy loading bad for SEO?
Native lazy loading is not. Some older JavaScript methods can hide images from crawlers, so prefer the native attribute.
Why does PageSpeed still say to defer offscreen images?
Some images may be outside WordPress content, such as theme templates or CSS backgrounds, or a builder may remove the attribute. Find those images in the report and handle them individually.
Need help with your website?
I'm a freelance WordPress developer building fast, SEO-friendly websites since 2020. Tell me what you need and I'll reply with a plan and a fixed quote, usually within 24 hours.


