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
- Identify the plugin adding the unused JavaScript.
- Use a plugin script manager to disable that plugin from loading on pages where it is not needed.
- 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
- 1Go to Settings → Perfmatters → Script Manager.
- 2Find the plugin injecting the unused script.
- 3Toggle it off for the current URL, Post Type, or Site-Wide (adding exceptions where needed).
- 4Save changes.
WP Rocket
- 1Go to Settings → WP Rocket.
- 2Navigate to the File Optimization tab.
- 3Scroll down to 'Delay JavaScript execution' and enable it.
- 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.