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.
Every time you install a Shopify app that modifies your theme, it leaves its fingerprints 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.
This cleanup is one of the most underrated Shopify performance improvements.
How do I delete code in Shopify?
The short answer: Online Store → Themes → Actions → 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 (Online Store → Themes → Actions → 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.
Related: Edit Your Shopify Theme.
Related: Speed Up a Shopify Theme.
Related: Remove Unused Code in Shopify.
Related: Fix Layout Issues After Installing Shopify Apps.
Using Theme Inspector to find slow scripts
The Shopify Theme Inspector Chrome extension shows which scripts and assets are contributing most to page load time. After cleaning up leftover code, run it to confirm the scripts are no longer loading.
FAQ
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 and have a native version built into your theme before removing the app code.
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.
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 performance gain compounds as cruft accumulates.
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.
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.