Cumulative Layout Shift Guide
This cumulative layout shift guide explains what CLS is, why it matters, how to measure it, and how to fix the most common layout stability problems on your website. Cumulative Layout Shift is one of Google’s Core Web Vitals, and it measures how much visible content unexpectedly moves while a page is loading or being used.
If you have ever tried to tap a button and the page suddenly moved, causing you to click the wrong thing, you have experienced poor layout stability. CLS is not only a technical performance metric. It affects user trust, conversions, accessibility, mobile experience, and search performance.
For a broader performance overview, you may also want to review this Core Web Vitals guide, which explains how CLS works alongside LCP and INP.
What Is Cumulative Layout Shift?
Cumulative Layout Shift, often shortened to CLS, measures unexpected movement of visible page elements during the lifetime of a page. When text, images, buttons, ads, forms, navigation bars, banners, or other elements shift after the user has started viewing the page, it can create a frustrating experience.
A layout shift happens when an element changes its starting position between two rendered frames. CLS adds up layout shifts that occur unexpectedly and calculates a score based on how much content moved and how far it moved.
Common examples of CLS include:
- An image loads without a reserved space and pushes text downward.
- An ad slot appears after the content has already loaded.
- A cookie banner injects itself at the top of the page and moves everything down.
- A web font loads late and causes text to reflow.
- A video embed appears after the layout has already been painted.
- A dynamic form, popup, or notification shifts visible content.
- An ecommerce product image or review widget loads late and changes the page height.
Why CLS Matters
CLS matters because users expect pages to feel stable and predictable. A fast-loading website can still feel broken if elements jump around while someone is trying to read, tap, scroll, or complete a purchase.
CLS Affects User Experience
Unexpected layout movement makes a website feel unpolished. Visitors may lose their place while reading, tap the wrong button, abandon a form, or become frustrated before they ever convert. On mobile devices, layout shifts are especially disruptive because screen space is limited.
CLS Can Affect SEO Performance
CLS is part of Google’s Core Web Vitals, which are included in page experience signals. While Core Web Vitals are not the only ranking factor, improving CLS can support better SEO by improving usability, performance, and engagement. A stable website also tends to perform better across conversion-focused landing pages, ecommerce stores, and content-heavy websites.
CLS Can Reduce Conversions
If a checkout button, lead form, quote request, product option, or call-to-action moves unexpectedly, users may abandon the action. For online stores, layout stability is closely connected to trust. If you run WooCommerce, CLS improvements should be part of your broader WooCommerce conversion optimization work because unstable layouts can directly reduce sales.
What Is a Good CLS Score?
Google evaluates CLS using three general score ranges:
- Good: 0.1 or less
- Needs improvement: greater than 0.1 and up to 0.25
- Poor: greater than 0.25
Your goal should be to keep CLS at 0.1 or below for as many pages as possible. A score of 0 means there were no measurable unexpected layout shifts. In practice, highly dynamic websites may not always achieve 0, but most well-built pages can stay comfortably below 0.1.
How CLS Is Calculated
CLS is calculated using two main factors: impact fraction and distance fraction.
Impact Fraction
Impact fraction measures how much of the visible viewport was affected by the layout shift. If a large portion of the screen moves, the impact is greater.
Distance Fraction
Distance fraction measures how far the shifted element moved relative to the viewport. A small movement has a lower effect than a large jump across the screen.
Layout Shift Score
The layout shift score is calculated by multiplying impact fraction by distance fraction. CLS then reflects the largest burst of unexpected layout shifts during a page session window.
You do not need to manually calculate CLS for normal optimization work. Tools such as PageSpeed Insights, Lighthouse, Chrome DevTools, Search Console, and real user monitoring can identify the score and often highlight the elements causing the issue.
CLS vs Other Core Web Vitals
CLS measures visual stability, but it is only one part of page experience. The other major Core Web Vitals are Largest Contentful Paint and Interaction to Next Paint.
- Largest Contentful Paint: Measures how quickly the largest visible content element loads.
- Interaction to Next Paint: Measures how quickly the page responds to user interactions.
- Cumulative Layout Shift: Measures how visually stable the page is during loading and use.
If your site also struggles with slow loading, this guide to Largest Contentful Paint explains how to improve the loading speed of the most important visible content on a page.
How to Measure Cumulative Layout Shift
Before fixing CLS, you need to understand where layout shifts are happening. Different tools show different types of data, so it is helpful to use both lab data and field data.
1. Google PageSpeed Insights
PageSpeed Insights is one of the easiest ways to check CLS. It provides field data from the Chrome User Experience Report when available, along with lab data from Lighthouse. Field data shows how real users experience your website, while lab data simulates a page load in a controlled environment.
To use it, enter your page URL, review the Core Web Vitals section, and check whether CLS is marked as good, needs improvement, or poor. Then review diagnostics for layout shift elements.
2. Google Search Console
Google Search Console provides a Core Web Vitals report that groups similar URLs based on performance. This is useful for identifying sitewide CLS issues affecting templates such as blog posts, product pages, category pages, landing pages, or checkout pages.
3. Chrome DevTools
Chrome DevTools can show layout shifts in detail. In the Performance panel, you can record a page load and inspect layout shift events. This helps developers identify exactly which elements moved and when the movement occurred.
4. Lighthouse
Lighthouse audits can identify CLS problems in a controlled test environment. It is useful during development, staging, or optimization work, but it may not capture every real-world issue because user devices, network conditions, cookie states, ad behavior, and dynamic scripts can vary.
5. Real User Monitoring
Real user monitoring tools collect performance data from actual visitors. This is especially useful for websites with dynamic content, ads, personalization, third-party scripts, or logged-in user experiences. Field data is often more reliable than lab data when diagnosing layout stability at scale.
Common Causes of Poor CLS
Most CLS problems come from content being inserted, resized, or restyled after the page has started rendering. Below are the most common causes.
Images Without Width and Height
Images are one of the most common causes of layout shift. If the browser does not know the image dimensions before it loads, it cannot reserve the correct amount of space. When the image finally appears, it pushes surrounding content up or down.
Every important image should have width and height attributes or an aspect ratio defined in CSS. This allows the browser to reserve space before the image finishes loading.
Ads, Embeds, and Iframes Without Reserved Space
Ad slots, YouTube videos, maps, social media embeds, booking widgets, review widgets, and iframes can cause major layout shifts if they load after the rest of the content. The solution is to reserve a fixed space or minimum height for these elements before they load.
Late-Loading Web Fonts
Custom fonts can cause text to shift when the browser swaps from a fallback font to the final web font. This is called font reflow. If the fallback font and custom font have different spacing, line height, or letter width, the page can visibly move.
Dynamically Injected Content
Cookie banners, announcement bars, popups, newsletter forms, live chat widgets, personalization blocks, and promotional banners can all create CLS if they are inserted above existing content. This is especially common when scripts add content after the initial page load.
Lazy Loading Above-the-Fold Content
Lazy loading is useful for below-the-fold images, but it can create problems if applied to above-the-fold images, hero sections, logos, or critical content. If important visual elements load late, surrounding content may shift.
Responsive Design Issues
A layout may be stable on desktop but unstable on mobile. Mobile menus, sticky headers, responsive images, sliders, product galleries, and changing breakpoints can all create CLS if not tested carefully across screen sizes.
Third-Party Scripts
Third-party scripts are a major source of layout instability. Chat widgets, ad networks, analytics tags, marketing tools, review platforms, A/B testing tools, and embedded forms may inject elements after the page loads. These tools should be audited regularly to ensure they do not damage performance.
How to Fix Cumulative Layout Shift
The best way to fix CLS is to reserve space for content before it loads, avoid injecting content above existing elements, and make sure visual assets have predictable dimensions.
1. Add Width and Height Attributes to Images
Always define image dimensions in HTML or CSS. Modern browsers use width and height attributes to calculate aspect ratio and reserve the correct space before the image loads.
For example, an image should include dimensions like this:
<img src="example.jpg" width="1200" height="800" alt="Example image">
This does not mean the image cannot be responsive. CSS can still scale it fluidly, but the browser will understand the aspect ratio and prevent layout jumps.
2. Use CSS Aspect Ratio
The CSS aspect-ratio property helps reserve space for responsive images, videos, cards, and embeds.
For example:
.video-wrapper { aspect-ratio: 16 / 9; width: 100%; }
This is useful for YouTube embeds, product image areas, hero media, and responsive content blocks.
3. Reserve Space for Ads and Embeds
If your site displays ads or external embeds, reserve a container with a fixed or minimum height. This prevents the page from jumping when the ad or embed loads.
For example, instead of allowing an ad container to start at zero height, define a minimum height:
.ad-slot { min-height: 250px; }
The correct height depends on your ad format and responsive layout. The goal is to make sure the browser knows how much space to hold before the ad appears.
4. Avoid Inserting Content Above Existing Content
Do not inject banners, forms, notices, or widgets above content after the page has already loaded. If an announcement bar or cookie notice is necessary, reserve the space from the beginning or display it as an overlay that does not push content.
For example, a cookie banner fixed to the bottom of the viewport usually creates less layout shift than one inserted at the top of the page after load.
5. Optimize Font Loading
Fonts can cause subtle but noticeable layout shifts. To reduce font-related CLS:
- Use font-display strategically, usually
swaporoptional. - Preload critical fonts used above the fold.
- Choose fallback fonts with similar dimensions to the final font.
- Limit the number of font families and weights.
- Host fonts locally when appropriate for better control.
If a custom font causes major reflow, consider using a better-matched system fallback or adjusting font metrics with CSS where supported.
6. Do Not Lazy Load Critical Above-the-Fold Images
Hero images, logos, banners, and other above-the-fold visual elements should usually load immediately rather than being lazy loaded. Lazy loading is best for images lower on the page.
Image handling affects both speed and stability. This image optimization guide explains how to use image sizing, compression, formats, and loading behavior to improve website performance.
7. Set Dimensions for Videos and Iframes
Videos, maps, social posts, calendars, booking tools, and other iframe content should sit inside containers with predictable dimensions. Use aspect ratio wrappers or defined min-heights so the layout does not change once the iframe loads.
8. Be Careful With Sliders and Carousels
Sliders often cause CLS because images inside slides may have different heights, load at different times, or initialize after the page renders. If you use sliders:
- Set a fixed or predictable height for the carousel area.
- Use consistent image aspect ratios.
- Preload the first visible slide if it appears above the fold.
- Avoid heavy slider plugins that inject layout late.
- Test the slider on mobile and desktop.
9. Audit Third-Party Scripts
Third-party tools can silently create layout shifts. Review all external scripts on your site and ask whether each one is necessary. Pay special attention to:
- Live chat widgets
- Review widgets
- Advertising scripts
- Tracking pixels
- A/B testing tools
- Social media embeds
- Lead generation popups
- Personalization scripts
Remove unnecessary scripts, delay non-critical scripts, or configure widgets so they do not inject content into the main layout unexpectedly.
10. Stabilize Headers, Navigation, and Sticky Elements
Sticky headers and mobile navigation bars can cause CLS when their size changes after loading. For example, a logo may load late and increase the header height, pushing content downward.
To prevent this, define header heights, reserve logo space, avoid late-loading navigation fonts, and test sticky behavior across devices.
CLS for WordPress Websites
WordPress websites often experience CLS because of themes, page builders, plugins, image handling, ads, cookie notices, and third-party scripts. The flexibility of WordPress is powerful, but every plugin or visual component can affect layout stability.
If your site is built on WordPress, CLS optimization should be part of a wider speed and performance process. This WordPress speed optimization guide covers broader improvements that can support Core Web Vitals, including caching, scripts, images, hosting, and front-end performance.
Common WordPress CLS Issues
- Images inserted without dimensions
- Page builder sections that load styles late
- Sliders and galleries with inconsistent heights
- Cookie banners that push the page down
- Ad plugins that do not reserve space
- Web fonts loaded by themes or plugins
- WooCommerce product images with inconsistent sizes
- Dynamic review, chat, or popup plugins
How to Improve CLS in WordPress
- Use a lightweight, well-coded theme.
- Make sure images have width and height attributes.
- Use consistent image aspect ratios across templates.
- Reserve space for videos, ads, and embeds.
- Minimize unnecessary plugins.
- Disable features that inject content late.
- Optimize font loading.
- Test mobile templates separately from desktop.
- Review layout shifts after plugin or theme updates.
- Use staging before making major design changes.
CLS for Ecommerce Websites
Ecommerce websites need strong layout stability because users are making decisions, comparing products, selecting options, and entering payment details. Unexpected movement can create uncertainty and reduce trust.
High-Risk Ecommerce Elements
- Product image galleries
- Variant selectors
- Review widgets
- Related product sections
- Shipping calculators
- Promotion banners
- Cart notices
- Payment buttons
- Trust badges
- Checkout fields
Best Practices for Ecommerce CLS
- Use consistent product image dimensions.
- Reserve space for review widgets and ratings.
- Avoid pushing product details down after page load.
- Keep add-to-cart areas stable.
- Make cart and checkout notices predictable.
- Test payment buttons and express checkout options for layout movement.
- Use stable product gallery containers.
For ecommerce sites, even small layout shifts near product options or checkout buttons can affect revenue. CLS should be tested on product pages, category pages, cart pages, and checkout pages.
CLS Checklist
Use this checklist when auditing a page for Cumulative Layout Shift issues:
- Do all images have width and height attributes?
- Are responsive images using consistent aspect ratios?
- Is the hero image excluded from lazy loading if it appears above the fold?
- Do videos, maps, and iframes have reserved space?
- Do ad slots have fixed or minimum heights?
- Are cookie banners and announcement bars prevented from pushing content after load?
- Are web fonts optimized to reduce reflow?
- Are sliders and carousels using stable dimensions?
- Are third-party widgets audited for layout movement?
- Is the mobile layout tested separately from desktop?
- Are sticky headers and navigation bars stable?
- Are product images and galleries consistent?
- Are popups and live chat widgets configured safely?
- Do page builder sections avoid late style changes?
- Does Search Console show affected URL groups?
How to Prioritize CLS Fixes
Not every layout shift has the same business impact. Prioritize fixes based on visibility, traffic, conversions, and template reuse.
Start With High-Traffic Pages
Fix pages that receive the most organic, paid, or referral traffic first. These pages affect the largest number of users and often have the greatest SEO impact.
Focus on Conversion Pages
Landing pages, product pages, contact pages, checkout pages, pricing pages, and lead generation forms should be stable. Any movement near calls-to-action can hurt performance.
Fix Template-Level Issues
If a blog post template, product template, or category page template has a CLS issue, fixing it once can improve many URLs. Template-level improvements usually produce the best return on effort.
Compare Mobile and Desktop Separately
Mobile CLS issues are often different from desktop issues. A page may pass on desktop but fail on mobile because of responsive images, sticky headers, mobile menus, banners, or viewport-specific ad units.
Common CLS Mistakes to Avoid
Relying Only on Lab Scores
Lighthouse is useful, but real users may experience different layout shifts because of cookies, ads, login states, device sizes, network conditions, and third-party scripts. Always compare lab data with field data when possible.
Lazy Loading Everything
Lazy loading is not always beneficial. Lazy loading above-the-fold images can delay important content and create layout shifts. Use lazy loading selectively.
Ignoring Fonts
Font shifts are easy to overlook because they may feel less dramatic than missing image dimensions, but they can still affect CLS. Test pages with throttled connections to see whether text reflows.
Adding Marketing Widgets Without Testing
Popups, banners, chat tools, review widgets, and personalization tools can create unexpected shifts. Any new marketing script should be tested for performance and layout stability before being deployed widely.
Using Inconsistent Image Sizes
Inconsistent image dimensions are especially problematic for product grids, blog cards, testimonials, and galleries. Standardized aspect ratios help maintain a stable layout.
How Developers Can Debug CLS
Developers should use Chrome DevTools to inspect layout shift events and identify the affected elements. A practical debugging process looks like this:
- Open the page in Chrome.
- Open DevTools and go to the Performance panel.
- Start recording and reload the page.
- Stop recording after the page finishes loading.
- Look for layout shift events in the timeline.
- Inspect the affected elements.
- Identify whether the shift was caused by images, fonts, scripts, ads, CSS, or injected content.
- Apply a fix such as reserved dimensions, aspect ratio, font optimization, or script adjustment.
- Retest in mobile and desktop viewports.
During debugging, remember that the element shown as shifted is not always the root cause. For example, a paragraph may be marked as shifted because an image above it loaded without reserved space. Always inspect what caused the movement, not just what moved.
CLS and Website Redesigns
Website redesigns are a common time for CLS problems to appear. New layouts, animations, fonts, page builders, hero sections, embeds, and third-party scripts can introduce instability if performance is not considered during planning.
If you are rebuilding your site, include CLS testing in your launch process. This website redesign guide can help you plan design, SEO, performance, and technical checks before going live.
Best Practices for Preventing CLS Long Term
CLS is not a one-time fix. Websites change over time as teams add plugins, publish content, install scripts, change ads, update themes, add banners, or redesign sections. The best approach is to build layout stability into your ongoing website process.
- Create design components with fixed or predictable dimensions.
- Use image guidelines for editors and content teams.
- Test new plugins and scripts before production deployment.
- Monitor Core Web Vitals in Google Search Console.
- Include CLS checks in redesigns and landing page launches.
- Review high-traffic templates regularly.
- Document ad slot and embed size requirements.
- Use staging environments for layout changes.
- Audit third-party scripts quarterly.
Frequently Asked Questions About Cumulative Layout Shift
What causes Cumulative Layout Shift?
Cumulative Layout Shift is usually caused by images without dimensions, ads without reserved space, embeds that load late, web fonts that reflow text, dynamically inserted banners, third-party scripts, sliders, and responsive layout issues.
What is a good CLS score?
A good CLS score is 0.1 or less. Scores between 0.1 and 0.25 need improvement, while anything above 0.25 is considered poor.
Does CLS affect SEO?
CLS is part of Google’s Core Web Vitals, which are included in page experience signals. It is not the only ranking factor, but improving CLS can support SEO by improving user experience, engagement, and technical quality.
How do I reduce CLS quickly?
The fastest ways to reduce CLS are to add width and height attributes to images, reserve space for ads and embeds, avoid injecting content above existing content, optimize font loading, and remove or adjust third-party scripts that shift the layout.
Can CLS be different on mobile and desktop?
Yes. CLS often differs between mobile and desktop because layouts, image sizes, menus, ads, banners, and viewport dimensions change across devices. Always test both versions.
Do animations count as layout shifts?
Animations can contribute to poor visual stability if they change layout properties such as height, width, margin, padding, or position in a way that moves surrounding content unexpectedly. Use transform and opacity animations where possible because they are less likely to trigger layout shifts.
Final Thoughts
Cumulative Layout Shift is one of the most important indicators of how stable and trustworthy your website feels. A page can load quickly but still deliver a poor experience if content jumps around while visitors are reading, tapping, shopping, or filling out forms.
The key to improving CLS is simple: reserve space before content loads, avoid unexpected content injection, optimize fonts, control third-party scripts, and test real pages across devices. By following this cumulative layout shift guide, you can create a smoother user experience, support Core Web Vitals performance, and improve the quality of your website for both visitors and search engines.