Key takeaways
- Uninstalling a Shopify app does not automatically remove the code it added to your theme.
- Leftover code slows your store down with scripts loading for services that no longer exist.
- Find leftover code by searching for the app name in your theme’s code editor.
- Always work on a duplicate theme. Never edit your live theme directly.
To remove leftover app code from Shopify, duplicate your theme, open Edit code, and search for the app’s name in theme.liquid, snippets, sections and assets. Delete the script tags and files that belong to the uninstalled app, then preview the duplicate before publishing it.
Apps that modify your theme leave code behind. When you uninstall the app, Shopify removes the app itself — but the code it added to your theme stays. Over time, as you cycle through apps, this cruft accumulates. Scripts load for services you no longer use. CSS classes reference styles from apps that haven’t existed for years.
How do I delete code in Shopify?
The short answer: Online Store → Themes, click the three-dot menu (…) next to your theme, then Edit code. This opens the code editor where you can view and edit all theme files. Deleting code requires knowing what’s safe to remove — the steps below help you identify it.
Step 1 — Duplicate your theme before touching anything
This is mandatory. Go to Online Store → Themes → find your active theme → click the three-dot menu → Duplicate.
A mistake in the wrong file breaks your entire storefront. Working on a duplicate means you can always revert by switching back to the original.
Step 2 — Search for the app name in your theme code
Open the code editor on the duplicate (Online Store → Themes, click the three-dot menu (…) next to the duplicate, then Edit code).
Most code editors have a search function. In Shopify’s editor, use the search bar at the top to find the app’s name. Try:
- The app’s brand name (e.g., “loox”, “klaviyo”, “privy”, “yotpo”)
- Common app identifier patterns (
app-name-snippets,app-name-scripts)
Where to look:
theme.liquid — the most common location for leftover script tags. Apps often add JavaScript includes to the <head> or before </body>. Look for <script src="https://app-name.com/..."> tags that remain after uninstallation.
snippets/ folder — apps often create new snippet files (e.g., loox-reviews.liquid, privy-popup.liquid). These appear as new files in the snippets folder that weren’t there before the app was installed.
sections/ folder — some apps add new section types. After uninstalling, the section file remains but the app functionality is broken.
assets/ folder — apps sometimes add CSS or JavaScript files here.
Step 3 — Identify what’s safe to remove
Not all “leftover” code is harmful. Some apps add features you continue to use via the rendered HTML even after the app is uninstalled (this is unusual but possible). Check each piece of code before deleting.
Safe to remove if:
- The code references external scripts (URLs) from the app’s domain that no longer load
- The files are named clearly after the uninstalled app
- Removing the code from theme.liquid doesn’t affect anything visible on the storefront (test on your duplicate)
Be cautious with:
- Generic snippet names that could have been created by multiple apps or your developer
- Any code that appears in sections still actively used on your storefront
Step 4 — Remove the code
For script tags in theme.liquid: delete the entire <script> tag (including the opening and closing tags).
For snippet files: click the file → delete from the three-dot menu next to the filename.
For section files created by an app: only delete if the section is no longer used in any templates or active pages.
After each deletion, preview your storefront to confirm nothing breaks.
Common apps that leave significant code behind
Popup and email capture apps (Privy, Sumo, Justuno) — often add large JavaScript files to theme.liquid.
Review apps (Yotpo, Loox, Judge.me) — add snippet files and often render code in product templates.
Chat apps (Gorgias, Tidio, Intercom) — add chat widget script tags to theme.liquid.
Social proof apps — add notification popups via scripts in theme.liquid.
Page builder apps (uninstalled PageFly, Shogun, GemPages) — can leave substantial section and snippet files behind.
Using Shopify’s App Embed system to prevent future leftover code
Modern Shopify apps use the App Embeds system (Online Store → Themes → Customize → App Embeds icon). When an app uses App Embeds properly:
- Enabling/disabling the app is done through a toggle in the Theme Editor
- Uninstalling the app removes the embed automatically
- No manual code cleanup needed
When choosing new apps, prefer those that use App Embeds over apps that ask you to paste code into theme.liquid. You can check this in the app’s installation instructions. Fewer apps also means less to clean up: many small storefront apps can be replaced with native theme sections.
Every embed that is switched on can still run code on every page, so review the list after any app security incident. In October 2026, code delivered through several storefront apps sent shoppers to fake checkout pages. See the Shopify checkout phishing attack for how to check your store.
For dead CSS and JavaScript that didn’t come from an app, see how to remove unused code in Shopify.
Confirm the app’s scripts no longer load
Chrome DevTools’ Network tab (filter by JS) shows which third-party scripts still load. After cleaning up, reload and confirm the app’s domains are gone.
FAQ
Will removing leftover app code break my Shopify store?
Possibly, if you remove code still referenced by something active. Mitigate the risk by working on a duplicate theme — preview before publishing. The most common breakage: deleting a snippet still rendered by a section, or removing a script another script depends on. Always test the duplicate before swapping. If you're removing an app but still want the feature it provided, describe the feature to Fudge, the AI operator for Shopify stores, and have a native version built into your theme before removing the app code. Fudge can also find the code an uninstalled app left behind and draft the clean-up for you to approve, so you aren't deleting snippets by hand.
How can I tell which code came from a specific app?
Search for the app's name or characteristic strings in the theme code editor. Most apps include their brand name in script src URLs (gorgias.com, klaviyo.com), file names (loox-reviews.liquid), or comments. If unsure, install the app fresh on a test theme and diff against the original — the additions are the app's footprint.
Should I clean up theme code after every Shopify app uninstall?
For apps that used App Embeds, no — Shopify cleans up automatically. For apps that asked you to paste code into theme.liquid, yes. Schedule a quarterly audit if your store has cycled through many apps. The more apps you've tried, the more there is to remove.
Does Shopify automatically remove App Embed code on uninstall?
Yes. App Embeds are scoped to the app — disabling or uninstalling cleans the theme automatically. Apps that modified theme.liquid directly (the older approach) leave their code behind. The distinction matters when choosing new apps; prefer those using App Embeds for cleaner long-term maintenance.
Will the app's data still exist if I delete its theme code?
Yes — app data lives in the app's own database/account, not your theme. Removing theme code doesn't delete reviews, customer lists, or other app-managed content. If you reinstall the app, the data is still there. Theme code only controls how that data is displayed on your storefront.