LAZY LOADINGImages, maps and widgetsLazy loading tells the browser an image or embed can wait until the visitor scrolls near it. Further down a page, it saves data and leaves bandwidth for what people see first. On the hero image, it delays the main content. Built on a script that waits for a scroll, it can hide content from Google.
What does lazy loading actually do?
It holds back an image or iframe until it nears the viewport. You add loading="lazy" to an <img> or <iframe>, and the browser decides how close is close enough: the HTML standard leaves that distance to each browser. The other value, eager, is the default, so an image without the attribute loads straight away.
Loading is only deferred when JavaScript is enabled, an anti-tracking measure in the standard. And browsers without support ignore the attribute, so it never breaks a page.
Which images should never be lazy loaded?
Anything likely to be on screen when the page opens, above all your Largest Contentful Paint (LCP) image, usually the hero. web.dev says never to lazy-load it, because a lazy image waits until layout confirms it is in the viewport before it starts downloading. Google's lazy-loading guidance gives the same advice for content likely to be visible straight away.
For that one image, add fetchpriority="high" as well. It is a hint, not a command, asking the browser to fetch the image ahead of other images. web.dev notes that high priority on more than one or two images stops helping. We load these eagerly:
- The hero or main product image, with
fetchpriority="high". - The logo and other header images.
- Cards or products on the first screen.
- The first slide of a carousel.
A hero set as a CSS background, or added by JavaScript, isn't in the HTML for the browser to find, and web.dev lists both as reasons LCP starts late. A <link rel="preload"> with fetchpriority="high" lets the browser find it early.
Check a phone and a desktop: which images sit on the first screen changes with viewport size.
<!-- First screen: load now, high priority -->
<img src="/img/hero.jpg" alt="Homepage design review"
width="1600" height="900" fetchpriority="high">
<!-- Further down: wait until near the viewport -->
<img src="/img/workshop.jpg" alt="Site planning workshop"
width="800" height="600" loading="lazy">
<!-- Map near the footer -->
<iframe src="MAP-EMBED-URL" title="Map to our office"
width="600" height="450" loading="lazy"></iframe>
<style>
img { max-width: 100%; height: auto; }
iframe { width: 100%; height: auto; aspect-ratio: 4 / 3; }
</style>How do you stop lazy images moving the page?
Give every image width and height attributes with its real pixel size, or reserve the space with the CSS aspect-ratio property. Browsers use the attributes to work out the image's shape before the file arrives, and hold that space. MDN calls them especially important for lazy images: until they load, they are zero by zero, so the text around them reflows when they appear.
web.dev adds that missing dimensions can make the browser load a whole gallery at once, and that shifts often happen mid-scroll, when lazy content arrives without reserved space.
Pair the attributes with max-width: 100% and height: auto in CSS so images still shrink on phones. Iframes default to 300 by 150 pixels, so size them, or use aspect-ratio for a full-width map. For widgets that can't know their height in advance, a min-height holds the space.
What about maps, social posts and chat widgets?
Lazy-load iframes below the fold, and put heavier widgets behind a facade. web.dev's embed guidance covers both. A facade is a static stand-in that looks like the embed: it can preconnect to the provider on hover, and the real embed replaces it on click.
- Maps: a lazy iframe, or a static map image when nobody needs to pan or zoom.
- Social posts: a facade, or an image of the post linking to the original.
- Chat widgets: a facade button that loads the chat on click.
- Video: hero loops and YouTube embeds have their own rules, in our video guide.
Give each iframe a title, so screen reader users know what it holds without entering it, as MDN explains. And treat lazy loading as a hint: web.dev notes it can be inconsistent, because browsers use different distances from the viewport.
Can Google see content that loads lazily?
Yes, if it loads when it becomes visible in the viewport, without a scroll or a click. Google's guidance on lazy-loaded content says Google Search does not interact with your page, and recommends methods that don't depend on user actions: built-in browser lazy loading, the IntersectionObserver API, or a library that loads content as it enters the viewport.
So native loading="lazy" is safe for search. The risks are scripts that load content only after a scroll event, and facades: web.dev advises keeping these techniques to offscreen or non-primary content, so critical content still gets indexed. Keep your address and opening hours in the page, not in a widget.
To check, run the page through URL Inspection in Search Console. Google says that if your image URLs appear in the src of the <img> elements in the rendered HTML, the setup works.
Where to start
- Find the first-screen images on each main template, remove
loading="lazy"from them and give the LCP imagefetchpriority="high". - Lazy-load images and iframes further down.
- Give every image and iframe
widthandheight, or anaspect-ratio. - Swap heavy widgets for facades or static images.
- Recheck key pages in URL Inspection.
Our SEO, speed and AI search service makes these fixes on Webflow, Framer, WordPress, Shopify and Next.js sites, and a website review shows which apply to yours.
FAQ
Frequently asked questions
Should images inside tabs and accordions be lazy loaded?
Yes, when the panel is closed as the page loads. web.dev notes that Chrome, Safari and Firefox don't load lazy images styled display: none, on the image or on a parent element. Other ways of hiding, such as opacity: 0, still trigger the download. Check how your tabs hide their content, then open each one to confirm its images appear promptly.
Can we lazy load a CSS background image?
Not with the loading attribute: web.dev says it only works on image and iframe elements, not CSS backgrounds. If the image matters for search, use a real image element instead, because Google's image guidance says it doesn't index CSS images. For a decorative background further down, a script using the IntersectionObserver API can add it when the section nears the viewport.
Can fetchpriority lower an image's priority?
Yes. fetchpriority="low" tells the browser an image matters less than others. web.dev suggests it for images near the top that aren't immediately important, such as the hidden slides of a carousel, which the browser may treat as close enough to load early even with loading="lazy". MDN advises using the attribute sparingly, because wrong priorities can slow a page.
Our CMS adds lazy loading automatically. Is that a problem?
It can be, if it lazy-loads the first image too. When web.dev studied WordPress's default lazy loading, it found the feature cut image bytes but delayed LCP, and skipping lazy loading for images in the first screen reversed that in lab tests. Whatever your platform, open the page source and check that the hero image doesn't carry loading="lazy".
Do we need a lazy loading library, or is the attribute enough?
For most sites the attribute is enough. web.dev says that with lazy loading built into modern browsers, you probably don't need a third-party library to lazy-load images. Reasons to keep one are a fallback for browsers without support, or more control over when loading starts, since Chrome's distance thresholds are hardcoded and can't be changed through the API.

