The short fix
- Find what moved: the test report lists the shifting elements and, often, the cause.
- Give every image and video
widthandheightattributes, or a CSSaspect-ratio. - Reserve space for sliders, promo bars, widgets and embeds with
min-heightoraspect-ratio; show cookie notices as an overlay. - Make the fallback font match the web font, or use
font-display: optional. - Re-test, then watch CLS in Search Console’s Core Web Vitals report.
What PageSpeed Insights is telling you
Layout shift culprits is a Lighthouse 13 insight, listed under Insights in PageSpeed Insights. It replaced the older audit Avoid large layout shifts. Two related audits stay as separate diagnostics, because they also flag images and animations that haven’t caused a shift yet: Image elements do not have explicit width and height and Avoid non-composited animations.
It shows the worst burst of layout shifts during loading, the elements that moved and, when Lighthouse can tell, the likely culprit: an unsized image element, a web font, an injected iframe (often an ad or embed) or an animation. Chrome notes that every layout shift can be fixed even when no culprit is named.
In a FlashMax report this problem is the card The page jumps while loading; it clears when the layout stays steady, with a shift score of 0.1 or less.
Why layout shifts matter
The metric behind the insight is Cumulative Layout Shift (CLS), one of Google’s three Core Web Vitals and 25% of the Lighthouse score. Good is 0.1 or less, poor is above 0.25, judged at the 75th percentile of real visits.
Each shift is scored by how much of the screen moved multiplied by how far it moved. Shifts less than a second apart are grouped into windows of up to 5 seconds, and CLS is the worst window. Shifts within 500 ms of a tap or click don’t count, because the visitor expects the page to react.
For a store the cost is concrete: a banner that lands late pushes the product grid down just as someone taps, and they open the wrong product or miss Add to cart.
Lab and field differ here. Lighthouse only measures shifts during loading. Real visitors also meet shifts later, while scrolling or when a widget or popup appears, so the CLS in Search Console can be worse than in a lab test.
How common it is
In our study of 40,951 WooCommerce stores, 19.0% (7,785 stores) got this card. Their median phone score was 39, against 55 for stores without it, one of the larger gaps in the study. It is still a correlation, not proof: stores whose pages jump usually have other problems too.
Most stores pass. Across all sites we tested, 81.0% had a lab CLS of 0.1 or less in the phone test, and the median store’s phone CLS was 0.006.
How to find what moves
- FlashMax: in the free speed test (about a minute) the card lists the elements that moved.
- PageSpeed Insights: open Layout shift culprits to see the worst cluster, the elements and any culprit.
- Chrome DevTools, Rendering tab: tick Layout Shift Regions and reload. Areas that shift flash purple.
- Chrome DevTools, Performance panel: record a reload; in the Layout shifts track, purple bars mark clusters of shifts and diamonds mark single shifts. Click one to see the elements that moved.
To log every shift with the elements involved (in entry.sources), paste this into the Console and reload:
let cls = 0;
new PerformanceObserver((entryList) => {
for (const entry of entryList.getEntries()) {
if (!entry.hadRecentInput) {
cls += entry.value;
console.log('Current CLS value:', cls, entry);
}
}
}).observe({type: 'layout-shift', buffered: true});Test at phone width, logged out and in a private window. Logged-in admins often see a different page (cache plugins skip them), and cookie notices show only on a first visit.
How to fix it on WordPress and WooCommerce
Images without width and height
Images that WordPress outputs from the media library carry width and height (since 5.5 it even fills them in where missing). The gaps are usually logos, payment icons, banners set in theme options, slider images and images in custom HTML widgets. Browsers use the two attributes to work out the aspect ratio and hold the space before the file arrives.
- WP Rocket: Add missing image dimensions (Media tab) adds the attributes to images on your own domain. It skips external images and images inside
<picture>, and it applies only to cached pages, so check while logged out. - LiteSpeed Cache: Add Missing Sizes (Media Settings) adds them to local images, but only when Lazy Load Images is on. Responsive Placeholder then holds the space while lazy images load.
Keep images responsive in your CSS with max-width: 100%; height: auto; so the attributes set the shape, not a fixed size.
Sliders, carousels and galleries
A slider that is empty in the HTML and gets its height from JavaScript pushes everything below it down when it starts. Give its container a fixed shape in CSS (aspect-ratio or a min-height per screen size), or show the first slide as a plain image until the script runs. The same applies to product galleries and related-product carousels.
Bars, banners and cookie notices
Announcement bars, free-shipping bars, cookie notices, newsletter strips and sticky add-to-cart bars often appear after a script runs. Inserted near the top of the page, they push everything down, and the closer to the top, the bigger the shift usually is. Show notices as an overlay, or put them in the HTML from the start with their space reserved:
/* Cookie notice floats over the page instead of pushing it */
.cookie-notice { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; }
/* Space for a promo bar that a script fills later */
.promo-bar { min-height: 40px; }
/* Slider keeps its shape before its script runs */
.hero-slider { aspect-ratio: 16 / 9; }Widgets, embeds and ads
Review widgets, instalment-payment messages, Instagram feeds, maps and video embeds are injected after load. Reserve their space with min-height on the wrapper, and give iframes width and height or an aspect-ratio. If a slot can stay empty, keep a placeholder rather than collapsing it.
Fonts and late CSS
When a web font replaces the fallback font, lines can change width and wrap differently. Match the fallback with size-adjust; the font display guide shows how. Stylesheets that arrive late also move things: if the jumping started after you turned on an option that loads CSS asynchronously or removes unused CSS, its critical CSS is probably missing rules for the first screen. Fix the critical CSS or exclude the stylesheet involved.
Animations
Animate transform and opacity, not top, left, height or margin. Moving an element by changing top or left counts as a layout shift; a transform does not.
Shopify and hand-built sites
Shopify: image_tag adds width and height by default, so the usual gaps are custom sections that write <img> tags by hand, and apps that inject bars, badges and widgets. To find which app causes a jump, turn its app embed off in the theme editor and re-test.
Hand-built sites: always write the dimensions, keep the CSS responsive, size embeds and animate with transforms:
<img src="/img/chair.webp" width="800" height="800" alt="Oak chair">img { max-width: 100%; height: auto; }
.video-embed iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; }
/* Move things with transform, not top/left */
.drawer { transform: translateY(100%); transition: transform .3s; }
.drawer.open { transform: translateY(0); }
Mistakes to avoid
- Hiding the page behind a loading screen. Nothing shifts while it is hidden, but LCP gets much worse.
- Fixed image heights in CSS without
height: auto. Images get squashed or stretched on phones. - Lazy-loaded images without dimensions. They start at zero height and push content down as they load.
- Collapsing an empty ad or widget slot. The collapse is a shift too.
- Trusting only the lab test. Lighthouse doesn’t scroll or click; check field CLS as well.
How to check the fix worked
Clear your caches and re-test the same page on phone and desktop settings, two or three times, since lab results vary. The insight should show no cluster above 0.1, and with Layout Shift Regions on, nothing should flash purple during loading. Check a first visit in a private window, so the cookie notice is included.
Then watch the CLS line in Search Console’s Core Web Vitals report or the Chrome UX Report. Field data covers the last 28 days of real visits, so it takes about four weeks to fully reflect the fix.
Questions people ask
What is a good CLS score?
0.1 or less is good, between 0.1 and 0.25 needs improvement, and above 0.25 is poor. Google judges it at the 75th percentile of real visits, separately for phones and desktops.
Why is CLS fine in PageSpeed Insights but poor in Search Console?
The lab test only measures loading. Search Console uses real visits, which include shifts after loading: while scrolling, when lazy content or widgets appear, or when a popup pushes content. Look for elements that appear later in the visit.
Does a cookie banner cause layout shift?
Only if it pushes the page content. A banner shown as an overlay with position: fixed doesn’t move anything; a bar inserted at the top of the page does.
Do I need width and height if my CSS already makes images responsive?
Yes. Browsers use the two attributes to calculate the aspect ratio and reserve space before the image loads. Keep height: auto in the CSS so the image still scales.
Sources
- Layout shift culprits (Chrome for Developers)
- What’s new in Lighthouse 13 (Chrome for Developers)
- Cumulative Layout Shift (CLS) (web.dev)
- Optimize Cumulative Layout Shift (web.dev)
- Debug layout shifts (web.dev)
- Discover issues with rendering performance (Chrome DevTools)
- Add missing image dimensions (WP Rocket docs)
- Page Optimization (LiteSpeed Cache for WordPress docs)
Rather have it done?
The FlashMax team fixes the issues in your report, on a copy first, and shows the before-and-after.
See the speed optimization service