Cumulative Layout Shift, or CLS, measures unexpected movement on the page. A WordPress page can look fast and still be frustrating if a headline moves, an image pushes text down, an ad opens a new gap, or a late font changes the width of a line while the visitor is reading.
The fix is usually to reserve space before late content arrives and to stop injecting visible elements above existing content. Start by identifying what moved, when it moved, and whether the shift happened during page load or later as the visitor scrolled or interacted.
Use field data and a visual recording
PageSpeed Insights can show real-user CLS from CrUX when the site has enough data. Lighthouse can catch load-time shifts, but field data can include shifts that happen later in the life of the page.
Use browser developer tools to highlight layout shifts while you load and use the page. Scroll. Open menus. Wait for ads. Accept or reject the cookie notice. Expand accordions. Some problems appear only after an interaction.
If you need a full testing routine first, use the WordPress speed test guide.
Give images width and height
Images should have known dimensions or a reserved aspect ratio before the file loads. Without that space, the browser lays out the text first and then moves it when the image arrives.
Modern WordPress normally adds width and height attributes to image markup it controls. Problems can still appear with custom HTML, page builders, CSS background tricks, old content, external images, or plugins that rewrite markup.
Inspect the final page source, not only the editor. If an image has no reserved space, fix the output at the theme or plugin level when possible.
Reserve space for ads
Ads are a common source of layout shift because the final creative size may not be known immediately. If an ad slot starts at zero height and later becomes 250 pixels tall, everything below it moves.
Reserve a sensible minimum height for the slot. If several ad sizes are possible, reserve space for the common or largest expected size when the design can support it. Avoid collapsing the slot after an ad fails if that collapse itself causes a large shift while the visitor is reading.
Make cookie and announcement bars predictable
A banner inserted above the header after the page begins to render can push the entire page down. If the notice must occupy space, reserve that space early or use a layout that does not move existing content.
Overlays can avoid reflow, but they can cover important content and create accessibility problems. Choose the pattern that fits the site and test it on small screens.
Control font shifts
A fallback font and a web font can have different letter widths and line heights. When the custom font arrives, a heading may wrap differently and move the content below it.
Use fewer font files, choose a sensible font-display strategy, and consider a fallback font with similar metrics. Preloading the exact critical font can help when used carefully, but preloading every font can compete with more important resources.
Our WordPress font guide covers the performance side in more detail.
Do not insert content above what the visitor is reading
Related-post boxes, newsletter bars, sale notices, recommendations, and personalization modules can cause CLS when they appear late above existing content.
If the content is not triggered by a direct user action, reserve its space or place it where it does not move the current reading position. A box that fades into a reserved area is much safer than one that pushes five paragraphs down after two seconds.
Reserve stable space for embeds
YouTube videos, maps, social posts, review widgets, and other embeds can arrive after the surrounding text. Give the embed container an aspect ratio or fixed minimum height that matches the expected content.
Lazy loading an iframe is fine below the fold, but lazy loading does not remove the need to reserve space. A visitor can scroll faster than the embed loads.
Watch sliders and rotating content
A hero slider can change height when the next slide has different content or image dimensions. A testimonial rotator can do the same when one quote uses more lines than another.
Set a stable container height or design slides around a common aspect ratio. On small screens, test the longest content, not only the first slide.
Animations should use transform when possible
Animations that change top, left, width, height, or other layout properties can cause layout work and movement. For visual motion, transform and opacity are often safer because they do not require the same layout changes.
That does not mean every animation using transform is good for users. Keep motion useful, respect reduced-motion preferences, and remove effects that do not help the task.
Check sticky headers carefully
A sticky header that changes height after scrolling can move content. The same can happen when the WordPress admin bar, a mobile menu, or a promotional strip changes the top offset.
Keep the header height stable or make the transition overlay the page instead of changing the document flow. Test logged-in and logged-out states because the admin bar changes the top of the page.
Do not confuse expected movement with CLS
Movement directly caused by a user’s action is treated differently from unexpected layout movement. Opening an accordion after a click is normally expected. A newsletter box appearing on its own and pushing the article down is not.
The goal is not to freeze the page. The goal is to make movement predictable and connected to what the visitor chose to do.
Check the whole life of the page
Lab CLS may look good while field CLS is poor because real users scroll, wait for ads, trigger widgets, and stay on the page longer. Web.dev notes that field data can include post-load shifts that a normal lab run never sees.
Use this difference as a clue. If lab CLS is near zero but field CLS is bad, investigate ads, lazy-loaded sections, injected content, long-lived widgets, and interaction states.
A WordPress CLS checklist
- Find the actual shifting element.
- Add dimensions or aspect ratios to images and embeds.
- Reserve space for ads and late widgets.
- Keep cookie and announcement UI from pushing finished content.
- Reduce font swaps and metric differences.
- Stabilize sliders, sticky headers, and rotating content.
- Test scrolling and interaction, not only first load.
- Compare lab and field CLS.
If the problem is a late hero image rather than movement, use the LCP guide. For offscreen images, use the lazy-loading guide without removing their reserved space.
Check images inserted by CSS
CSS background images do not have normal HTML width and height attributes. If the container has no stable height or aspect ratio, the design can still shift as styles, fonts, or responsive rules settle. Give the container a predictable size before the background appears.
For important content images, normal <img> markup is often easier to make responsive and stable because the browser has built-in dimensions, loading behavior, and responsive image support.
Watch for WordPress toolbar and editor differences
Logged-in administrators may see the WordPress admin bar, edit links, preview controls, and plugin overlays that normal visitors never see. These can create shifts that are absent for public traffic, or hide a public problem during your own testing. Test logged out in a clean browser profile as well as logged in.
Keep responsive breakpoints stable
A layout can shift when JavaScript decides whether the page is mobile or desktop after rendering. Prefer CSS media queries for layout changes that the browser can apply before paint. If JavaScript must change the layout, reserve the final space and avoid swapping large blocks after the page becomes visible.
When you fix CLS, test with ads, consent tools, embeds, and personalization in the same state real visitors see. A clean staging page without those services can hide the shift. Production-safe testing should include the full layout while avoiding changes that affect customers.
Retest after consent and ad changes
CLS can return when a consent platform, ad provider, or theme update changes the size or timing of injected elements. Keep a few representative mobile pages in your regression checks so a later plugin update does not quietly undo the spacing fixes.
Sources and further reading
- CLS optimization guide
- Lab and field differences
- Browser lazy-loading guide
- Critical preload guide
- Responsive image guide
- PageSpeed Insights guide