How to Remove Unused CSS and JavaScript From Your Store
errorThe Problem
Your pages load CSS and JavaScript files that contain code not used on the current page. This unused code wastes bandwidth, increases parse time, and blocks rendering. It's one of the most common performance issues on ecommerce sites.
trending_upWhy It Matters for SEO
Every kilobyte of unused CSS delays First Contentful Paint, and unused JavaScript blocks the main thread — worsening INP and TBT. Google flags unused code in PageSpeed Insights under 'Reduce unused CSS' and 'Reduce unused JavaScript.' Removing unused code can improve load time by 0.5-2 seconds.
buildHow to Fix It
- 1
Run PageSpeed Insights and check 'Reduce unused CSS' and 'Reduce unused JavaScript' sections.
- 2
Identify which files have the most unused code — these are usually from removed apps.
- 3
Check Online Store → Themes → Edit Code → Assets folder for CSS/JS files from apps you've uninstalled.
- 4
Remove references to these files from theme.liquid or section files.
- 5
Check for app remnants: search for script tags referencing domains of apps you no longer use.
<!-- To defer non-critical CSS: -->
<link rel="preload" href="{{ 'non-critical.css' | asset_url }}" as="style" onload="this.onload=null;this.rel='stylesheet'">
<noscript><link rel="stylesheet" href="{{ 'non-critical.css' | asset_url }}"></noscript>Related Fix Guides
How to Reduce Excessive JavaScript on Your Ecommerce Store
Too much JavaScript slows your store and hurts SEO. Learn how to identify and remove excess JS on Shopify and WooCommerce.
How to Reduce JavaScript Payload on Shopify & WooCommerce
Heavy JavaScript slows your store and hurts rankings. Learn how to identify bloated scripts and reduce JS payload on Shopify and WooCommerce.
How to Fix Slow Page Speed on Shopify & WooCommerce
Your store is too slow. Learn the fastest fixes for Shopify and WooCommerce page speed — image optimization, app audits, caching, and more.
Want to check if YOUR store has this issue?
Scan your site for free — get copy-paste fixes in 60 seconds.
searchScan Now — It's Free