How to Fix CLS (Layout Shift) in WordPress

Cumulative Layout Shift (CLS) measures how much a page's content jumps around while it loads. You've felt it: you go to tap a link and the page lurches down because an image or banner appeared above it. Google counts a CLS of 0.1 or less as "good."

Unlike LCP, CLS usually has nothing to do with your server or hosting. It's almost always caused by something on the page loading without space reserved for it. That makes it one of the easier Core Web Vitals to fix.

Step 1: Find what's shifting

  1. Run the page in PageSpeed Insights and look for the "Avoid large layout shifts" diagnostic (or the "Layout shift culprits" insight). It lists the elements that moved and how much.
  2. For a visual check, open Chrome DevTools → Performance, record a page load, and look at the "Layout shifts" track. Or use WebPageTest's filmstrip to watch the page load frame by frame.
  3. Check mobile. CLS is usually worse on small screens.

Remember that the field score (top of PageSpeed Insights) counts shifts that happen for the whole time a visitor is on the page, including while scrolling. A lab test only sees the initial load.

Step 2: Fix the usual WordPress causes

Images without dimensions

If an image has no width and height, the browser doesn't know how much space to save, so content jumps when it arrives.

  • WordPress adds width and height to images in posts automatically. Check your theme, page builder and sliders; some strip them or use CSS background images.
  • For CSS background images and custom blocks, give the container a fixed aspect-ratio or height.
  • Lazy loading is fine for images below the fold, but they still need dimensions.

Web fonts swapping

When a web font loads, text re-renders. If the web font is a very different size from the fallback, lines rewrap and push content down.

  • Preload your main font and host fonts locally (most speed plugins can, including Perfmatters and WP Rocket).
  • Use font-display: swap with a fallback font that's a similar size, or use size-adjust to match them.
  • Use fewer font families and weights.

Ads, embeds and iframes

Ad slots, YouTube videos, social embeds and maps often load with no reserved space.

  • Give each ad slot a fixed minimum height matching its most common ad size.
  • Wrap embeds in a container with an aspect ratio (16:9 for video).
  • Use click-to-load video previews, which also help speed.

Content injected above the fold

Cookie banners, announcement bars, "subscribe" bars and late-loading headers push the whole page down.

  • Make banners overlay the page (fixed position) rather than inserting them at the top.
  • Reserve space for elements that will appear, or show them only after the visitor interacts.

Speed plugin settings

Some optimizations can cause CLS:

  • Remove unused CSS / critical CSS. If the critical CSS misses styles for elements at the top of the page, they render unstyled and then jump. Regenerate critical CSS after design changes, or add exclusions.
  • Delay JavaScript. If a script that builds your menu, header or slider is delayed, the layout changes when it finally runs. Exclude those scripts from delay.
  • Lazy-loaded above-the-fold content. Exclude the first image and the header from lazy loading.

Sliders, carousels and animations

Sliders that resize while initializing are a classic CLS source. Use a static hero, or make sure the slider container has a fixed height before its script runs. Animate with transform and opacity, not properties like top or height.

WooCommerce specifics

  • Product galleries that initialize late.
  • "Added to cart" notices that push content down.
  • Price or stock badges that load via AJAX.

Reserve space for each, or overlay them.

Step 3: Verify

  • Re-test in PageSpeed Insights and check the layout shift diagnostic is gone.
  • Field data updates over a 28-day rolling window, so give it time.
  • Track it with DebugBear if you need to catch regressions.

Quick checklist

  • Every image, video and embed has dimensions or an aspect ratio
  • Fonts preloaded, hosted locally, with a size-matched fallback
  • Ad slots have reserved height
  • Cookie and promo banners overlay instead of pushing content
  • Critical CSS regenerated; header/menu scripts excluded from delay
  • No resizing sliders above the fold

CLS is one of three Core Web Vitals. For the full picture, read Core Web Vitals for WordPress, and see how to fix LCP and how to fix INP.

Some links in this article are affiliate links. See our disclosure.

Enjoyed this article?

Share it with your network