Skip to main content
SlapMyWeb
Fix Guide

How to Fix a High Cumulative Layout Shift

Stop the page jumping around while it loads by reserving space up front.

Medium High Impact 1-2 hours

Cumulative Layout Shift measures how much content moves while the page loads. A good score is 0.1 or less. Nearly all shift comes from three things: images and iframes without declared dimensions, content injected above existing content, and web fonts swapping in at a different size to the fallback.

Why It Matters

Layout shift is the failure people actually notice — the tap that lands on the wrong thing because a banner appeared. It is a Core Web Vital measured on real visits, not in a lab.

How to Fix

1

Declare dimensions on every image and iframe

Width and height attributes let the browser reserve the right space before the file arrives. CSS can still size it responsively.
2

Reserve space for injected content

Banners, ads and consent notices that appear after load should occupy a container sized from the start rather than pushing content down.
3

Match the fallback font's metrics

Use font-display: swap with size-adjust, or a fallback chosen so the swap does not change line count.
4

Measure on a phone

CLS is worst on narrow viewports, where a single unsized image can move everything below it.

Code Fix

html
Before (broken)
<img src="/photo.jpg" alt="…">
<!-- no dimensions: everything below jumps when it loads -->
After (fixed)
<img src="/photo.jpg" width="1200" height="800" alt="…" style="height:auto;max-width:100%">

Platform-Specific Instructions

WordPress

WordPress adds dimensions to images inserted through the editor; images added by hand in a template usually lack them.

Next.js

next/image requires width and height (or fill with a sized parent), which is why it prevents most image-driven shift by default.

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 signupResults in 30s