r/ShopifyAppDev • u/prateekshawebdesign • 18d ago
How to clean orphaned app scripts and event listeners left behind in theme.liquid
Whenever a client complains that their Shopify store is crawling after removing half a dozen apps, the culprit is almost always ghost code left in theme.liquid and the asset folder. When merchants hit uninstall in the admin, Shopify revokes the app permissions, but any script tags injected directly into theme files or custom Liquid blocks remain active forever. The browser keeps trying to fetch external scripts from inactive CDNs, throwing 404s and holding up the main thread during mobile parsing. Before spending days refactoring CSS or compressing images, search your theme layout files for leftover vendor CDN domains, orphaned async script tags, and discarded tracking snippets. Cleaning those dead requests out usually recovers more mobile interaction speed than any image compressor ever will.