How to find and remove leftover code from uninstalled Shopify apps
Updated October 12, 2026
Short answer: uninstalling an app doesn't always remove its code. Modern apps add themselves through app blocks and app embeds, which stop loading when you uninstall. Older apps, and setup steps where you pasted code yourself, leave code in your theme files. To remove it: duplicate your theme, search the code for the app's name and its web address, remove each line that loads the app's code before you delete any of its files, preview the copy, then publish it.
Prefer an automatic check? GhostCode scans your theme for leftover app code and shows which app each piece came from. It only reads your theme. Free and paid plans available.
Why some apps leave code behind
There are two ways an app can put code on your storefront, and they behave very differently when you uninstall:
| How the app was added | What happens when you uninstall |
|---|---|
| App blocks and app embeds (a theme app extension). You switch them on in the theme editor under App embeds or add them as blocks. | They stop loading. Shopify's developer docs say an app's blocks are automatically removed from your theme when you uninstall it. An entry for the app's embed can stay in the theme's settings file (config/settings_data.json). With the app gone it should load nothing. |
| Code written into your theme files, by an older app or by you following its setup instructions. | It stays. The app loses access to your store at the moment you uninstall, so it can't clean up after itself, and Shopify doesn't know which lines it added. |
Shopify introduced theme app extensions in 2021, and new apps in the Shopify App Store that work with your theme must use them instead of editing theme files. So the stores with the most leftovers are usually older stores, stores that have tried many apps, and stores that were moved from another platform and had apps installed "just in case." Review widgets, popups, currency converters, upsell tools and page builders installed years ago are common sources.
Where leftover app code hides
layout/theme.liquid: the most common spot. Look for<script>and<link>tags in the<head>and just before</body>that point to an app's domain, and for{% render %}or{% include %}lines that load an app's snippet.- The
snippetsfolder: files named after the app (for exampleappname-widget.liquid). - Sections and templates: product, cart and collection sections where a review widget, badge or upsell block was pasted in.
- Custom Liquid sections: code pasted into a Custom Liquid section in the theme editor doesn't appear as its own file, so a search of the snippets folder misses it. Check the section list in the theme editor too.
- The
assetsfolder: JavaScript and CSS files the app uploaded. - SEO tags and structured data: old review and SEO apps sometimes added their own product schema (JSON-LD) or meta tags. Leftover schema can show Google and AI shopping tools an old price or rating that no longer matches your store.
checkout.liquid: on stores that had it, apps often added tracking or upsell code there. Shopify has retiredcheckout.liquid, so that code no longer runs, but it's still clutter.
Step by step: removing it safely
- Duplicate your live theme. In your admin, go to Online Store → Themes, open the menu (…) on your current theme and choose Duplicate. Make every change on the copy. If anything breaks, your live store is untouched.
- List the apps you've removed. Your memory and old app invoices help. For each one, note its name and the web domain it loaded from (you'll see it in the leftover code itself, for example
cdn.appname.com). - Search the copy's code. Open the copy's code editor (… → Edit code) and search the theme for each app's name and domain. Work through every match.
- Remove the line that loads the code before you delete the file. If
theme.liquidsays{% render 'appname-widget' %}, delete that line first, search for any other place that renders the same snippet, and only then deletesnippets/appname-widget.liquid. Arenderline pointing to a missing snippet shows a Liquid error on your storefront. - Check Custom Liquid sections in the theme editor for pasted app code.
- Preview the copy on your homepage, a product page, a collection and the cart. Look for blank spaces, Liquid errors or anything that looks wrong.
- Publish the copy and keep the old theme for a few weeks in case you need to compare.
Not sure whether a line belongs to an app you still use? Leave it. Removing live app code breaks that app. And if the app's developer is still around, ask them: they know exactly what they added.
How to tell if it's slowing your store
- Browser developer tools: open your store in Chrome, press F12, open the Network tab and reload. Requests to domains of apps you no longer use, especially ones that fail or take long, are leftovers costing you load time.
- The browser console: errors mentioning an old app's name or domain usually mean its code is still loading but its service is gone.
- Google PageSpeed Insights: the sections on third parties and on unused JavaScript list scripts by domain. A domain you don't recognize as one of your current apps is worth searching for in your theme.
Speed scores move a few points between runs, so compare several tests before and after rather than one.
Script tags and the March 1, 2027 deadline
Script tags are a separate, older way for apps to load code on your storefront. Shopify adds them to your pages for the app; they don't appear in your theme files, so a search of your code won't find them.
- For apps you've uninstalled: script tags belong to the app that created them, and Shopify removes them when you uninstall that app. You usually don't need to do anything.
- For apps you still use, there's a deadline: since October 1, 2026 apps can't create or update script tags, and on March 1, 2027 Shopify stops adding them to online store pages. Any app that still relies on a script tag stops working on your storefront that day unless its developer moves it to an app embed (which you switch on in the theme editor) or a web pixel.
- How to check: open your homepage, view the page source, and search for
asyncLoad. The list of addresses next to it (var urls = [...]) is the script tags Shopify loads for your apps. For each one, ask the app's developer whether they've moved to an app embed, and switch the embed on once they have.
Where GhostCode fits
We make GhostCode, a Shopify app that does the search above for you. It scans your theme against signatures for 100+ apps, shows each leftover with the app it came from, the file, the line and the code, and groups findings by what they cost you: speed, what Google and AI tools see, and tracking that still runs. It also lists apps on your store that still depend on script tags before the 2027 deadline, and flags scripts from known malicious domains. GhostCode only reads your theme. It never edits it, so you stay in control of every change. Read how GhostCode works. Free and paid plans available. See the GhostCode listing on the Shopify App Store for features and plans.
Common questions
Does uninstalling a Shopify app remove its code from my theme?
Not always. App blocks and app embeds stop loading, and code written into your theme files stays. Full answer: what uninstalling a Shopify app removes and what it leaves behind.
Can leftover app code slow down my store?
Yes. A leftover script or stylesheet tag still makes the browser request that file on every page view, even though the app is gone. If the app's server no longer answers, the request can fail slowly or throw errors in the browser console. Leftover CSS and snippets add weight even when nothing breaks.
Is it safe to delete an app's snippet file?
Only after you remove every line that loads it. If a render or include tag still points to a snippet you deleted, the theme shows a Liquid error where that snippet used to be. Search the whole theme for the snippet's name, remove those lines first, then delete the file, and do it on a duplicate theme.
What happens to script tags on March 1, 2027?
Shopify stops adding script tags to online store pages. Since October 1, 2026, apps can't create or update them. Any app that still loads its storefront code through a script tag stops working on your store on that date unless its developer moves it to an app embed or a web pixel.
Do I need to remove an uninstalled app's script tags myself?
Usually not. Script tags belong to the app that created them, and Shopify removes them when you uninstall that app. The leftovers you remove yourself are the code that was written into your theme files.
Check your theme in a few minutes: install GhostCode from the Shopify App Store. It never edits your theme. Free and paid plans available.
Sources
- Shopify developer docs: Apps in the online store (theme app extension requirement)
- Shopify developer docs: what happens to app blocks on uninstall
- Shopify changelog: online store script tags deprecation
- Shopify developer docs: Script tag deprecation
- Shopify developer docs: ScriptTag (removed when the app that created it is uninstalled)
Questions: support@alpenglowsoftware.com