Reduce unused JavaScript
You are sending code to the browser that this page never runs. It still has to be downloaded, parsed and compiled before it can be ignored.
What this warning means
You are sending code to the browser that this page never runs. It still has to be downloaded, parsed and compiled before it can be ignored.
Why it appeared on your page
Usually a single bundle serving the whole site, so a product page downloads the checkout code too. Also caused by libraries imported whole when one function was needed, and by third-party scripts that ship features you do not use.
Does it actually matter?
Worth acting on when the numbers are large, and the parse-and-compile cost matters more than the download on phones. Be careful with the estimate though: "unused" means unused *during the measured load*, and code used later on interaction is counted as unused.
How to fix it
- Split code by route or template so each page loads only what it needs.
- Load features on interaction rather than up front — chat widgets and video players especially.
- Import only what you use, and check your bundler is actually tree-shaking it.
- Audit third-party scripts: the largest blocks of unused JavaScript are frequently not yours.
On your platform
On Shopify, app scripts are the usual source and you cannot edit them — the lever is which apps load on which templates. On WordPress, dequeue plugin scripts on pages that do not use them.
How to check you fixed it
DevTools → Coverage panel (Ctrl+Shift+P, "Show Coverage"), reload, and compare the unused bytes before and after. Then confirm in a Performance recording that script evaluation time has dropped.