DEV Community

Lakum Jay
Lakum Jay

Posted on

How to Clean Orphaned Liquid Code After Uninstalling Shopify Apps (And Shave 1.5s off Mobile LCP)

When a store owner uninstalls an app from Shopify, the app's dashboard disappears, but its injected JavaScript and Liquid code often remains trapped inside theme.liquid and the snippets/ directory.

These leftover scripts (ghost code) still execute on every single page load, creating render-blocking requests and slowing down Largest Contentful Paint (LCP) by 1 to 2 seconds.

The 4-Step Cleanup Routine:

  1. Audit theme.liquid Header: Search for unused vendor asset URLs, tag manager containers, or old tracking pixels from uninstalled apps.
  2. Inspect the snippets/ Directory: Look for snippet files matching the uninstalled app vendor name (e.g., app-reviews.liquid, currency-converter.liquid) and remove the corresponding {% render %} tags.
  3. Check for Injected Script Tags via API: Use the Shopify Admin API or Chrome DevTools Network tab to check for unattached remote script tags.
  4. Benchmark on Staging: Always verify Core Web Vitals before and after removing ghost code using Google PageSpeed Insights.

For a complete breakdown of mobile checkout speed and Shopify theme optimization, visit my portfolio at Jay Lakum — Freelance Webshop Developer or read my Dutch webshop speed guides on jaylakum.com/nl/.

Top comments (0)