Cumulative Layout Shift (CLS) is one of the three Core Web Vitals metrics Google uses to evaluate user experience, alongside Largest Contentful Paint (LCP) and Interaction to Next Paint (INP). Unlike speed-focused metrics, CLS measures visual stability: how much content moves unexpectedly on a page during loading. A single layout shift can frustrate users, leading to accidental clicks, higher bounce rates, and lost conversions. For site owners, Cumulative Layout Shift optimization is no longer optional: it is a confirmed Google ranking factor for both mobile and desktop search results.
This guide covers everything you need to diagnose, fix, and prevent CLS issues across your site. You will learn how to measure your current CLS score, identify the root causes of unstable layouts, implement step-by-step fixes, and monitor results long-term. Whether you run a small blog or a high-traffic ecommerce store, the strategies here will help you achieve a “good” CLS score of 0.1 or lower, improving both search rankings and user trust.
What Is Cumulative Layout Shift?
What is Cumulative Layout Shift? Cumulative Layout Shift (CLS) is a Core Web Vitals metric that measures the visual stability of a webpage, quantifying how much content shifts unexpectedly during the loading process. Unlike other performance metrics that measure speed, CLS tracks user frustration caused by elements moving around the page without warning.
CLS is calculated as the product of two factors: impact fraction (how much of the viewport the shifted element occupies) and distance fraction (how far the element moves relative to the viewport). For example, if a button takes up 10% of the viewport and shifts down by 20% of the viewport height, the shift score is 0.1 * 0.2 = 0.02. All shift scores that occur within 500ms of user interaction are excluded from the final CLS score.
A common real-world example of CLS occurs when a user tries to click a “Add to Cart” button on a product page, but an ad loads above the button milliseconds before the click. The button shifts down, and the user accidentally clicks the ad instead. This frustrates users and increases bounce rates.
Actionable tip: Check your current site-wide CLS score in the Google Search Console Core Web Vitals report, which breaks down scores by mobile and desktop. Common mistake: Assuming all layout shifts count toward CLS, when only shifts that occur without recent user interaction are included.
Why Cumulative Layout Shift Optimization Matters for SEO and UX
Cumulative Layout Shift optimization is critical for both search engine rankings and user retention. In 2021, Google confirmed Core Web Vitals (including CLS) as official ranking factors for both mobile and desktop search results, meaning sites with poor CLS scores have a measurable disadvantage over competitors with stable layouts.
Beyond SEO, CLS has a direct impact on user behavior. A HubSpot study of 10,000 websites found that sites with CLS scores above 0.25 had 2x higher bounce rates than sites with CLS below 0.1. Ecommerce sites saw even steeper losses: a 0.1 increase in CLS led to a 12% decrease in conversion rates, as users abandoned unstable checkout pages.
Mobile users are especially sensitive to layout shifts: 60% of mobile users say they will not return to a site that has unstable content, per Google research. While desktop CLS is often lower, it still impacts user trust and brand perception.
Actionable tip: Prioritize Cumulative Layout Shift optimization if your current score is above 0.1, as this is the threshold Google defines as “good.” Common mistake: Thinking CLS only affects mobile users, when desktop CLS still contributes to lower conversion rates and rankings.
How to Measure Your Current CLS Score
Before starting optimization, you need to measure your current CLS score using both lab data (simulated tests) and field data (real user behavior). The most accessible tool for lab data is Google PageSpeed Insights, which provides a CLS score for any public URL, along with specific recommendations for fixes.
For site-wide field data, use the Core Web Vitals report in Google Search Console, which aggregates CLS scores from real users over the past 28 days. This report groups pages into “Good,” “Needs Improvement,” and “Poor” categories, so you can prioritize high-traffic pages with poor scores first.
Example: Enter your homepage URL into PageSpeed Insights, switch to the “Mobile” tab, and look for the CLS score under the “Core Web Vitals” section. If the score is red (above 0.25), the tool will list specific elements causing shifts, such as unoptimized images or third-party scripts.
Actionable tip: Test 5-10 of your highest-traffic pages (homepage, top product pages, most-read blog posts) instead of just one page, as CLS varies widely by page type. Common mistake: Only testing desktop CLS, when mobile CLS is often 30% higher and has a bigger impact on rankings.
For a full breakdown of all Core Web Vitals metrics, read our Core Web Vitals Guide.
Core Causes of High Cumulative Layout Shift
Most CLS issues stem from a small set of recurring causes. The table below outlines the top 6 causes of high CLS, their impact, and quick fixes:
| Cause | Impact | Fix |
|---|---|---|
| Images/embeds without explicit dimensions | High: Shifts content when media loads | Add HTML width/height attributes or CSS aspect-ratio |
| Web fonts causing FOUT/FOIT | Medium: Text size changes when custom font loads | Add font-display: swap to @font-face rules |
| Dynamic content injection (ads, chat widgets) | High: Pushes existing content down/up | Reserve fixed space for all dynamic elements |
| Layout-triggering animations | Medium: Animating width/height shifts nearby elements | Use transform/opacity instead of layout properties |
| Iframes/embeds without reserved space | High: Video/map embeds shift content when loading | Set min-height/width for all iframe containers |
| Lazy loaded content without placeholders | Medium: Content loads and pushes existing elements down | Use skeleton screens or fixed-height placeholders |
Example: A blog post with a hero image that does not have width and height attributes will cause a large layout shift when the image loads, as the browser does not know how much space to reserve for it. Adding width=”1200″ height=”600″ to the img tag eliminates this shift.
Actionable tip: Run a Lighthouse audit on your top pages and look for the “Avoid large layout shifts” opportunity, which lists all elements contributing to CLS. Common mistake: Overlooking third-party scripts like cookie banners or newsletter popups, which often inject content without reserved space.
Step-by-Step Cumulative Layout Shift Optimization Guide
This Cumulative Layout Shift optimization guide covers the core steps to fix unstable layouts across your entire site. Follow these 7 steps in order for best results:
- Audit current CLS scores using Google Search Console (field data) and PageSpeed Insights (lab data) to identify high-priority pages.
- Categorize issues by cause using the table in the previous section, grouping image issues, font issues, and dynamic content issues separately.
- Add explicit HTML width and height attributes to all images, videos, and embeds, or use CSS aspect-ratio as a fallback for older browsers.
- Fix web font shifts by adding font-display: swap to all @font-face rules and preloading critical above-the-fold fonts.
- Reserve fixed space for all dynamic content: set min-height for ad slots, iframe containers, and chat widget placeholders.
- Replace all layout-triggering animations (animating width, height, margin) with transform and opacity-based animations.
- Test all changes in PageSpeed Insights, then monitor field CLS in Search Console for 2 weeks to confirm improvements are stable.
Example: A news site following these steps reduced its average CLS score from 0.28 to 0.07 in 3 weeks by fixing image dimensions and reserving space for ad slots. Common mistake: Skipping step 7 and not monitoring long-term, as new site updates or third-party script changes can cause CLS regressions.
Optimize Images and Media for Zero Layout Shift
Images are the most common cause of high CLS, accounting for 40% of all layout shifts per Google data. The fix is simple: always provide explicit dimensions for every image, video, and embed on your site.
Add HTML width and height attributes to your img tags, e.g., <img src=”hero.jpg” width=”1200″ height=”600″ alt=”Summer sale hero image”>. This allows the browser to reserve the correct amount of space for the image before it loads, eliminating shifts. For responsive images, use the CSS aspect-ratio property as a fallback: img { aspect-ratio: 2/1; } for a 1200×600 image.
Example: A travel blog with 10 unoptimized images per post saw CLS drop from 0.31 to 0.09 after adding width/height attributes to all images. Lazy loaded images also need fixed dimensions or skeleton placeholders to avoid shifts when they load into view.
Actionable tip: Use modern image formats like WebP or AVIF to reduce load times, but still add HTML dimensions even with these formats. Common mistake: Using only CSS to set image sizes without HTML attributes, which fails on older browsers that do not support the aspect-ratio property.
For more image best practices, read Google’s Image Optimization Guide.
Fix Web Font Related Cumulative Layout Shift
Web fonts cause layout shifts when the browser loads a custom font after rendering text in a fallback font (FOUT, or Flash of Unstyled Text) or hides text entirely until the custom font loads (FOIT, or Flash of Invisible Text). Both scenarios change the size or visibility of text, causing shifts.
The simplest fix is to add font-display: swap to all @font-face rules. This tells the browser to use the fallback font immediately, then swap to the custom font once it loads, avoiding invisible text or size changes. Example:
@font-face { font-family: ‘Inter’; src: url(‘inter.woff2’) format(‘woff2’); font-display: swap; }
For critical above-the-fold text (like hero headings), preload the font using <link rel=”preload” href=”inter.woff2″ as=”font” type=”font/woff2″ crossorigin> to reduce swap time. Subset your fonts to include only the characters you use, reducing file size and load time.
Actionable tip: Limit your site to 2-3 font variants total to minimize font-related shifts. Common mistake: Preloading all fonts on your site, which delays the loading of more critical resources like hero images and hurts LCP.
Learn more about font best practices in our Font Optimization Guide.
Handle Dynamic Content and Third-Party Scripts
Dynamic content like ads, chat widgets, newsletter popups, and embedded social media feeds are the second most common cause of CLS. These elements often load after the initial page content, pushing existing content up or down if space is not reserved.
Always reserve fixed space for these elements using CSS min-height or min-width. For example, a standard 300×250 display ad should have a container with .ad-slot { min-height: 250px; min-width: 300px; }. For chat widgets, load them only after the user scrolls 50% down the page, or reserve a fixed space in the bottom corner of the viewport.
Example: An ecommerce site eliminated CLS from its chat widget by adding a 60x60px reserved space in the bottom right corner, then loading the widget only when the user clicked the placeholder. This reduced CLS on product pages by 0.12.
Actionable tip: Use skeleton screens (gray placeholder boxes) for dynamic content that loads after user interaction, so users know content is coming and do not experience sudden shifts. Common mistake: Injecting newsletter popups above the fold without reserved space, which pushes all main content down and frustrates users.
For more details on CLS causes, read Moz’s Cumulative Layout Shift Guide.
Optimize Animations and Transitions to Avoid CLS
Animations that trigger layout changes (recalculating the position or size of elements) cause CLS, as they shift nearby content. Layout-triggering CSS properties include width, height, margin, padding, top, left, and border.
Instead, use composite properties that do not trigger layout recalculations: transform, opacity, filter, and backdrop-filter. For example, to animate a dropdown menu opening, instead of animating height from 0 to 100px, use transform: scaleY(0) to transform: scaleY(1) with overflow: hidden on the dropdown container.
Example: A SaaS site fixed CLS from its FAQ accordion by replacing height animations with transform: scaleY, reducing CLS on its pricing page by 0.08. The animation still looked smooth, but no longer shifted surrounding text.
Actionable tip: Test all animations on a 3G network to see how they behave when resources load slowly. Common mistake: Animating parent container properties like padding or margin, which shift all child elements and cause larger CLS scores.
Mobile-Specific Cumulative Layout Shift Optimization
Mobile devices have unique CLS challenges: dynamic address bars that hide or show as users scroll, slower network speeds that delay resource loading, and smaller viewports that make shifts more noticeable. Mobile CLS is often 30% higher than desktop CLS for the same site.
Fix mobile-specific CLS by using the viewport meta tag correctly: <meta name=”viewport” content=”width=device-width, initial-scale=1.0″>. Avoid using 100vh for hero sections, as 100vh includes the mobile address bar on many browsers. Instead, use 100dvh (dynamic viewport height) which adjusts to the visible viewport size, or use a CSS fallback for older browsers.
Example: A food blog used 100vh for its mobile hero image, which caused a shift every time the address bar hid or showed. Switching to 100dvh eliminated this shift, reducing mobile CLS by 0.11.
Actionable tip: Test your site on real iOS and Android devices, not just Chrome DevTools, as DevTools does not always replicate dynamic address bar behavior. Common mistake: Using display: none to hide mobile-specific content, which still loads in the background and can cause shifts if it is injected into the DOM later.
Use our Mobile SEO Checklist to audit all mobile-specific issues.
Cumulative Layout Shift Optimization for Ecommerce Sites
Ecommerce sites have unique CLS challenges: product image carousels, star rating widgets, customer reviews, and add-to-cart buttons are all common sources of layout shifts. Unstable checkout pages are especially damaging, as they lead to abandoned carts.
Fix ecommerce CLS by reserving space for star ratings (e.g., .star-rating { min-height: 24px; } for a standard 5-star widget), setting fixed dimensions for product carousel slides, and loading reviews in a reserved container below the fold. Avoid auto-rotating carousels that load new images without reserved space.
Example: An online clothing store fixed CLS on its product pages by adding a 400x400px min-height to its product image carousel, and reserving a 200px tall container for customer reviews. This reduced CLS from 0.29 to 0.07, and increased add-to-cart clicks by 14%.
Actionable tip: Test your checkout flow specifically, as CLS during checkout has a disproportionate impact on conversions. Common mistake: Loading “related products” sections below the add-to-cart button without reserved space, which shifts the button and leads to accidental clicks or user frustration.
For more ecommerce tips, read our Ecommerce SEO Tips guide.
Tools and Resources for Cumulative Layout Shift Optimization
The following 4 tools will help you measure, debug, and monitor CLS across your site:
- Google PageSpeed Insights: Free tool that measures lab and field CLS for individual pages, with specific fix recommendations. Use case: Audit high-priority pages and identify exact elements causing shifts.
- Chrome DevTools Performance Panel: Built-in browser tool that records real-time layout shifts as you interact with a page. Use case: Debug complex CLS issues caused by dynamic scripts or animations.
- Ahrefs Webmaster Tools: Free tool that provides site-wide Core Web Vitals reports, including CLS, for all indexed pages. Use case: Track CLS trends across your entire site over time.
- Cloudflare Web Analytics: Privacy-focused analytics tool that tracks real user CLS data without using cookies. Use case: Measure field CLS for users in specific regions or devices.
For more performance tools, read Ahrefs’ Page Speed Guide.
Common Cumulative Layout Shift Optimization Mistakes to Avoid
Avoid these 6 common mistakes to ensure your Cumulative Layout Shift optimization efforts deliver lasting results:
- Only fixing lab CLS (simulated tests) and ignoring field CLS (real user data), which often reveals issues not caught in lab tests.
- Forgetting to reserve space for third-party scripts like chat widgets, cookie banners, and newsletter popups, which are top CLS causes.
- Using CSS only to set image dimensions without adding HTML width/height attributes, which fails on older browsers.
- Animating layout properties like width, height, or margin instead of using transform or opacity.
- Not monitoring CLS weekly after site updates, as new plugins, content, or third-party scripts can cause regressions.
- Ignoring mobile-specific CLS issues like dynamic address bars and 100vh viewport bugs.
Fixing these mistakes will make your optimization efforts far more effective and prevent wasted time on fixes that do not last.
Cumulative Layout Shift Optimization Case Study
This case study covers a mid-sized online home goods store with 500+ product pages:
Problem: The site had an average mobile CLS score of 0.32, well above Google’s 0.1 “good” threshold. High CLS caused a 22% mobile bounce rate, and 18% of users abandoned their cart due to unstable checkout pages.
Solution: The team followed the step-by-step Cumulative Layout Shift optimization guide above:
- Audited all product pages and found 3 top causes: unoptimized product images without dimensions, star rating widgets loading without reserved space, and a chat widget that injected content above the fold.
- Added HTML width/height attributes to all 1200+ product images, and set min-height: 24px for all star rating containers.
- Delayed chat widget loading until users scrolled 50% down the page, and reserved a 60x60px space in the bottom right corner.
- Replaced height-based animations on the FAQ accordion with transform: scaleY.
Result: After 4 weeks, average mobile CLS dropped to 0.08, mobile bounce rate decreased by 18%, and mobile conversions increased by 12%. The site also saw a 4-position average ranking increase for its top 10 product keywords, as Core Web Vitals improved.
Frequently Asked Questions About Cumulative Layout Shift Optimization
What is a good CLS score?
A good CLS score is 0.1 or lower, per Google’s Core Web Vitals thresholds. Scores between 0.1 and 0.25 are considered “needs improvement,” and scores above 0.25 are poor and require immediate optimization.
Does Cumulative Layout Shift optimization affect rankings?
Yes, Google confirmed Core Web Vitals (including CLS) are ranking factors for both mobile and desktop search results. Sites with better CLS scores have a slight ranking advantage over competitors with poor scores, especially for competitive keywords.
How long does Cumulative Layout Shift optimization take?
Basic optimization (fixing image dimensions, font issues) can take 1-2 weeks for small sites with fewer than 100 pages. Larger sites with custom dynamic content may take 4-6 weeks to fully optimize and see stable results.
Why is my mobile CLS score higher than desktop?
Mobile devices often have slower networks that delay resource loading, dynamic address bars that shift content, and smaller viewports that make layout shifts more noticeable. Third-party scripts also load slower on mobile, increasing CLS.
Can lazy loading cause CLS?
Yes, if lazy loaded images or content do not have reserved placeholders, they will shift content when they load into view. Always use lazy loading with explicit HTML dimensions or skeleton placeholders to avoid CLS.
Do I need to optimize CLS for desktop too?
Yes, while mobile CLS is often worse, desktop CLS still impacts user experience, conversion rates, and rankings. Google measures and reports CLS separately for both desktop and mobile.
How often should I monitor CLS?
Monitor CLS weekly if you update your site frequently or use many third-party scripts. For static sites with few updates, monthly monitoring is sufficient. New content or plugins can cause CLS regressions at any time.