Shopify Apps Loading Unused JavaScript on Every Page
Search intent: diagnose · Updated February 2026
Many Shopify apps inject their JavaScript files on every page of your store - product pages, collection pages, checkout, blog posts - regardless of whether that app's functionality is used on that page. This is distinct from render-blocking scripts (which is about when scripts load) and is about total payload: the browser must download, parse, and compile JavaScript it will never execute. Google's Lighthouse "Reduce unused JavaScript" audit flags this directly. The fix involves auditing which apps load JS globally, removing unused apps entirely, and for necessary apps, implementing conditional loading so scripts only load on pages where the app is active.
Quick Diagnostic Checklist
- Run Lighthouse on product page - check "Reduce unused JavaScript" opportunity and note size estimate
- Use Chrome DevTools Coverage tab to measure unused bytes per script file
- List all installed apps in Shopify Admin and cross-reference against flagged script domains
- Check theme.liquid and section files for residual scripts from previously uninstalled apps
- Verify OS 2.0 apps are using App Blocks (not legacy ScriptTag API injection)
Not sure if your store has this issue?
Run a free scan to detect performance problems instantly.
What This Issue Means
Every installed Shopify app that loads JavaScript adds to the total JavaScript payload your visitors must download on every page visit. A store with 10 apps - reviews, loyalty, upsell, chat, size guide, currency converter, wishlist, email capture, and two tracking pixels - may be loading 500KB-1MB of JavaScript that has nothing to do with the page a customer is currently viewing. The browser still has to download, parse, and compile all of it. This directly increases Time to Interactive and Interaction to Next Paint, both of which feed into Google's Core Web Vitals assessment.
What Causes It (Shopify-Specific)
Apps inject scripts via content_for_header globally
Shopify's {{ content_for_header }} Liquid object is included on every storefront page. Apps that use Shopify's ScriptTag API or inject code via this object load their scripts unconditionally on every page, with no awareness of whether the page actually uses the app's functionality.
Uninstalled apps leave script residue
When a Shopify app is uninstalled, it does not always clean up its theme modifications. Script tags added directly to theme.liquid, section files, or snippets by the app during installation often remain active - loading code for an app that is no longer even installed.
App developers optimise for features, not performance
App developers have no direct incentive to minimise their JavaScript footprint or implement conditional loading. Their apps must work reliably on installation, so loading scripts globally is the safest approach from their perspective, at the cost of store performance.
Bundle splitting is rarely implemented by app developers
Modern JavaScript best practice involves code splitting - loading only the code needed for the current page. Most Shopify apps ship a single bundled script that includes all functionality for all use cases, even if only a fraction applies to any given page.
How to Detect It Manually
- 1Run Google PageSpeed Insights on your homepage and a product page - look for the "Reduce unused JavaScript" opportunity and note which script URLs are flagged
- 2Open Chrome DevTools → Coverage tab (Cmd+Shift+P → "Coverage") → reload the page → sort by "Unused Bytes" - scripts with over 80% unused bytes are prime candidates for removal or conditional loading
- 3In Chrome DevTools → Network tab → filter by JS → sort by Size - identify large scripts from third-party domains (app CDNs)
- 4Cross-reference the flagged script URLs against your installed apps in Shopify Admin → Apps to identify which app is responsible for each script
- 5For each installed app, ask: "Is this app's functionality needed on this specific page type?" - if no, the script should not load there
How to Fix It (Step-by-Step)
Audit and remove genuinely unused apps
Go to Shopify Admin → Apps and review every installed app. For any app you are not actively using or that is providing no measurable business value, uninstall it. After uninstalling, check theme.liquid and all section/snippet files for residual script tags or render calls and remove them manually.
Check for ghost app code after uninstalling
In Shopify Admin → Online Store → Themes → Edit code, search across all theme files for the names of recently uninstalled apps or their CDN domains. Delete any remaining script tags, stylesheet links, or snippet render calls.
{%- comment -%}
Search for patterns like these in your theme files and remove them
after uninstalling apps:
{{ content_for_header }} -- cannot remove this, it is required
{% render 'app-name-snippet' %} -- delete this line
<script src="https://cdn.app-name.com/app.js"></script> -- delete this
{%- endcomment -%}Implement conditional loading for page-specific app scripts
For apps only needed on specific page types, wrap their script tags in Liquid conditionals. This requires the app to use theme-injected scripts (not ScriptTag API) - check the app's settings for a "manual install" or "theme code" option.
{%- comment -%} Only load size guide app on product pages {%- endcomment -%}
{%- if template == 'product' -%}
<script src="https://cdn.sizeguide-app.com/widget.js" defer></script>
{%- endif -%}
{%- comment -%} Only load review widget where needed {%- endcomment -%}
{%- if template == 'product' or template == 'collection' -%}
{%- render 'reviews-snippet' -%}
{%- endif -%}Migrate eligible apps to Online Store 2.0 App Blocks
Apps built for Online Store 2.0 can use App Blocks, which only load their assets on pages where the block is placed in the theme customiser. If an app offers an App Block version, enable it via Online Store → Customize → App Embeds and disable the legacy script injection in the app settings.
How SEOScan Detects This Issue
SEOScan measures total JavaScript payload per page and uses Chrome's Coverage API to calculate the percentage of each script that is actually executed during a standard page interaction. Scripts from known Shopify app CDN domains with over 60% unused bytes are flagged individually, with the app name identified from the CDN URL pattern. The tool also cross-references script domains against the ScriptTag API patterns to differentiate between app-injected scripts and theme scripts.
Example Scan Result
Description
Product page JavaScript analysis: 847KB total JS payload from third-party app scripts. Unused bytes: 612KB (72%). Highest offenders: Klaviyo (180KB, 85% unused on product page), Loyalty Lion (145KB, 91% unused), Gorgias Chat (98KB, 78% unused on non-support pages).
Impact
Browser must parse and compile 847KB of JavaScript before the page becomes interactive. Time to Interactive delayed by approximately 2.1 seconds on mid-range Android devices. Lighthouse "Reduce unused JavaScript" audit showing critical failure.
Recommended Fix
Audit and remove unused apps. Implement conditional loading for page-specific apps. Migrate apps to OS 2.0 App Blocks where available. Target: reduce third-party JS payload below 200KB on product pages.
Why It Matters for SEO
Interaction to Next Paint (INP)
Unused JavaScript still occupies the browser's main thread during parsing and compilation. A heavily loaded main thread cannot respond to user interactions (clicks, taps) quickly, directly causing poor INP scores - a Core Web Vitals metric and Google ranking factor since March 2024.
Mobile Performance Gap
Mobile devices parse and compile JavaScript 3-5x slower than desktop machines. 600KB of unused app JavaScript that causes minimal slowdown on desktop can add 2-3 seconds of main thread blocking on a mid-range Android phone, which is Google's representative device for mobile CWV measurement.
Cumulative App Bloat
Each additional app adds marginal JS weight that seems acceptable in isolation. Merchants rarely audit cumulative app JavaScript - they install apps one at a time over months or years, gradually accumulating a payload that no individual app decision would have produced deliberately.
Lighthouse Score and CWV Impact
The "Reduce unused JavaScript" audit in Lighthouse directly maps to Total Blocking Time (TBT), which correlates with INP in the field. A poor TBT in Lighthouse predicts poor INP in real user data, which Google's CrUX data collects and uses for page experience ranking.
Real-World Validation Signals
- Average Shopify store has 6-10 apps installed; each app adds 50-200KB of JavaScript, producing a cumulative third-party JS payload of 400KB-1.5MB.
- Google's Chrome User Experience Report data shows that Shopify as a platform has significantly worse INP scores than competitors, with third-party app JavaScript identified as the primary cause.
- Removing one high-impact app (e.g., a loyalty program or chat widget) from a Shopify store consistently reduces Total Blocking Time by 200-800ms in controlled before/after Lighthouse tests.
- Shopify's own performance analysis found that each additional app installed on a store adds an average of 80ms to load time, with the effect compounding non-linearly beyond 5 apps.
Frequently Asked Questions
Q: How is "unused JavaScript" different from render-blocking scripts?
Render-blocking is about timing - a script that loads in the <head> without async/defer blocks HTML parsing regardless of its size. Unused JavaScript is about payload - JavaScript that is downloaded and parsed but never executed during a page visit. Both are harmful but in different ways and require different fixes. A script can be non-render-blocking (deferred) but still contain 90% unused code.
Q: Can I fix app JavaScript without uninstalling the app?
Sometimes. If the app supports theme-injected scripts (rather than ScriptTag API), you can wrap its script tag in a Liquid conditional to only load it on relevant page templates. Apps that use the ScriptTag API cannot be conditionally loaded without contacting the app developer or using a third-party script management tool like Tagify or SpeedSense.
Q: Which Shopify apps are the worst offenders for unused JavaScript?
Chat widgets (Gorgias, Tidio, Intercom), loyalty programs (Smile.io, LoyaltyLion), and email capture tools (Privy, OptiMonk) are consistently flagged for loading large scripts on every page. Reviews apps (Judge.me, Yotpo) also load global scripts that are unnecessary on non-product pages.
Q: Does Google penalise stores for too many installed apps?
Google does not penalise app count directly, but does penalise poor Core Web Vitals scores. More apps almost always means worse CWV scores, which does affect rankings. The indirect penalty is real and measurable.
Q: What is a good JavaScript payload target for a Shopify store?
Lighthouse recommends keeping total JavaScript below 350KB (parsed, not transferred). For a competitive Shopify store, targeting under 500KB total (first-party + third-party) is realistic. Above 1MB of total JavaScript on a product page is a significant performance liability.
Check Your Store for This Issue
SEOScan automatically detects shopify apps loading unused javascript on every page and 4 related issues - with specific fixes for your store.
Run Free Scan