Shopify Theme Speed Optimization Guide
How to speed up a Shopify theme: remove leftover code, move tracking out of theme.liquid, size images correctly, and test every change on a duplicate theme.

On this page
Shopify theme speed optimization is the work of auditing your theme's code, removing what no longer belongs, controlling the scripts that load on every page, and sizing media correctly, then measuring the result on real pages. Shopify already provides the hosting and content delivery, so what you can change is the theme, the apps and the media. Do the work on a duplicate of your live theme and test before publishing.
Most stores slow down gradually. You install an app to test a feature, uninstall it, and leave code behind. You add a tracking pixel for a campaign and never remove it. You upload large images to collection pages. This guide covers the theme side. For the app side, see how apps slow a Shopify store and how to find them, and for the full picture, the Shopify page speed guide.
Start with the numbers
Google measures experience with Core Web Vitals: Largest Contentful Paint (LCP), Interaction to Next Paint (INP) and Cumulative Layout Shift (CLS). They measure how fast the main content appears, how quickly the page responds to a tap, and how stable the layout is. Test with PageSpeed Insights, and read the field data for real visitors where it exists. Test a product page and a collection page on mobile, and write the numbers down before you change anything. The Core Web Vitals guide explains each metric on Shopify.
Clean up leftover code in theme.liquid
Removing an app does not always remove what it wrote into your theme. Duplicate your live theme first, then open the duplicate's code editor and look in layout/theme.liquid for {% render 'app-name' %}, {% include 'app-name' %} and script tags that reference apps you no longer use. Common sources are old review widgets, currency converters and notification bars.
Instead of deleting blindly, comment each block out with Liquid comments ({% comment %} and {% endcomment %}), save, preview the theme and test the cart, checkout and collection pages. When everything works, remove the commented lines. If you are unsure where a snippet comes from, search your theme files for its name.
Move tracking out of the theme
Tracking tags from advertising platforms, analytics and heatmaps each open a connection, download a script and run it. Many stores paste them into the <head> of theme.liquid, which loads them early on every page and can hurt LCP and INP.
Shopify's Customer events settings let you run tracking pixels in a sandboxed environment instead of pasting them into theme code, and that is usually the lighter option. If you use Google Tag Manager, keep the container tidy and review it regularly. Delete pixels for campaigns that ended. Every script has a cost.
Size images for the slot they fill
In your theme's Liquid, use the image_url filter with a width that matches how large the image is displayed, so a small card does not download a camera-size file. Make sure the first large image on a product or collection template, which is often your LCP element, is not set to lazy load, and keep lazy loading for images below the fold. Declaring width and height or an aspect ratio for images also prevents layout shift.

Check sections and fonts
Every section a template loads adds code. Remove sections you do not use from your templates, and watch for sliders, carousels and videos on pages where they add little. Limit font families and weights to the ones you actually use.
Does theme speed affect SEO?
Speed is one signal among many. Google lists Core Web Vitals among its page experience signals, but a faster theme will not rescue a page with weak content or indexing problems. The more reliable reason to do the work is the visitor: pages that become usable sooner are easier to buy from. Fix the biggest slowdown first and keep a before and after record.
How long does it take?
A first cleanup of a heavily modified theme can take a few days of careful work, because each change needs testing. After that, set a monthly check: run PageSpeed Insights on a product and a collection page, and look for new scripts or sections since the last review.
Choosing a faster theme
Theme architecture matters. Modern Online Store 2.0 themes such as Dawn are built around Shopify's current features and are a sensible baseline. If your theme is old, moving to a current theme can be more effective than patching it. Before you buy a theme, test its demo store in PageSpeed Insights and read the mobile results, since heavy themes show their weight on mobile first.
See what is slowing your store
SEO Karbon's free Shopify SEO audit measures speed on real templates as part of 71 checks across 10 areas, with no login, so you can see where to start. If your theme needs deeper work, Digital Karbon handles theme cleanups for Shopify brands.
Next step
See how your own store scores
The free audit checks your store against the issues in this article — indexation, duplicate collections, page speed and everything else that holds a Shopify store back — and shows you what to fix first.



