Fix guides · Performance
How to reduce Total Blocking Time (and JavaScript execution time)
When scripts keep the browser busy, taps and clicks wait. How to find the heavy scripts and cut them down on Shopify, WordPress, Webflow, Wix, Squarespace and Next.js.
- Time to fix
- 1–3 hours
- Skill needed
- Developer
- Who notices
- Visitors on phones: taps and scrolling feel stuck
Why it matters
Total Blocking Time (TBT) adds up how long the browser was too busy running code to respond to a tap, click or key press while the page loaded. It counts the part of each task that runs past 50 ms; on phones, Lighthouse treats 200 ms or less in total as fast and over 600 ms as slow.
“Minimize main-thread work” and “Reduce JavaScript execution time” are the same problem seen from two sides: they list which kinds of work, and which scripts, kept the browser busy.
The cause is nearly always JavaScript: apps and plugins, tracking and chat widgets, sliders and page builders, all running as the page loads. Real visitors feel it as Interaction to Next Paint (INP), a Core Web Vital.
“The median TBT on mobile is 1,209 milliseconds, which is 6 times higher than the best practice. In contrast, desktop websites show much better performance, with a median TBT of just 67 milliseconds.”
Before you start
- Open “Reduce JavaScript execution time” in your report: it lists scripts by how long they ran. The top two or three are usually most of the problem.
- For each one, ask: do we still need it? Does it need to run on every page? Can it wait until someone interacts?
- Removing a script beats optimizing it. Test the pages that relied on it afterwards.
Fix it on your platform
Shopify
- Check which apps own the heaviest scripts (the file address usually names the app). Remove apps you don't use, and turn off their app embeds in the theme editor.
- Remove A/B testing anti-flicker snippets when no test is running.
- Theme developers: load code for things like drawers and quick-view only when someone opens them, using import() inside the event listener.
WordPress
- Deactivate plugins you don't need, then check which remaining ones load scripts on every page. Many can be limited to the pages that use them.
- Page builders, sliders and chat widgets are common heavy hitters. Replace a slider with a single image where you can.
- A performance plugin can delay non-essential scripts until the visitor interacts. Enable it one script at a time and test.
Webflow
- Remove third-party code you no longer need from your site and page custom code settings and from Embed elements.
- Keep interactions modest on pages that matter most; complex scroll animations run a lot of code on phones.
Wix
- Review third-party code in Custom Code settings, Marketing Integrations and app scripts, and remove anything that doesn't clearly earn its place. This is Wix's own advice for improving INP.
- Limit the number of apps and widgets on each page.
Squarespace
- Custom code, third-party embeds and code injections can slow your site. Remove what you don't use (save a copy first).
- Remove extensions you no longer use.
Next.js
- Keep components on the server unless they need interactivity; Server Components send no JavaScript to the browser.
- Load heavy client components with next/dynamic only where they're used, and third-party scripts with next/script's lazyOnload strategy.
- Use the Performance panel in Chrome DevTools to find long tasks in your own code.
import dynamic from "next/dynamic";
const Reviews = dynamic(() => import("./Reviews"));Any other site
- Remove scripts you don't need, and load the rest with defer.
- Load code for widgets only when the visitor opens or reaches them.
- Split long-running code into smaller pieces so the browser can respond in between.
button.addEventListener("click", async () => {
const { openChat } = await import("./chat.js");
openChat();
}, { once: true });“Too much JavaScript, loaded at the wrong time or written inefficiently, is one of the primary causes of poor Interaction to Next Paint (INP) and delayed Largest Contentful Paint (LCP).”
Check that it's fixed
- Re-run your StudioLNC audit: TBT should drop, and the scripts you removed shouldn't appear under JavaScript execution time.
- Click through menus, forms and checkout to make sure nothing you removed was needed.
Find every issue like this on your site
Free audit of performance, accessibility, SEO and security, with fixes for your platform.