Leftover app code: why older Shopify stores get slow
Uninstalling an app does not always remove what it added to your theme. How to find the leftovers and clean them up safely.
A store that has been running for a few years has usually tried a lot of apps. Some were removed after a week. Many of them still leave something behind in the theme.
Why this happens
Before app blocks existed, many apps installed themselves by editing theme files: a snippet here, a script tag in theme.liquid there. Uninstalling the app ends the subscription, but it doesn't undo those edits. So the store keeps loading a script for a service nobody uses, sometimes from a server that no longer answers, which can make the page wait even longer.
How to find them
- Open
layout/theme.liquidand read the head and the end of the body. Look for scripts and snippets with names of apps you don't recognise. - Go through the
snippetsfolder for files named after apps. - Open the store with the browser's network tab and group requests by domain. Every third-party domain should belong to something you still use.
Cleaning up safely
- Duplicate the live theme and work on the copy.
- Remove one app's code at a time and preview the store after each one.
- Check the pages that app touched: the product page for reviews, the cart for upsells.
- Publish the copy when it works, and keep the old theme for a few days in case something was missed.
To check that the cleanup helped, test the same page before and after. Our post on what a good Shopify speed score is explains which numbers to compare.
Avoiding it next time
Prefer apps that work through app blocks and app embeds. You can switch them off in the theme editor and they leave nothing behind. Before installing, ask the app's support how removal works. In my experience the good ones answer that quickly.
Finding and removing leftover code is part of our Shopify speed optimization work, and our store audit lists every leftover snippet we find.