Menu

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

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

DEV Community: javascript·Lakum Jay·about 15 hours ago
#TiPI98ki
#devtojavascript#devto#dev#liquid#shopify
Reading 0:00
15s threshold

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:

Audit theme.liquid Header: Search for unused vendor asset URLs, tag manager containers, or old tracking pixels from uninstalled apps.

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.

Check for Injected Script Tags via API: Use the Shopify Admin API or Chrome DevTools Network tab to check for unattached remote script tags.

Benchmark on Staging: Always verify Core Web Vitals before and after removing ghost code using Google PageSpeed Insights.

For a complete…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.