To remove leftover app code from a Shopify theme, duplicate the live theme, search its files for the names and domains of apps you no longer use, and delete each reference before the file it points to. Preview the copy after every removal, publish it only when nothing broke, and compare page speed before and after.

Why does app code stay in your theme after uninstalling?

Shopify removes what an app added through its own extension system, but it cannot tell which lines in your theme files an app or a developer typed in by hand. That second kind is what stays behind.

Modern apps add features through theme app extensions: app blocks you place in sections and app embeds you switch on under Theme settings. These are designed to disappear when the app is uninstalled. Older apps, and many installation guides, work differently. They write a snippet file such as snippets/reviews-widget.liquid, add a render tag to theme.liquid or a product template, and sometimes drop a JavaScript or CSS file into the assets folder. None of that belongs to the app as far as Shopify is concerned, so it remains after the app is gone.

There is a third source that is easy to miss: code a merchant or freelancer pasted into a Custom Liquid section or block in the theme editor, often a tracking pixel or a widget script. It lives in the template settings, not in the snippets folder, so a search of the code editor alone will not always find it.

Is leftover code actually slowing your store down?

Sometimes, but not always, so confirm it before you touch anything. A forgotten snippet that renders nothing costs almost nothing; a script that still loads from a vendor’s server on every page does.

Open a product page in Chrome, open DevTools, go to the Network tab and reload. Sort by domain and look for requests to services you no longer use. Each one is a concrete candidate, with its file size and timing next to it. Then run PageSpeed Insights on the same page and note the lab scores and the Largest Contentful Paint and Interaction to Next Paint figures. Those numbers are your baseline.

Keep two things in mind. Field data in PageSpeed Insights and in Shopify’s own speed report is based on real visits over roughly the last 28 days, so it moves slowly after a fix. And the biggest costs often come from apps you still use, large images or a heavy theme, not from leftovers. When the theme itself is the bottleneck, cleanup will not fix it; that is a case for a custom website built for speed.

How do you find and remove leftover code safely?

Work on a copy, trace every candidate to an app, and remove references before files. That order keeps the live store untouched until the copy is proven.

  • Duplicate the live theme under Online Store, Themes, and do all work on the copy.
  • List every app you have uninstalled, with its name, vendor and script domain.
  • In the code editor, search for each name and domain, and open theme.liquid, product and cart templates first.
  • Check app embeds under Theme settings and every Custom Liquid section or block in the theme editor.
  • For each find, confirm it belongs to a removed app: the vendor’s uninstall guide often lists the exact files.
  • Remove the render or include tag first, then the snippet or asset file it loaded.
  • Preview the copy after each removal on the homepage, a collection, a product page and the cart, on mobile too.
  • Publish the copy, keep the old theme as a fallback for a few weeks, and rerun your baseline measurements.

The order in step six matters. If you delete snippets/reviews-widget.liquid while theme.liquid still renders it, Shopify shows a “Could not find asset” Liquid error on every page that uses it. Removing the tag first makes the file unused, and an unused file is harmless to delete.

Be careful with code you cannot place. A snippet with a generic name may be part of the theme, or used by an app you still rely on. If you are unsure, leave it, or ask the app vendor which files their installer added. One deletion at a time, previewed each time, means a mistake is easy to trace.

When should you clean up, and when should you rebuild?

Clean up when you can name the apps that left code behind and the theme is otherwise sound. Rebuild when nobody can say where half of the code came from.

Situation Best route Why
One or two removed apps, known vendors Manual cleanup on a duplicate Fast, low risk, easy to verify
Many removed apps, theme still close to its original version Compare with a fresh copy of the same theme version Differences show you exactly what was added
Years of edits by several developers, outdated theme version Fresh theme or custom rebuild, then re-add only the apps you use Cleanup costs more than it saves
Slowness comes from apps you still use Review those apps, not the leftovers Removing dead code will not change much

A theme cleanup app can help with the first two rows by matching known patterns, but it still needs a person to check its findings against the apps you actually use. For the last two rows, treat the theme as part of a redesign: when URLs or templates change, follow the same care as in our guide on redesigning a website without losing SEO.

How do you keep a Shopify theme clean from now on?

Keep a short log of every app and every manual edit, and prefer apps built on theme app extensions. Then the next uninstall cleans up after itself.

Before installing an app, check whether it adds blocks and embeds through the theme editor or asks you to paste code. Prefer the first. When code must be pasted, write down the file, the line and the app in a shared document, so removal later takes minutes. Test new apps on a duplicate theme before they touch the live one, and review the app list every quarter.

A custom theme makes this easier because there is less inherited code to doubt. For La Florentina, we built a custom Liquid theme for a Shopify store selling handcrafted leather belts, with a conversion-focused purchasing journey and room for premium storytelling.

FAQ

Does uninstalling a Shopify app remove its code?

It removes app blocks and app embeds added through the app’s theme app extension. Code that the app installer or a developer wrote directly into theme files, such as snippets and render tags, usually stays until someone removes it.

Can leftover app code break my Shopify store?

Usually it only adds weight, such as extra script requests or unused styles. It breaks pages when a snippet file is deleted while a render tag still points to it, which shows a Liquid error until the tag is removed too.

Should I use an app to clean up leftover code?

A cleanup app can speed up the search by matching known patterns from popular apps. Still review every suggested removal on a duplicate theme, because a tool cannot know which code your current apps and custom features depend on.

How long before PageSpeed Insights shows the improvement?

Lab results change as soon as the cleaned theme is published. Field data in PageSpeed Insights and in Shopify’s speed report covers roughly the last 28 days of real visits, so expect it to shift gradually over the following weeks.


Unsure whether your theme needs a cleanup or a rebuild? Tell us about your store and we will give you a straight answer.