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. 1

    Run PageSpeed Insights and check 'Reduce unused CSS' and 'Reduce unused JavaScript' sections.

  2. 2

    Identify which files have the most unused code — these are usually from removed apps.

  3. 3

    Check Online Store → Themes → Edit Code → Assets folder for CSS/JS files from apps you've uninstalled.

  4. 4

    Remove references to these files from theme.liquid or section files.

  5. 5

    Check for app remnants: search for script tags referencing domains of apps you no longer use.

folderlayout/theme.liquid + assets/
<!-- 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>
menu_bookRead Google's official documentationopen_in_new

Related Fix Guides

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