How can I remove unused code after uninstalling apps?

Topic summary

Core Issue:
Shopify store owners struggle with leftover code from uninstalled apps that slows page speed. No automated app exists to clean this code.

Key Findings & Solutions:

  • Shopify’s New Requirements: As of ~2 months ago, Shopify requires apps to provide automatic code removal upon uninstallation. Users should reinstall apps briefly to check for cleanup buttons.

  • Diagnostic Approach: Use Chrome DevTools (right-click → Inspect → Network tab) to identify slow-loading resources and trace them to specific apps or theme files.

  • Common Culprits:

    • Facebook Pixel requests (often duplicated, sometimes 3+ instances)
    • Review apps (Ali Reviews, Judge.me, Yotpo, Opinew)
    • Loyalty/rewards programs
    • Chat widgets and email marketing tools
    • Unused CSS/JavaScript from themes
  • Recommended Actions:

    1. Contact app developers for optimization help
    2. Add loading="lazy" to image tags for lazy loading
    3. Search theme files for app references using text editors
    4. Consolidate duplicate pixels/tracking codes
    5. Remove unused apps completely following developer uninstall guides

Important Caveats:

  • Some JavaScript loads after main page (via Shopify script tags), so doesn’t actually slow initial load despite Google reports
  • Theme core files shouldn’t be modified without expertise
  • Google Lighthouse scores simulate slow connections and may not reflect real user experience
  • Professional developer help recommended for complex code removal
Summarized with AI on October 31. AI used: claude-sonnet-4-5-20250929.

i have the same problem causing major problem in my store. why are these apps not required to remove all there code when the app is deleted. people should be warned about this before adding any apps. is there any tool out there to identify the location of unused code. i can delete the code if i know what file its in and how to identify the code.

Remove unused CSS

2.2 s

Remove dead rules from stylesheets and defer the loading of CSS not used for above-the-fold content to reduce unnecessary bytes consumed by network activity. Learn more.

Show 3rd-party resources (3)

URL Size Potential Savings

…admin/style-6eaaa8d….css
(cdn.shopify.com) 195 KB 194 KB

…assets/theme.scss.css?771
(cdn.shopify.com) 17 KB 13 KB

…assets/beans.css?771
(cdn.shopify.com) 2 KB 2 KB

1 Like