Skip to content
Nazmul Nikhil
Menu

Reduce Unused JavaScript in PageSpeed Insights: Load Less Code

PageSpeed flags JavaScript that downloads but never runs on the page. Here's how to find the worst files, defer or remove them, and split bundles.

Nazmul Nikhil

By

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

Published 1 min read
Reduce Unused JavaScript in PageSpeed Insights: Load Less Code
Photo: Alexandre Debiève on Unsplash

In short

"Reduce unused JavaScript" lists script files where much of the code wasn't run during page load, with transfer size and estimated savings. Unused code still costs download time and can delay LCP. Remove scripts you don't need, defer scripts until they're used, and split large bundles so each page loads only its code. Use the 3rd-party toggle to separate your code from tag managers and widgets.

This is often the biggest savings line in the report, and the hardest to fix completely.

Decide per file

File Action
Plugin or app script on pages that don't use it Unload it on those pages
One large site-wide bundle Split by page or feature
Chat, video, map, review widgets Load on interaction
Analytics and tag managers Remove unused tags inside them

WordPress: asset manager plugins can disable scripts per page; "delay JavaScript" options help with widgets. Shopify: uninstall unused apps and remove leftover code. Webflow and Wix: remove unused embeds and integrations. Custom builds: use dynamic import() and route-based splitting.

Mobile vs desktop

The byte savings are the same, but the time cost is larger on mobile because of the slower network and CPU.

Common mistakes

  • Expecting zero. Some code only runs after a click; that's normal.

This guide isn't affiliated with or endorsed by Google.

Sources and references

TAGSPageSpeed InsightsReduce unused javascriptRemove unused javascriptUnused js pagespeed
Nazmul Nikhil

About the author

Nazmul Nikhil

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

SEO and AI search consultant in Dhaka, Bangladesh, helping small and mid-size businesses in the USA, UK, Australia and Canada.

Need help with this?

Get it fixed with Core Web Vitals

I find the issues that cost you traffic and fix them, starting with the pages that matter most.

Keep reading

Related articles

All Page Speed & Core Web Vitals posts →

Get the next guide in your inbox

One email when a new SEO or AI search guide goes live.

Ready to grow?

Get a free audit of your website, or book a 30-minute call to talk through your goals.

Nazmul Hasan

Talk to Nazmul directly

Reply within 24h

WhatsApp +880 1682835118
nazmulnikhil@gmail.com