Duplicated JavaScript
The PageSpeed duplicate JavaScript warning highlights that your site is loading unnecessary repeated scripts, which increases weight and slows down performance. Understanding why it appears is the first step in keeping your pages optimized and efficient.

Remove large, duplicate JavaScript mobile form bundles to reduce unnecessary bytes consumed by network activity.
Understanding Duplicated JavaScript
Duplicated JavaScript happens when your WordPress site loads the same code more than once.
- Plugins Overlap: Two or more plugins may load the same JavaScript library.
- Theme + Plugin overlapping: Your active theme might include a library that a plugin also loads.
- Manual Scripts: Custom code added manually.
- Different Versions: Plugins or themes may load different versions of the same library (e.g., jQuery).
How to improve Duplicated JavaScript
WP Rocket cannot remove duplicate JavaScript from your site, but there are a few things you can do to fix it.
- Check plugin scripts: Disable plugins one by one to see which ones load duplicate libraries.
- Use proper enqueueing: Make sure scripts are added with WordPress functions like wp_enqueue_scripts instead of hard‑coding <script> tags.
- Consolidate versions: If plugins load different versions of the same library, try to standardize on one version.
- Theme review: Check your theme’s functions.php or header.php for manually added scripts and remove duplicates.
- With a plugin: Use a plugin like Asset CleanUp to manage and prevent duplicate script loading.
Additional resources
Seeing the “Duplicated JavaScript” Insight? Here’s How to Fix It