You uninstalled an app months ago, but something of it is still there: an empty box under the product price, a console error on every page, a script request to a domain that no longer answers. Apps that added code directly to theme files often leave it behind when they go, and that code keeps loading, failing or taking up space until someone removes it.
This guide explains where leftover app code hides, how to find it, and how to remove it without breaking your storefront. It uses Shopify terms, because that is where the problem is most common, but the approach works on any platform with editable theme files.
Key takeaways
- Theme app extensions usually clean up after themselves. App blocks and app embeds are generally removed with the app on current themes.
- Code added directly to theme files often stays. Older apps, and older installs on older themes, are the usual source.
- Search your theme files for the app’s name, its script domain and the names of files it created.
- Test on a duplicate, check the browser console and key pages, then publish.
- Keep the old theme unpublished for a while so you can compare or roll back.
Why leftover code matters
Leftover code is rarely dramatic, but it adds up:
- Speed: a script tag that points to a removed service still makes the browser try to fetch it. Even a failed request takes time, and a working script from an app you no longer use is worse.
- Errors: scripts that expect the app to exist can throw errors that interfere with other scripts on the page.
- Layout: empty containers, stray spacing or broken widgets appear where app content used to be.
- Confusion: the next person to edit the theme cannot tell which code still matters.
- Data: tracking code left behind may keep sending visitor data to a service you no longer have an agreement with.
How apps add code to a theme
Knowing how an app was installed tells you whether to expect leftovers.
| Method | How it works | After uninstall |
|---|---|---|
| App blocks and app embeds (theme app extensions) | Added and toggled in the theme editor; the code stays in the app, not your files | Generally removed automatically on current themes |
| Script tags added by the app through the platform | Loaded on the storefront without editing theme files | Generally removed when the app is uninstalled |
| Direct theme file edits | The app or its support team edited your layout, sections, templates or snippets | Often left behind |
| Files added to the theme | New snippet, asset or template files created during setup | Often left behind |
| Manual installation by you or a developer | Code pasted from the app’s install instructions | Stays until someone removes it |
| Tracking or pixel code | Added to the theme, to custom pixels or to the order status page settings | Stays until removed |
If an app’s install instructions told you to paste code into a file, or its support team “set it up for you”, assume there is something to clean.
Step 1: Find out what the app added
Before searching, gather clues:
- Your own records. An app audit log, install notes or messages from the developer often say which files were changed. Our Shopify app audit guide includes a log template.
- The app’s documentation. Many developers publish uninstall or removal instructions listing the files and lines to delete.
- The developer’s support. If the app is still listed, ask which files it changed in your theme.
- Theme file history. The theme code editor generally lets you see older versions of individual files, which can show when lines were added.
- A clean copy of your theme. If you can add a fresh copy of the same theme and version, comparing files side by side shows what was added since.
Step 2: Duplicate your theme
Make a copy of the published theme and do all the work there. Name it clearly, for example with the date and “app cleanup”, so nobody publishes the wrong copy by mistake. Also download a copy of the theme files to your computer as a backup and for searching. Our guide to backing up your store data covers theme copies alongside product, customer and order exports.
Step 3: Search the theme files
Downloaded theme files can be searched with any text editor that searches across a folder. The code editor in your admin also has search, though it is slower for large themes.
Search for:
- The app’s name, in several forms: with spaces, with hyphens, with underscores, and any short name or abbreviation the app used.
- The developer’s name or company name.
- The domains the app loaded files from, which you can find in the browser’s network tab or in the app’s documentation.
- File names the app created, such as a snippet named after the app.
Then look in the usual places:
| Where | What to look for |
|---|---|
| Main layout file (theme.liquid on Shopify) | Script and stylesheet tags in the head or before the closing body tag that mention the app or its domain |
| Snippets folder | Files named after the app, or files you do not recognize from the original theme |
| Sections and templates | Render or include tags that load the app’s snippets, for example {% render 'app-name-widget' %} or older {% include 'app-name' %} |
| Assets folder | JavaScript and CSS files named after the app |
| Alternate templates | Page or product templates created for the app, such as a template for a wishlist or reviews page |
| Theme settings data | References to app blocks or settings that no longer exist |
| Custom pixels, tracking settings and order status scripts | Tracking or conversion code added for the app |
Note each match in a list: file, line, what it seems to do, and whether you are sure it belongs to the app.
Be careful with common names
A snippet called “reviews” or “wishlist” may belong to the theme itself, not to an app. Before removing anything, compare with a clean copy of the theme or check whether the theme documentation mentions that file. If you are not sure, leave it.
Step 4: Remove references, then files
Work in this order:
- Delete the line that loads the code. For a snippet, that is the render or include tag in a section, template or layout file. For a script, the script tag or the asset line that loads it.
- Preview the duplicate theme and check the pages where the code appeared.
- Delete the file (snippet, asset or alternate template) only when nothing else references it. Search for its name once more before deleting.
- Preview again.
If a line sits inside a block of theme code you do not understand, remove only the app’s part, or comment it out first if you are comfortable doing that, and test.
Alternate templates and pages
If the app used its own template for a page, check which pages are assigned to it before deleting it. Reassign those pages to a standard template, or remove the pages themselves if they only existed for the app. Also check navigation menus and the footer for links to pages that no longer serve a purpose.
Step 5: Test the duplicate theme
Test the pages customers use most, on mobile and desktop:
| Page | What to check |
|---|---|
| Home page | Layout, sections, no empty boxes |
| Collection page | Product grid, filters, quick view if used |
| Product page | Price, variant picker, add to cart, any remaining widgets |
| Cart | Line items, notes, checkout button |
| Search and 404 page | Results display and links work |
| Customer account pages | Login and order history, if the app touched them |
Open the browser’s developer tools on each page:
- Console: look for errors that mention the app or a missing file.
- Network: filter by the app’s domain and make sure no requests remain.
If the app affected anything near checkout, shipping or order processing, place a test order once the theme is live.
Step 6: Publish and keep the old copy
Publish the cleaned theme at a quiet time. Keep the previous theme unpublished for a few weeks as a reference; as a rule of thumb, delete it only when you are sure nothing is missing. Measure the same pages you measured before, and record what changed in your audit log. Our store speed checklist explains how to compare results fairly.
Other places leftovers hide
Not all leftovers live in theme files:
- Product and customer data: tags, metafields or custom fields created by the app. They do no harm on their own, but other tools may still read them, and they clutter filters and exports.
- Email templates: notification templates that include app content or links.
- Navigation and pages: links to pages the app created.
- Redirects: URL redirects the app set up for its own pages.
- External accounts: subscriptions billed directly by the developer, and accounts on the developer’s site holding your store’s data.
When to start from a fresh theme
If years of apps, edits and fixes have left a theme full of code nobody understands, cleaning it line by line may take longer than starting again. A fresh copy of the current theme version, with your settings and genuine customizations carried over, gives you a known base. This is a bigger job and usually worth planning with a developer, but it can also bring theme updates you have missed.
Preventing it next time
- Prefer apps that use app blocks and app embeds. Our checklist on how to choose Shopify apps explains what to check before installing.
- Record every manual code change: file, line, date and which app it belongs to.
- Ask developers to mark their code, for example with a comment naming the app at the start and end of each block.
- Ask for removal instructions before you install, not after.
FAQ
Can I remove leftover code without knowing how to code?
You can find and remove clearly labeled lines and files if you work on a duplicate theme and test carefully. If code is mixed into theme logic you do not understand, an hour of a developer’s time is cheaper than a broken product page.
Will removing leftover code break my theme?
Removing the right lines should not. Problems come from deleting files that other parts of the theme still use. Remove references first, search before deleting files, and test.
Do I need to remove code from apps I still use?
No. Only remove code for apps that are uninstalled, or old code the developer confirms is no longer used after an update.
Bottom line
Uninstalling an app does not always remove its code. Find out what the app added, search a downloaded copy of your theme for its name and domains, remove the lines that load its code before the files themselves, and test a duplicate theme before publishing. Keep the old copy for a while, record what you changed, and choose apps that keep their code out of your theme files next time.



