Why the duplicate theme is where the work happens
Nearly every speed fix touches files the whole store relies on: layout/theme.liquid, the section that renders the hero banner, the snippet behind the product gallery. Get one wrong on the live theme and every visitor sees it at once. On an unpublished copy, the live store keeps trading while you change, break and repair things in private. Safe speed work starts here, before a line of code changes.
To make the copy, go to Online Store > Themes, open the... menu on the live theme and choose Duplicate, as described in this Shopify Community check for leftover app code. From the command line, shopify theme push --unpublished creates a new unpublished theme and returns a link to its editor and a preview link you can share (theme push). A development theme from shopify theme dev is deleted when you run shopify auth logout, so push to an unpublished theme if a colleague or client needs to review it later (Shopify CLI for themes).
Two things catch people out:
- The copy stops following the live theme the moment you make it. Shopify's Canvas documentation puts it plainly: the two themes are separate, and changes made to one aren't added to the other. If someone edits a banner or a section's text on the live theme while you work, that edit is missing from the copy. Agree a content freeze, or keep a list of edits to repeat before publishing.
- Not every admin setting belongs to the theme. App embeds are switched on in the theme editor under Theme settings > App embeds (Configure theme app extensions), and each theme keeps its own settings, so toggling one on the copy is safe. Custom pixels under Settings > Customer events are a store setting: delete one there and it is gone from the live store too.
Record a baseline, with field and lab data kept apart
Before the first edit, write down where the store stands today. You need two kinds of figures, and they answer different questions.
Field data: what real visitors experienced
Shopify's Web performance reports show LCP, INP and CLS from real visits to your store, at the 75th percentile, with the summary based on the past 30 days. Open them from the performance summary on the Themes page or under Analytics > Reports. You need the Reports staff permission, and private mode must be off for the dashboard to fill with real-user data. Note each vital for Last 30 days and for Last 7 days, with the date you read them.
Those three are the Core Web Vitals now. INP replaced First Input Delay, and a good INP means at least 75% of interactions respond to input in under 200 milliseconds (web.dev).
The copy gets no real visitors, so field data can tell you nothing about it until it is published. That is why the baseline has to be taken first.
Lab data: a controlled test of one page load
Run Lighthouse on the home page, a product page and a collection page. Run each a few times and record the spread, not the best run. Take these readings from the untouched copy's preview link rather than the live store, so the before and after figures come from the same setup.
Shopify's performance best practices keep Lighthouse lab tests separate from field data, and your notes should too. A Lighthouse score is not your Core Web Vitals result. The figure people quote, an average of at least 60 across the home, product and collection pages, is the entry bar for the Theme Store, tested on Shopify's own benchmark store. It says nothing about how your live store performs for real visitors.
Treat time to first byte with care as well. Shopify says most of it is Liquid rendering, and because pages are often streamed, a tool's TTFB figure may cover only the <head>. A front-end change won't move it, so don't judge one by it.
Make one change at a time, and know what each should move
If INP gets worse after you changed five things, you have five suspects. Make one change, preview it, re-run the same lab tests, then move on. Keep a short log as you go: the file, what changed, why, and the readings before and after. That log is also the handover for whoever touches the theme next.
The changes below are the ones that come up most often. The causes behind them are covered in our slow store checklist.
Load the main image eagerly, with fetchpriority="high"
Shopify rates two changes to the largest image on screen as high impact: never lazy-load it, and mark it fetchpriority="high" (performance best practices). Lighthouse names the Largest Contentful Paint element, so find out which image it is on each template before editing. Usually it is the first image in the home page banner or slideshow and the first product image.
In the section file, check the img tag or image_tag call for loading="lazy" and remove it. Adding loading="eager" is optional: web.dev notes that eager is the browser default and doesn't load an image any faster than leaving the attribute off (Browser-level image lazy loading). The gain comes from removing the lazy attribute and raising the priority. In Google's own test on Google Flights, high fetch priority improved LCP from 2.6s to 1.9s (Fetch Priority API). That was their page, not a forecast for yours, and web.dev adds that if the image is already preloaded early in the <head>, a high priority might not improve LCP much.
Two mistakes to avoid. Don't mark every image high priority, or none of them stands out. And check the hero isn't a CSS background-image or hidden behind a fade-in animation: Shopify rates fixing both as high impact on LCP too.
Give every image a width and height
Missing width and height attributes are one of the most common causes of layout shift, according to Shopify's guide to preventing image layout shift. The image_tag filter adds them automatically from the image's aspect ratio, so the gaps are usually in hand-written img tags in custom sections, Custom Liquid blocks and older snippets. Pair the attributes with CSS that sets max-width: 100% and height: auto.
To check, open Chrome DevTools, turn on Layout Shift Regions in the Rendering tab and reload the preview with network throttling on. Then look at each image at mobile and desktop widths, because CSS that forced a fixed height can stretch an image once real dimensions arrive. Our anonymised product page case study covers this fix done at template level, and our guide to layout shifts covers the other causes.
Defer the scripts the theme controls
A script without defer or async stops the browser parsing HTML while it downloads and runs. Shopify's guidance on defer and async is to use defer for most theme scripts, which then run in document order once parsing finishes, and async only for independent third-party scripts where order doesn't matter. The script_tag filter doesn't support either attribute, so write the tag by hand, as in Shopify's own example (Defer render-blocking CSS and JavaScript):
<script src="{{ 'theme-interactions.js' | asset_url }}" defer></script>
This is the change most likely to break something. An inline script further down the page that calls a function from a file you have just deferred will now run before that function exists. The result is a dead variant picker or a cart button that does nothing, and an error in the console. Keep the console open on the preview after every deferral.
Know where your control stops. Shopify's table lists app scripts added through the ScriptTag API as not controlled by the theme, so you ask the app developer to use defer, and content_for_header as platform-managed and not deferrable. And don't stop at the apps: Shopify says badly written first-party code is just as damaging as a poorly implemented third-party script.
Clearing out code from apps you've removed
Uninstalling an app doesn't always remove what it added to the theme. Apps built on theme app extensions are removed on uninstall, but code from older apps, or code you pasted in during an app's setup, stays behind (Shopify Community). On the copy, work through Shopify's own steps for removing third-party scripts:
- Search the theme files for the app's name and the domains its scripts loaded from, starting with
layout/theme.liquid. - Check the
snippets/folder for files named after the app, and cross-reference them with your installed apps list. - Find the
{% render %}or{% include %}tags that load those snippets. - Remove the tag first, then delete the snippet file. Delete the file first and the storefront shows a Liquid error.
- Check Custom Liquid sections in the theme editor, and Theme settings > App embeds for anything from a removed app still switched on.
- View the preview's page source and search for the app's domain to confirm nothing still loads.
Only remove code from apps that are no longer installed. If you're not sure whether a snippet is still needed, ask the app developer before deleting it.
Click through what usually breaks before you publish
Start with Shopify's linter. Theme Check flags oversized bundles, render-blocking scripts and assets loaded from other servers (performance best practices), so run shopify theme check on the copy and read anything new. Then re-run the lab tests on the same pages and compare them with the baseline.
Next, open the preview link on a real phone and shop as a customer would, with the console open on a desktop alongside. The features that most often break after speed work are:
- Header and menus: the mobile menu opens, the search drawer opens and predictive search returns results.
- Collections: filters and sorting apply, the next page loads and quick add works.
- Product pages: choosing a variant updates the price, image and stock status; the gallery, zoom, size chart and reviews still load; add to cart works.
- Cart: the drawer opens, quantities change, items remove and a discount code applies. Create the code and redeem it in a test first, so a failure points at the theme and not the code.
- Country and currency selector, if you sell through Markets.
- Cookie banner: it still appears, and nothing used for ad measurement loads before a choice is made. The ICO's storage and access technologies guidance is clear that ad measurement still needs consent.
- Checkout handover: start a checkout from the copy's cart and confirm the right items and prices arrive.
If any of these fails, go back to your change log. With one change per step, the culprit is usually the last line.
Publish the copy and keep the old theme as your way back
Repeat any content edits from the freeze list first. Then publish from the Themes page, or with shopify theme publish, after which the copy is the active theme for the store (Customize a merchant theme). Shopify's Canvas documentation says the previously published theme moves to Draft themes. Leave it there. If something turns up that the click-through missed, publishing the old theme again is your rollback, which is far quicker than a night of hotfixes.
Pick a quiet hour, not the morning of a sale. Once live, repeat the click-through on the live store and view the source for any old app domains.
Judge the result by real visitors, not by the score
Web performance data can be delayed by up to 36 hours, and the summary covers the past 30 days, so for weeks it blends the old theme with the new one (Web performance reports). Use the Last 7 days view and compare the 75th percentile figures with your baseline. Shopify only keeps web performance data for the last 90 days, which is another reason to have written the baseline down somewhere else.
If Lighthouse went up and field INP didn't move, believe the field data. If field LCP improved and the score barely changed, that is still a result. Nobody can promise a score: real visitors bring their own devices and connections, and every new app or section changes the picture again. What you can measure is whether the metric you targeted moved for real visitors, and whether anything broke on the way.
When to hand the job to a specialist
Some fixes are beyond a careful afternoon in the code editor. The largest image sits inside an app block you can't edit. INP is poor and the cause is the theme's own JavaScript bundle. Server response is slow because Liquid loops through large collections on every render. Or the theme was heavily customised by someone who left no notes, and peak trading is close. Our piece on speed apps versus a developer covers where apps stop helping.
That is the work our Shopify speed optimisation service does. The people who investigate the problem are the same people who build, test and document the fix, and each job ends with a handover covering what was tested. Scope and cost are agreed before any work starts, and a one-off fix is welcome with no ongoing commitment. Agencies can also bring us in behind the scenes, and our guide to white label development and speed work for agencies covers how that handover works.
For a first look, the free store check reads your homepage, one product page, the sitemap and robots.txt in about twenty seconds, with no sign-up and nothing stored. Otherwise, today's job is short: open the Web performance reports, write down the three 75th percentile figures with the date, and duplicate the live theme. If you'd rather hand it over, describe what you're seeing and we'll reply by email within one or two working days.
Sources
- Shopify Community, Before BFCM: a 10-minute check for leftover app code in your theme (read November 2026)
- Shopify, theme push (read October 2026)
- Shopify, Shopify CLI for themes (read November 2026)
- Shopify, Creating and customizing themes in Canvas (read November 2026)
- Shopify, Configure theme app extensions (read November 2026)
- Shopify, Web performance reports (read November 2026)
- web.dev, Interaction to Next Paint is officially a Core Web Vital (read November 2026)
- Shopify, Performance best practices for Shopify themes (read November 2026)
- web.dev, Browser-level image lazy loading for the web (read November 2026)
- web.dev, Optimize resource loading with the Fetch Priority API (read November 2026)
- Shopify, Prevent image layout shift with width and height (read October 2026)
- Shopify, Use defer and async on non-critical scripts (read November 2026)
- Shopify, Defer render-blocking CSS and JavaScript (read October 2026)
- Shopify, Shopify Developers Platform (read October 2026)
- Information Commissioner's Office, Guidance on the use of storage and access technologies (read November 2026)
- Shopify, Customize a merchant theme (read October 2026)







