Fix guides · Performance

How to reduce unused JavaScript

Most sites load scripts they never use: old apps, plugins and tracking tags. Every one slows taps and clicks. How to find and remove them on Shopify, WordPress, Webflow, Wix, Squarespace and Next.js.

Time to fix
30 minutes to a few hours
Skill needed
No code
Who notices
Every visitor, most on slower phones

Why it matters

Every script is downloaded, read and run by the visitor's phone, even the parts the page never uses. On mid-range phones that keeps the page busy, so taps and scrolling respond late.

The biggest savings rarely come from your own code. They come from apps, plugins and third-party tags that were added once and never removed.

“The median page saw a reasonable 280 KB of uncompressed, unused JavaScript on desktop and 251 KB on mobile.”

HTTP Archive Web Almanac 2025, Page Weight

Before you start

  • Your report lists the files with the most unused code, and their web addresses usually reveal where they come from (a chat widget, a reviews app, an analytics tag).
  • Some unused code is normal: a script may contain features for other pages. Focus on whole tools you no longer need.
  • List every app, plugin and tag on the site and ask of each: do we still use it, and does it need to load on every page?

Fix it on your platform

Shopify

  1. In your admin, go to Settings → Apps and uninstall apps you no longer use.
  2. Before uninstalling, check the app's listing or ask its developer whether it leaves code in your theme that you need to remove.
  3. In the theme editor, open App embeds and turn off any embed you don't need on every page.

WordPress

  1. In Plugins, deactivate and then delete plugins you don't use. Deactivated plugins don't load, but deleting them keeps the site tidy.
  2. Check heavy plugins (page builders, sliders, social feeds) for options to load only on the pages that use them.
  3. Review tracking tags added by plugins or a tag manager, and remove ones nobody looks at.

Webflow

  1. Webflow's own scripts are managed by Webflow. Remove third-party code you no longer need from your site's and pages' custom code settings and from Embed elements.
  2. Remove integrations you've stopped using, and interactions on pages where they're no longer needed.

Wix

  1. Wix's own scripts are managed by Wix. Remove apps you no longer use from your site (each app adds its own scripts).
  2. In your dashboard, go to Settings → Custom Code and delete snippets for tools you've stopped using.

Squarespace

  1. Squarespace's own scripts are managed by Squarespace. Remove extensions you no longer use.
  2. Open the Code Injection panel and delete scripts for tools you've stopped using. Check Code blocks on individual pages too.

Next.js

  1. Keep components as Server Components unless they need interactivity: they send no JavaScript to the browser.
  2. Load heavy, rarely used components with dynamic import, and third-party scripts with next/script (lazyOnload where possible).
  3. Measure with @next/bundle-analyzer to see which packages make up your bundles, then replace or remove the biggest ones you barely use.
Dynamic import
import dynamic from "next/dynamic";

const Chart = dynamic(() => import("./Chart"), { loading: () => <p>Loading…</p> });

Any other site

  1. Remove libraries and tags you no longer use.
  2. Split large bundles so each page loads only its own code, and load optional widgets (chat, video) when the visitor first interacts.

“Some apps add code to your online store theme that isn't automatically removed when you uninstall the app.”

Shopify Help: Uninstalling apps

Check that it's fixed

  • Re-run your StudioLNC audit: the unused JavaScript total should drop.
  • Check that the remaining features (checkout, forms, chat) still work after removing anything.

Find every issue like this on your site

Free audit of performance, accessibility, SEO and security, with fixes for your platform.