Back to all posts
Security Published October 14, 2026 5 min read

How to Remove Leftover App Code From a Shopify Theme

Uninstalling a Shopify app does not always clean the theme. Here is where leftover code hides, how to find it, and how to remove it without breaking the storefront.

By The Appnary Team

When you uninstall a Shopify app, the app stops running on Shopify's side. Whether its code leaves your theme depends on how the app was built.

Apps that use theme app extensions add blocks and embeds that Shopify disables when the app is removed. Apps that were installed by editing theme files, often older ones, can leave snippets, sections, and script tags behind. Those leftovers keep loading on the storefront, and a script from a vendor you no longer use is still a script you are trusting.

Back up before you touch anything

In the admin, open Online Store, then Themes. On the live theme, open the three-dot menu and choose Duplicate. Do all the work on the copy, preview it, and publish it only when the storefront looks right. Deleting the wrong line from a live theme is the usual way this goes wrong.

Where leftovers hide

  • theme.liquid. Look for script and link tags that point at a vendor you no longer use. The domain usually gives the app away.
  • Snippets and Sections folders. Files are often named after the app, such as a snippet with the vendor's name, and rendered from theme.liquid or a template with a render tag.
  • App embeds. In the theme editor, open the App embeds tab. An old embed can still be switched on.
  • Templates. Product and cart templates sometimes include a render call for a snippet that no longer does anything.

Find the code

Search the code editor for the app's name, then for the domain its scripts loaded from. Then open your storefront, open the browser's developer tools, and look at the Network tab. Every third-party domain that loads is listed there, with its size. A domain you do not recognize is worth a closer look.

Remove it

Delete the render call or script tag first, then the snippet file it pointed to, and reload the preview after each step. If something breaks, undo the last edit. Do not delete a line you cannot tie to the app.

Why it is worth the afternoon

Leftover code is dead weight at best. At worst it is a script from a company you no longer have a relationship with, running on every page, including ones that handle customer details. If the vendor's domain changes hands or is compromised, your storefront loads whatever is served there.

Vigil is our scanner for this. It is in development, not on the Shopify App Store yet, and it cannot be installed today. Read what it checks or join the waitlist. It is built to name the theme file or app behind each external script, so this search is one scan instead of a hunt.

Shopify securityTheme codeApps

Frequently Asked Questions

Does uninstalling a Shopify app remove its code from my theme?
Not always. Apps built with theme app extensions are disabled when you uninstall them. Apps that edited your theme files can leave snippets and script tags behind, and you have to remove those yourself.
How do I know which app a script belongs to?
Search the theme code for the app's name and the domain its scripts loaded from, check the App embeds tab in the theme editor, and use the browser Network tab to see which third-party domains load on the storefront.
Is it safe to delete code from the live theme?
Duplicate the theme first and work on the copy. Publish it only after you have previewed the storefront and checked the pages that used the app.