1. Home
  2. Blog
  3. Website Speed
Website Speed

Lazy Loading Explained: What It Does, When It Helps and When It Makes Your Site Slower

Lazy loading explained in plain terms: how it works for images, video and iframes, why it helps page speed, and the mistakes that make LCP worse.

8 min readE-web UK
Smartphone in a hand scrolling a long web page with image placeholders loading further down

Lazy loading means the browser waits to download images, videos and embeds until they are about to scroll into view, instead of fetching everything the moment the page opens. It matters because most pages carry far more media below the fold than above it, and loading all of it up front wastes data and slows down the content people actually see first. Done properly it is one of the cheapest speed wins available. Done carelessly, especially on your main hero image, it makes things worse.

This guide covers how lazy loading works in modern browsers, what WordPress already does for you, where it goes wrong and how to check your own pages.

Key takeaways

  • Lazy loading delays off-screen media until the visitor scrolls near it.
  • Browsers support it natively with loading="lazy" on images and iframes.
  • Never lazy load the largest image in the first screen; it delays LCP.
  • Set width and height on lazy images so the layout does not jump.
  • YouTube and map embeds gain the most from a click-to-load facade.
  • Check results with PageSpeed Insights and Chrome DevTools, not by eye.

How lazy loading works

When a browser reads a page's HTML it normally queues every image it finds. A long service page with twenty photos asks for all twenty straight away, even though the visitor on a phone can see perhaps one of them. Those requests compete for bandwidth with the CSS, fonts and the hero image that the visitor is waiting on.

With lazy loading the browser notes where each image sits, skips the ones a long way down, and fetches them as the visitor scrolls towards them. Chrome, Firefox and Safari all start the download some distance before the image reaches the screen, so on a normal connection the image is usually ready by the time it appears.

There are two ways to do it:

  • Native lazy loading: add loading="lazy" to an img or iframe tag. The browser does the rest. No JavaScript needed.
  • JavaScript lazy loading: a script (often using IntersectionObserver) swaps a placeholder for the real image source when it nears the viewport. This was the only option before browsers supported the attribute and is still used for background images and some sliders.

For ordinary images and iframes, native is the right choice now. It is simpler, it works if scripts fail, and search engines understand it. The web.dev guide to browser-level lazy loading covers the details.

Why it matters for speed and Core Web Vitals

Lazy loading reduces how much the page asks for during the first few seconds. That has a few knock-on effects:

  • The bytes that do load first are the ones above the fold, so the visible part of the page completes sooner.
  • Visitors who never scroll to the bottom never download the bottom, which saves their mobile data and your hosting bandwidth.
  • The main thread has less image decoding to do early on, which can help pages feel responsive sooner on cheaper Android phones.

It does not directly fix everything. Largest Contentful Paint depends mostly on how fast your main above-the-fold element arrives. Cumulative Layout Shift depends on whether space is reserved for things before they load. Lazy loading touches both, for better or worse, depending on how it is set up. Our wider guide to website speed optimisation puts it in context with caching, image formats and hosting.

The mistake that makes pages slower

The most common problem we find in audits is a lazy-loaded hero image.

The hero is usually the Largest Contentful Paint element: the big photo or banner at the top. If it carries loading="lazy", the browser deliberately holds it back until it has worked out the layout and confirmed the image is in view. That delay goes straight onto your LCP time. PageSpeed Insights will often flag it as "Largest Contentful Paint image was lazily loaded".

The fix is to treat the first screen differently:

  1. Remove loading="lazy" from the hero image and anything else visible without scrolling, such as the logo.
  2. Add fetchpriority="high" to the hero image so the browser fetches it ahead of less important files.
  3. If the hero is a CSS background image, consider changing it to a real img element, or preload it, because the browser cannot discover background images until the CSS has loaded.

Sliders are a particular trap. The first slide should load eagerly; slides two onwards can be lazy. Many slider plugins get this the wrong way round, or lazy load all of them through their own script.

Stopping layout shift on lazy images

When an image arrives late and the page has not reserved room for it, the text below jumps down. That is layout shift, it counts against CLS, and it is how people end up tapping the wrong button.

The cure is simple and often missed in hand-built templates: give every image width and height attributes that match its aspect ratio. The browser uses them to hold the right amount of space before the file arrives, even if CSS then scales the image to fit the column. WordPress adds these automatically for images inserted through the editor, but custom theme templates, ACF image fields printed by hand and some page builders leave them out.

For responsive designs where the ratio changes at different screen sizes, the CSS aspect-ratio property does the same job.

What WordPress already does for you

Since version 5.5, WordPress adds loading="lazy" to images in post content and to embedded iframes. Later releases improved this so the first content image is not lazy loaded, and so WordPress adds fetchpriority="high" to the image it judges most likely to be the LCP element. The WordPress core development blog covers each change as it ships.

That logic works well on simple blog templates. It is less reliable when:

  • Your hero is output by a theme template or page builder rather than as the first image in the content.
  • A speed plugin such as WP Rocket, Perfmatters or LiteSpeed Cache adds its own lazy loading on top, sometimes overriding core's exclusions.
  • The header contains a logo image that WordPress counts as "first", pushing the real hero into the lazy group.

Most of those plugins have an option to exclude the first few images, or to skip images with a particular class. Setting this correctly is usually a five-minute job once you know which image is the LCP element. If you run a page builder, our post on WordPress page builders covers some of their other speed side effects.

Iframes, video and maps

Embeds are where lazy loading saves the most. A single YouTube embed pulls in a large amount of JavaScript before anyone presses play. A Google Map embed is similar. On a contact page with both, the third-party code can easily outweigh the rest of the page.

Native loading="lazy" on the iframe helps when the embed sits below the fold. Better still is a facade: show a static thumbnail with a play button, and only load the real player when someone clicks. Plugins such as WP YouTube Lyte or the facade options in Perfmatters and WP Rocket do this, or a developer can build it in a few lines. For maps, a static image of the location that links to Google Maps is often all a local business needs.

Facades also help with privacy, since the YouTube or Google scripts do not run (and do not set cookies) until the visitor chooses to interact. That ties in neatly with consent requirements under UK GDPR and the ICO's cookie guidance.

Things lazy loading cannot fix

It is worth being clear about the limits, because we often see lazy loading switched on as a cure-all.

  • Oversized images. A 4,000 pixel wide photo shown in a 600 pixel column is still a huge download when it does load. Resize, use srcset, and serve WebP or AVIF.
  • Slow hosting. If the server takes two seconds to produce the HTML, nothing downstream can make up for it. See our notes on UK web hosting.
  • Heavy scripts. Chat widgets, tracking tags and animation libraries load regardless of images. Delay or remove the ones you do not need.
  • Short pages. If everything is above the fold anyway, there is nothing to defer.

How to check your own pages

A quick routine we use on client sites:

  1. Run the page through PageSpeed Insights on mobile. Look under Diagnostics for "Largest Contentful Paint element" and for any warning about a lazily loaded LCP image or offscreen images.
  2. In Chrome, open DevTools, go to the Network tab, filter to Img, tick Disable cache and reload. Only images in the first screen should appear. Scroll and watch the rest arrive.
  3. Right-click the hero image, choose Inspect and confirm it has no loading="lazy" and ideally has fetchpriority="high".
  4. Check a couple of lazy images for width and height attributes.
  5. Test on a real mid-range phone over 4G, not just office Wi-Fi.

If the results are confusing, or a plugin keeps undoing your settings, this is the sort of fix we handle as part of web development or a care plan.

Frequently asked questions

Does lazy loading affect SEO?

Native lazy loading is fine for SEO because Google's crawler understands the loading attribute and still finds the images. Problems come from old JavaScript methods that hide the real image URL, or from lazy loading the LCP image, which hurts Core Web Vitals.

Should I lazy load all images?

No. Images visible without scrolling, especially the hero and logo, should load straight away. Lazy load everything further down the page.

Is lazy loading on by default in WordPress?

Yes. WordPress has added loading="lazy" to content images and iframes since version 5.5, and now tries to skip the first image. Theme templates and page builders may not follow the same rules, so check your hero image manually.

Can I lazy load background images?

Not with the native attribute, which only works on img and iframe elements. You need a small script or a plugin feature that adds the background when the section nears the viewport. Above-the-fold backgrounds should be preloaded instead.

Why does PageSpeed say my LCP image was lazily loaded?

Your main above-the-fold image has loading="lazy" on it, usually added by a theme, page builder or speed plugin. Exclude that image from lazy loading and add fetchpriority="high" to it.

Want a second pair of eyes on your page speed?

If PageSpeed keeps flagging the same problems, we can find the cause and fix it properly rather than stacking another plugin on top. Contact us with the URL you are worried about.

Want this done properly?

Tell us what your website, app or system has to do. We will come back with a clear plan and a fixed written quote.