Skip to main content
All website issues
Speed

Page layout shifts around while loading

What this means for your business

Buttons, text, and images shift around while your page is loading. This frustrates visitors and often causes accidental clicks — like tapping the wrong button on a phone. It can also cause visitors to accidentally submit forms or click links they didn't intend to.

How to fix it
Easy
30–60 minutes

  1. 1Always set explicit width and height attributes on every <img> tag so the browser reserves space before the image loads. Example: <img src="photo.jpg" width="800" height="600">
  2. 2Set explicit dimensions on video elements and iframes too (including embedded maps and social media embeds).
  3. 3Avoid inserting content above existing content after page load — especially ad banners, cookie notices, and chat widgets that appear at the top of the page.
  4. 4If you use custom fonts, add font-display: swap to your @font-face declarations so text is visible immediately in a fallback font.
  5. 5Reserve space for ads and dynamic content with min-height CSS on their containers so they don't push content down when they load.
  6. 6Test by scrolling your page slowly — anything that jumps or shifts position as content loads is a layout shift. Cookie banners and chat widgets that pop in at the top of the page are common culprits.

On WordPress

Most WordPress page builders (Elementor, Divi) add images without dimensions. Edit the image HTML in the code editor view and add width/height attributes manually. The Autoptimize plugin can also help.

On Shopify

In your theme liquid files, make sure image tags use Shopify's image_url filter with explicit dimensions: {{ image | image_url: width: 800 | image_tag: width: 800, height: 600 }}

Pro tip: Layout shift is almost always caused by images without set dimensions or content injected by ads and scripts. Fix image dimensions first — it handles 80% of cases.

Does your site have this problem?

SiteSprout scans your site, tells you which issues you actually have in plain English, and keeps watch so nothing breaks silently.

Scan your site free