Skip to content
Faisal Mahmud TusherDigital marketing, SEO & analytics
with Faisal Tusher

SEO › Troubleshooting

CLS Issue: Layout Shifts on Load

Why pages fail Cumulative Layout Shift and how to fix it: media without dimensions, injected banners and ads, late fonts, script-inserted and late content.
Troubleshootingintermediate8 min readUpdated

First, find the shifting element in field and lab data

Start in the Core Web Vitals report (Core Web Vitals), which the Search Console help page describes as grouping URLs with similar behaviour and rating them from real-user data. Open the mobile and desktop tabs separately, click the CLS issue, and note the URL group and its example pages. Write down which template the examples share; that template is where the fix will live.

Next, catch the shift happening. Load an example page in a fresh browser profile on a throttled mobile setting, because first-time visitors see consent notices and uncached fonts that a returning browser skips. Record a session in the performance panel and scroll as a visitor would. The layout shift records show each movement, its size and the nodes that moved; enabling the panel's highlighting of shifted regions makes the culprit visible on screen. Note two things for each large shift: which element caused it (the newcomer) and which elements moved (the victims). The fix always targets the newcomer. If the lab shows nothing, the shift likely happens later in the visit, after scrolling or once a delayed script runs, so repeat the recording with longer dwell and more scrolling. Then match what you saw to a row in the table.

Diagnosis table

Diagnosis

SymptomCheckLikely causeFix
Text jumps down as images, videos or embeds appearWidth and height attributes or aspect-ratio rules on the media that arrivedImages, video and embeds without reserved dimensionsDeclare dimensions or an aspect ratio on every media element and embed container
The whole page drops when a notice or advert appears at the topWhether a banner, consent notice or ad slot is inserted above content after renderBanners, consent notices and ads injected above contentReserve the slot's space, overlay the notice, or place it below the first screen
Headings and paragraphs reflow a moment after the text is visibleFont loading in the waterfall; the gap between the fallback and web font metricsWeb fonts swapping late and reflowing textPreload key fonts, choose font display deliberately, match fallback sizing
A block appears between existing sections after the page has renderedWhether the moved region is in the initial HTML or added by a script laterContent inserted by JavaScript after first renderRender the block on the server or hold its space with a placeholder
Content the visitor is reading jumps while scrollingWhat loads above the viewport during scroll: lazy media, ads, recommendation stripsContent loaded above what the visitor is already readingGive lazy content fixed space and never insert above the reading position

Fix, verify and prevent each cause

Media that arrives without a box

When an image, video or embedded player has no declared size, the browser lays out the page as though it were empty and pushes everything below it down once the file arrives. It is the single most common source of shift and the cheapest to remove. Embeds from video hosts, maps and social posts are frequent offenders because their height is only known once their script runs.

Fix: give every image and video width and height attributes, or an aspect-ratio rule, and wrap embeds in a container with a fixed ratio, as the CLS fixes in the Core Web Vitals guide set out.

Verify: the layout shift records no longer list the media element as a source, and the space it will occupy is visible as a blank box before it loads.

Prevent: make dimensions a required field in the image component and the content editor, so an editor cannot publish media without them.

Notices and advert slots dropped in from above

Cookie notices, announcement bars, app banners and advert slots are typically inserted by a script after the page has drawn, and if they enter at the top they push the entire page down. A consent notice is often seen only by first-time visitors, which is why the lab misses it and the field catches it.

Fix: reserve the height of any slot that will be filled, size advert containers for their most likely creative, and present notices as overlays or at the bottom of the screen rather than in the document flow above content. The Core Web Vitals guide groups these with the third-party scripts that most often inject into the layout.

Verify: recording a first visit with the notice showing produces no large shift when it appears.

Prevent: require every new banner or ad placement to declare its reserved space before it is approved.

Fonts that swap once the text is visible

If text first paints in a fallback font and then switches to the web font, any difference in width or line height reflows paragraphs and moves the content beneath them. On long articles the effect cascades down the page.

Fix: preload the fonts used in the first view, set the font display strategy deliberately, and match the fallback font's size and spacing to the web font so the swap changes appearance without changing layout, following the font advice in the Core Web Vitals guide.

Verify: the performance recording shows the swap happening with no layout shift record attached to text blocks.

Prevent: review font changes with the same care as layout changes, and limit the number of families and weights a template loads.

Blocks a script adds after the first render

Recommendation strips, personalised offers, review widgets and testing tools often fetch data and insert a block into a page that has already rendered. If the block lands between existing sections, everything below it moves. Client-side frameworks can produce the same effect when parts of the page render only after their data arrives.

Fix: render the block on the server where its content is known, or keep a placeholder of the right height in the initial HTML that the script fills, as the rendering trade-offs in the JavaScript SEO guide explain.

Verify: the block's region is present in the initial HTML at its final size, and the shift record for it disappears.

Prevent: ask, for every script-inserted component, where its space comes from before it ships.

Content loading above the reading position

Field data covers the whole visit, so movement while a visitor scrolls counts too. Lazy-loaded images without space, adverts that load as they near the viewport and infinite lists that insert items above the current position all move the text someone is reading. On a landing page the same movement causes mis-taps on a button that has just jumped, which the landing page speed guide treats as a conversion problem as well as a metric.

Fix: give lazy content its final space in advance, load new items below the reading position, and never insert above it except in response to the visitor's own action.

Verify: a scrolling recording shows no shifts outside those that follow a tap or click.

Prevent: include a scroll test, not just a load test, in the template review.

Prevention: space reserved in templates

Layout shift is a design property of templates, so prevention belongs in the components rather than in after-the-fact audits. Agree a rule that nothing enters the layout without a reserved box: media carry dimensions, embeds sit in fixed-ratio wrappers, advert and banner slots declare their height, script-filled blocks ship with a placeholder, and notices overlay rather than push. Build those defaults into the shared components so every new page inherits them.

Then test the way visitors actually experience the page. Each release that touches a template gets a recorded first visit on a throttled phone profile, with the consent notice showing and a scroll to the end, and any layout shift record is treated as a defect. Monthly, read the Core Web Vitals report by URL group and open any group whose status changed. The Google Search Central page on Core Web Vitals places the metric among page experience signals for SEO, but the stronger reason to keep layouts still is that moving buttons cost taps, and lost taps show up as a lower conversion rate (CVR) long before they show up in rankings. When the same group also fails loading or responsiveness, the sibling pages on slow largest contentful paint and on slow interactions take each metric separately.

Illustrative example — not a real result

A recipe site whose articles jumped twice

A recipe publisher's mobile article template sits in a "poor" CLS group of 6,200 URLs, with field CLS around 0.31. Recording a first visit shows two large shifts. The first, scoring about 0.18, happens when the consent notice slides in at the top and pushes the article down. The second, about 0.11, comes from an advert slot between the ingredients and the method that expands from nothing to a full-height unit as the reader scrolls past it. The team turns the consent notice into a bottom overlay and gives the advert container a fixed minimum height matching its most common creative. The recorded first visit now shows a total shift of 0.03, and over the following five weeks the field group moves to "good".

Common mistakes

Fixing the elements that moved instead of the element that caused the move. Testing only in a warm browser that never sees the consent notice. Recording the load and never scrolling. Collapsing an empty advert slot to zero height, which brings the shift back the moment an advert fills it. Other Search Console symptoms are routed from the SEO troubleshooting hub.

Frequently asked questions

Why does the lab test show almost no layout shift while Search Console reports a CLS issue?

A lab run loads one page once and usually stops when loading ends, while field data covers real visits, including scrolling, late adverts and consent banners that only appear for some visitors. A shift that happens after load, or only for first-time visitors, can be invisible in the lab. Reproduce the real conditions, scroll and accept or ignore the banner, and record the session in the performance panel.

Do layout shifts caused by a visitor's own click count against the page?

The metric is built around unexpected movement, so a change the visitor asked for, such as an accordion that opens on a tap, is not the problem. What counts is movement nobody requested: a banner pushing content down, an advert slot expanding while they read, or a block appearing above the paragraph they had reached.

Will fixing CLS improve rankings?

Google describes Core Web Vitals as part of the page experience it considers alongside many other signals, with relevance still mattering most. Fixing layout shift will not lift an irrelevant page, but it removes mis-taps and frustration on pages that already rank, which is worth doing for visitors and conversions as well as for search.

Terms used on this page

Where this page is used

Also related

Sources

  1. Understanding Core Web Vitals and Google search results — Google Search Central
  2. Web Vitals — web.dev
  3. Core Web Vitals report — Google Search Console Help

Related