You uninstalled an app weeks ago. It’s gone from your admin, you’re not paying for it, and you’ve moved on. But there’s a good chance its code is still on your store — still loading on every page, still slowing things down for every visitor. This is “phantom app code,” and it’s one of the most common and most overlooked causes of a slow Shopify store. Here’s what it is, how to find it, and how to remove it without breaking anything.
What is phantom app code?
Phantom app code (also called leftover, orphaned, or dead app code) is code that a Shopify app added to your store and didn’t clean up when you uninstalled it. Uninstalling an app removes it from your admin and stops the billing — but it doesn’t always strip out everything the app injected into your theme.
So you end up with scripts, stylesheets, and snippets from apps you no longer have, quietly loading on every page load. We’ve audited stores carrying leftover code from seven different apps they’d removed months earlier.
Why uninstalling doesn’t always remove the code
Shopify apps add code to your storefront in several ways, and they clean up differently:
- App embeds / app blocks (theme app extensions) — the modern approach. These usually disappear cleanly when the app is removed, because they live outside your theme files.
- Direct theme edits — older apps (and some setup guides) paste
<script>tags or{% render %}snippets straight intotheme.liquid, your layout files, or product templates. Shopify can’t reliably remove these on uninstall, so they stay. - Snippet and asset files — apps drop
.liquidsnippets into your theme’ssnippets/folder and CSS/JS intoassets/. Uninstalling often leaves these files sitting in the theme. - Script tags via the API — usually removed on uninstall, but not always, especially if the app errored or was removed in an unusual way.
The takeaway: the more an app modified your theme directly, the more likely it left something behind.
How phantom code hurts your speed
Leftover code isn’t harmless dead weight — it actively costs you:
- Extra HTTP requests. Each orphaned script or stylesheet is another file the browser has to fetch.
- Render-blocking. Leftover
<script>tags withoutasync/defercan freeze page rendering while they load — even though the app behind them is gone. - Wasted JavaScript execution. Old scripts may still run, error in the console, or wait on resources that no longer exist.
- Bloated theme files. Orphaned snippets and assets make your theme heavier and harder to maintain.
Stack a few of these together and you get the classic symptom: a store that feels sluggish for no obvious reason, where removing “nothing” somehow makes it faster.
How to find phantom app code manually
You can hunt it down yourself in the theme code editor. Go to Online Store → Themes → ⋯ → Edit code, then:
- Search
theme.liquidand layout files for<script>tags and{% render %}/{% include %}references. Look for anything naming an app you’ve removed. - Check the
snippets/folder for files named after old apps (e.g.app-name-something.liquid). - Check the
assets/folder for orphaned.jsand.cssfiles from apps you no longer use. - Search across the whole theme for app names, vendor names, or telltale comment markers (apps often wrap their code in comments like
<!-- BEGIN app-name -->). - Inspect the live page — open browser DevTools → Network tab, reload, and look for requests to domains belonging to apps you’ve uninstalled.
It works, but it’s slow and a little risky — it’s easy to miss something, or to delete the wrong thing and break a feature you still use.
How to find it automatically
This is exactly the kind of tedious detective work ThemeLens is built for. It scans your theme files and flags app code that’s still loading, shows you which files contain it and what it’s doing to your speed, and ranks issues by impact — so you can clear out phantom code in minutes instead of reading through Liquid by hand. It’s free to start.
How to remove it safely
Whether you found it manually or with a tool, remove it carefully:
- Duplicate your theme first. Always work on a backup so you can roll back instantly if something breaks.
- Remove the obvious orphans — script tags and snippet references pointing to apps you’ve definitely uninstalled.
- Delete leftover snippet/asset files only after confirming nothing else references them (search the theme for the filename first).
- Preview, don’t publish. Test the duplicate theme thoroughly — homepage, product pages, cart, checkout — before making it live.
- Re-test your speed. Run PageSpeed Insights before and after so you can confirm the cleanup actually helped.
When in doubt about a specific snippet, leave it and verify — removing code you still depend on is worse than a little extra weight.
How to prevent it going forward
- Prefer apps that use theme app extensions (app embeds/blocks) — they uninstall cleanly.
- Audit after every uninstall. Make “check the theme for leftovers” part of removing any app.
- Avoid hardcoding app snippets into
theme.liquidduring setup when an app block is available. - Review your theme periodically — especially before peak seasons — to catch buildup early.
Phantom app code is invisible until you go looking for it, but it’s one of the easiest speed wins on most Shopify stores: you’re literally deleting code for features you don’t even have anymore.
Related reading
- Shopify Page Speed Optimization: The 5 Mistakes Slowing Down Your Store — phantom app code is mistake #1; this covers the other four too.
- Step-by-Step Guide to Improve the Page Speed Score of Your Shopify Store — the full, step-by-step speed playbook.
- What Is a Good Shopify Speed Score? — how to read your score and what to aim for.
- The Best Shopify Page Speed Apps — which type of speed app fits your store, and what to avoid.
Not sure which leftover code is still loading on your store? Install ThemeLens — it scans your theme, flags phantom app code, and tells you exactly what to remove first. Free to start.