Skip to content
Nazmul Nikhil
Menu

Duplicated JavaScript in PageSpeed Insights: Same Code Loaded Twice

PageSpeed flags identical JavaScript modules loaded more than once. Here's how it happens (two plugins, two bundles) and how to remove the copies.

Nazmul Nikhil

By

Head of SEO & Assistant Manager, Digital Marketing at Notionhive

Published 1 min read
Duplicated JavaScript in PageSpeed Insights: Same Code Loaded Twice
Photo: Akshat Sharma on Unsplash

In short

Duplicated JavaScript pinpoints identical modules or libraries loaded more than once on the page, for example two copies of jQuery, or a library bundled separately by two plugins. Each copy costs download and parse time. Load one shared copy.

This was "Remove duplicate modules in JavaScript bundles."

Replaced: duplicated-javascript.

Common causes

  • Two plugins or apps each bundling the same library.

  • A theme loading a library and a plugin loading it again from a CDN.

  • Several separate builds on one page (widgets, micro-frontends).

How to fix it

WordPress: plugins should use WordPress's bundled scripts (wp_enqueue_script dependencies). If one loads its own copy, ask the author or switch plugins. Shopify: check apps injecting their own library copies. Custom builds: deduplicate dependencies (npm dedupe) and share common chunks between bundles.

This insight needs source maps to see inside bundles. Without them, it may miss duplicates.

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

Sources and references

TAGSPageSpeed InsightsDuplicated javascriptRemove duplicate modules in javascript bundlesDuplicate jquery
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