Speed & Performance
Your Shopify page jumps while it loads. Here is how to find what moves and fix it.
A shopper opens your store on their phone, starts reading, reaches for the "Shop now" button, and the page jumps. Their thumb lands on something else, or the paragraph they were reading slides out of view. It only takes a second, but it makes a store feel unreliable, and on product pages it leads to mis-taps right next to Add to cart.
Google measures this too. It is called layout shift, scored as Cumulative Layout Shift (CLS), and it is one of the three Core Web Vitals. A score under 0.1 counts as good. Above 0.25 counts as poor.
This guide shows why Shopify pages jump while loading, how to find exactly which element moves on your store, and how to fix each cause.
What causes a page to jump
A layout shift happens when something that is already on screen moves because something else appeared or changed size. On Shopify stores, the same causes come up again and again:
- Images without reserved space. If the browser doesn't know an image's size before it downloads, it gives it zero height, then pushes everything down when the image arrives. Hero banners and collection grids are the usual culprits.
- Bars and banners added late. Free-shipping bars, countdown timers, cookie notices and app banners that are inserted by JavaScript at the top of the page push the whole page down after it has already appeared.
- App widgets that load after the page. Review stars under the product title, "pay in 4 instalments" messages, upsell blocks and size-guide links often appear a second or two later and shove the price and Add to cart button down.
- Web fonts swapping in. Text first shows in a fallback font. When the custom font arrives, letters change width, lines re-wrap, and the blocks below move.
- Slideshows and carousels setting themselves up. Many slideshows show all slides stacked, or none, until their script runs and resizes them.
- Embeds without a fixed shape. YouTube videos, Instagram feeds and map embeds that start at zero height and then grow.
Step 1: find the element that moves
You need to know which element shifts before you can fix it. Three free ways to find it, from quickest to most detailed:
PageSpeed Insights
- Run your page through PageSpeed Insights and open the mobile result.
- Check the Cumulative Layout Shift figure. If your store has enough visitors, the "Discover what your real users are experiencing" section at the top shows the score real Chrome users get.
- Open the Avoid large layout shifts diagnostic (or "Layout shift culprits" in newer versions). It lists the elements that moved and how much each contributed.
Chrome DevTools: see shifts highlighted live
- Open your page in Chrome on a computer, press
F12, and switch to the mobile view with the phone-and-tablet icon. - Press
Ctrl+Shift+P(Cmd+Shift+Pon a Mac), type "Rendering" and open the Rendering panel. - Tick Layout Shift Regions. Every area that moves now flashes blue as it happens.
- In the Network tab, set throttling to Slow 4G, then reload. Watch what flashes, and in what order.
Chrome DevTools: exact numbers
In the Performance tab, record a page reload. The Layout shifts track shows each shift with its score and the elements involved. Click a shift to see the element's position before and after. That tells you, for example, that the main content moved 412 px when the hero image arrived.
Test product pages and collection pages as well as the homepage. App widgets usually cause shifts on product pages, which is where mis-taps cost the most.
Step 2: fix each cause
Give every image its size
Shopify's image_tag filter adds the image's width and height attributes automatically, so the browser can reserve the right space before the file downloads. If your theme or a custom section writes <img> tags by hand, switch to image_tag:
{{ product.featured_image
| image_url: width: 800
| image_tag: loading: 'lazy', sizes: '(min-width: 750px) 50vw, 100vw' }}
For containers whose height depends on a background image or a video, give the container a fixed shape with CSS so it takes up the right space while it's still empty:
.hero-banner { aspect-ratio: 16 / 9; }
@media (max-width: 749px) {
.hero-banner { aspect-ratio: 4 / 5; }
}
Make late bars overlay, or reserve their space
If an app or script adds a bar at the top of the page, choose one of two approaches:
- Overlay it. Show it fixed at the top or bottom of the screen, on top of the page, so nothing underneath moves. Most cookie banners and many promotion apps have a setting for this.
- Reserve the space. If it must sit in the page, give its container a minimum height that matches the bar, so the space exists before the bar fills it. Better still, use Shopify's built-in announcement bar section, which is part of the page from the start.
Reserve space for app widgets
For app blocks that load after the page (review stars, instalment messages, upsell blocks), add a minimum height to their wrapper so the layout doesn't change when they appear:
.product__info .review-stars-block { min-height: 24px; }
.product__info .bnpl-message { min-height: 40px; }
The class names depend on your theme and apps. Find the right ones with Inspect, measure the widget once it has loaded, and use that height. If a widget isn't earning its place, removing it is the simplest fix.
Stop text re-wrapping when fonts load
This one caught us too. When we checked our own contact page on a throttled phone, it scored 0.21: the heading re-wrapped when the web font finished loading and pushed the form down 26 px. We fixed it by defining a fallback font tuned to the web font's measurements, so the text takes up the same space before and after the font arrives:
@font-face {
font-family: 'Inter Fallback';
src: local('Arial');
size-adjust: 107%;
ascent-override: 90%;
descent-override: 22%;
line-gap-override: 0%;
}
body { font-family: 'Inter', 'Inter Fallback', sans-serif; }
After the change, the same test scored 0. The exact percentages depend on your font. Free tools such as the Fontaine and Capsize projects calculate them for common fonts.
Let slideshows start in their final shape
Set the slideshow container's height or aspect ratio in CSS, show only the first slide by default, and hide the rest. Then the script can take over without the area changing size. If you only ever show one banner, replace the slideshow with a single image section.
Give embeds a fixed shape
Wrap videos, maps and social feeds in a container with an aspect-ratio or a fixed height. Use the same approach as the hero banner above.
Step 3: check the result
- Reload with Layout Shift Regions on. Nothing should flash blue while the page loads, apart from content that appears in its own reserved space.
- Record another Performance trace and check that the Layout shifts track is empty or close to it.
- Run PageSpeed Insights again and compare the layout shift score with your first run.
- Real-user data (the top of PageSpeed Insights and the Core Web Vitals report in Google Search Console) covers the previous 28 days, so expect it to improve gradually over the following weeks.
Where to start
Fix the shift closest to your Add to cart button first, then anything in the first screen of the homepage. If your homepage is also slow to show anything at all, see our guide to a Shopify homepage that stays blank on mobile: the two problems often share a cause in the hero section.
As always, make these changes on a duplicate of your theme first (Online Store > Themes > Actions > Duplicate) and preview it on a phone before publishing. Layout fixes are a regular part of our speed and conversion work, and we can usually fix them on your current theme without a rebuild.