Skip to main content
SlapMyWeb

Performance fix

How to Lazy-Load Off-Screen Images

Defer images below the fold so they don't compete with the initial render.

Difficulty
Easy
Impact
Medium
Time
10 min

Before

<img src="gallery-12.jpg" width="800" height="600" alt="...">

After

<img src="gallery-12.jpg" width="800" height="600" alt="..." loading="lazy" decoding="async">
Before and after code for: How to Lazy-Load Off-Screen Images

Images that are not lazy-loaded are all fetched during the initial page load, even the ones far below the fold, competing for bandwidth with the content people can actually see. Add loading="lazy" to off-screen images. Leave the largest above-the-fold image eager, because lazy-loading it delays the very element Largest Contentful Paint measures.

Why it matters

Loading every image up front, including ones far below the fold, wastes bandwidth and delays the content users actually see first. Native lazy-loading defers off-screen images until the user scrolls near them.

How to fix it

  1. Add loading="lazy"

    Add the attribute to images and iframes that start below the fold.
  2. Never lazy-load the hero

    Keep above-the-fold / LCP images eager (omit lazy) so they load immediately.

The code

Beforehtml
<img src="gallery-12.jpg" width="800" height="600" alt="...">
Afterhtml
<img src="gallery-12.jpg" width="800" height="600" alt="..." loading="lazy" decoding="async">

On your platform

WordPress

WordPress adds loading="lazy" automatically since 5.5; ensure a "Skip lazy load" rule covers your hero image.

Next.js

next/image lazy-loads by default; pass priority to the hero to opt out.

Sources

Check your site with our free tool

Website Speed Test

Fixed that one.
Now find the rest.

A free audit ranks every issue on your site by the score points it costs, and links each one straight to its guide.

Run a free audit
Free foreverNo signupLive scan progress