Skip to main content

Fix Guides

How to Fix High Cumulative Layout Shift (CLS)

Stop content jumping around while the page loads.

Quick fix

To fix high CLS, set explicit width and height (or aspect-ratio) on images and videos, reserve fixed space for ads and embeds, avoid inserting content above existing content after load, and use font-display: swap with matched fallback fonts. Target CLS ≤ 0.1.

Layout shift happens when something loads late and pushes content down — images without dimensions, ads, cookie banners, and web fonts are usual suspects. Reserving space before content arrives keeps the page stable.

Check your website

See how your site handles how to fix high cumulative layout shift (cls) — free, no account needed.

Business impact

Layout shift causes mis-clicks — users tap the wrong button as content moves. It feels broken and unprofessional. Fixing CLS is often straightforward once you identify what is moving.

Why this happens

CLS spikes from: images/iframes without width/height; ads that expand after load; dynamically injected banners; web fonts causing FOIT/FOUT; and late-loading embeds. PageSpeed highlights "Avoid large layout shifts". Fix by reserving space with CSS aspect-ratio or explicit dimensions, and loading injectables in reserved slots.

How to confirm the issue

Manually: reload the page and watch for jumps; DevTools → Performance → Experience lane shows layout shifts.

With Plexa Trust: PageSpeed-related findings; re-scan after dimension and ad slot fixes.

Step-by-step fix

  1. Add width and height to every <img> and <video>, or use CSS aspect-ratio.

  2. Reserve min-height for ad slots, embeds, and cookie banners.

  3. Avoid inserting content above the fold after initial render.

  4. Use font-display: swap and size-adjust for web fonts.

  5. Load cookie/consent banners in a reserved footer bar, not over content.

  6. Re-test CLS in PageSpeed Insights.

Platform-specific fixes

WordPress

  1. Modern WP adds width/height to images — verify theme outputs them.

  2. Configure ad plugins with fixed-size placeholders.

  3. Place cookie banners at bottom or in reserved header height.

Shopify

  1. Theme image snippets should include dimensions — check Liquid templates.

  2. Avoid apps that inject shifting banners at the top without reserved space.

Custom / React

  1. Always pass width/height to image components.

  2. Skeleton loaders should match final content dimensions.

How to verify the fix

  • Every image and embed gets reserved space before it loads.

  • Test on slow 3G throttling — shifts are more obvious.

  • Measure CLS in field data, not only lab.

Common mistakes

  • Images without dimensions in the theme.

  • Ads that start at 0px height then expand.

  • Cookie banners that push the whole page down on load.

Frequently asked questions

What is a good CLS score?

0.1 or less at the 75th percentile of real users.

Do fonts cause CLS?

Yes, when a fallback font is much smaller than the web font. Use size-adjust or matched fallbacks.

Should cookie banners cause shift?

They should not push main content. Use a fixed overlay or reserved bar.

What about responsive images?

Use aspect-ratio in CSS so space is reserved at any viewport width.

Can lazy loading cause CLS?

If dimensions are missing, yes — the image loads and pushes content. Always set dimensions.

How do I find shift sources?

PageSpeed layout shift diagnostics, DevTools Experience lane, and visual reload testing.

Do animations affect CLS?

Only if they change layout. Prefer transform/opacity animations that do not reflow.

How do I confirm it worked?

CLS drops in PageSpeed and Search Console field reports.

Think you've fixed it?

Run a free scan to verify the issue is resolved. Upgrade to Pro on Plexa Trust for the full audit, monitoring alerts, and score history.

Verify with a free scan

Upgrade to Pro for monitoring