Unused JavaScript is code downloaded on a page but not needed for the initial experience. It wastes bandwidth and main-thread time. Themes, plugins, page builders, analytics, and app embeds commonly load scripts globally even when only one page needs them.
Copy this as a starting pattern, then adapt paths/selectors to your real site and test before release.
// WordPress example: dequeue a script on pages that do not use it
add_action('wp_enqueue_scripts', function () {
if (!is_page('contact')) {
wp_dequeue_script('contact-form-plugin');
}
}, 100);
B · FIX WITHOUT CODE
Disable plugins/apps that are not needed.
Turn off plugin features that inject global frontend scripts.
Load video, chat, maps, and reviews only after user intent where possible.
C · ELEMENTOR / SHOPIFY / WIX
Elementor: disable unused experiments/add-ons and reduce widgets per template.
Shopify: remove unused app embeds and theme snippets after uninstalling apps.
Wix: reduce site-wide custom scripts and third-party integrations.
04 · BEFORE / AFTER PROOF
Verify the fix instead of guessing.
Confirm script removal did not break forms, menus, analytics, checkout, or other business-critical journeys. Measure transferred bytes and main-thread work before/after.
BEFOREMeasure the affected URLAFTERRe-test the same URL and device class
05 · FAQ
Common questions
Can I delete every unused script Lighthouse lists?
No. Coverage is page- and timing-specific. A script may be needed after interaction or on another route.
Does Genesis verify removals?
Any automated repair must pass compatibility, regression, and rollback checks before being treated as eligible.