INP · high impact

Reduce unused JavaScript

JavaScript is the most expensive resource on a webpage. Heavy scripts are being loaded and parsed, but much of the code is never executed on this page.

Why it matters

Unused JS blocks the main thread, causing slow Interaction to Next Paint (INP) and Total Blocking Time (TBT).

How to fix it in WordPress

  1. Identify the plugin adding the unused JavaScript.
  2. Use a plugin script manager to disable that plugin from loading on pages where it is not needed.
  3. Enable 'Delay JavaScript Execution' in your performance plugin.

Plugin-specific steps

Already using one of these plugins? Follow the exact steps for your setup.

Perfmatters

  1. 1Go to Settings → Perfmatters → Script Manager.
  2. 2Find the plugin injecting the unused script.
  3. 3Toggle it off for the current URL, Post Type, or Site-Wide (adding exceptions where needed).
  4. 4Save changes.

WP Rocket

  1. 1Go to Settings → WP Rocket.
  2. 2Navigate to the File Optimization tab.
  3. 3Scroll down to 'Delay JavaScript execution' and enable it.
  4. 4This will delay the loading of unused third-party and plugin JS until the user interacts with the page.

How to verify the fix

  • Run PageSpeed Insights again to verify the script is no longer flagged.
  • Interact with the page (scroll, click menus) to ensure nothing is broken.

Find out which of these your site has.

Free scan with real Google data. Exact fixes for your plugins.