How to fix and minimize main-thread work on your website
"Minimize main-thread work" means your pages ask the visitor's browser to do too much at once, mostly running JavaScript, so the page feels slow or ignores taps. You fix it by removing or delaying scripts you do not need, mainly third-party tools, and by keeping pages simple.
If you ran a speed test and saw a warning called "Minimize main-thread work" (sometimes "Reduce JavaScript execution time"), this page is for you. It sounds technical, but the idea is simple. A browser has one main worker, called the main thread, that handles almost everything on a page: reading the code, drawing the layout, running scripts and reacting to clicks. When that worker is busy, nothing else happens.
What people see
Visitors rarely notice a warning. They notice the symptoms:
- The page appears but scrolling stutters or freezes for a moment.
- A button, menu or add to cart tap does nothing for a second, then reacts (or they tap twice).
- A cookie banner or chat widget appears late and the page jumps.
- The site feels fine on a new laptop but sluggish on an older phone.
That last point matters. Phones have much weaker processors than the computer you build the site on, so the same scripts take far longer to run there.
Why it matters
A busy main thread hurts two responsiveness measures. Total Blocking Time (a lab measure in tools like Lighthouse) goes up, and Interaction to Next Paint, or INP, gets worse. INP is the real-world measure of how quickly a page responds when someone taps or clicks, and Google treats 200 milliseconds or less as good. Core Web Vitals are part of how Google judges page experience, so this can affect search.
The bigger effect is usually sales and trust. A shop that ignores taps loses buyers, and a contact form that seems frozen loses enquiries.
How to check if your site has it
These free methods all work without coding:
- Open PageSpeed Insights and test your most important page (home page, top product or booking page). Look at the mobile result first.
- In the diagnostics list, find "Minimize main-thread work" and "Reduce JavaScript execution time". Expand them to see time split into categories such as Script Evaluation, Style and Layout, and Rendering.
- Look at the list of scripts and their cost. Names that are not your own (analytics, chat, ads, social feeds, review widgets) are usually the biggest culprits.
- In the same report, check the real-user INP figure at the top if it is shown. This is measured from actual visitors and tells you whether the problem is felt in practice.
- For more detail, open Chrome, press F12, choose the Performance tab, record a page load and look for long red-flagged tasks. This is best left to a developer.
SiteMonday runs this kind of check in week 4, the speed and Core Web Vitals service, and lists the findings in a ranked fix list so you know what to tackle first.
How to fix it in general
The main thread is busy because of too much code. So the cure is less code, or code that runs later. Work through these in order, because the early ones give the most return for the least effort.
- Remove scripts you do not use. Old tracking pixels, abandoned chat tools, unused fonts and plugins from past experiments still run on every visit. If nobody looks at the data, remove it.
- Deal with third-party scripts. Ads, tag managers, heatmaps, social widgets and review badges are often the heaviest items. Keep only what earns its place and load the rest after the page is usable. See third-party scripts slowing your site.
- Delay non-essential scripts. Chat widgets and similar tools do not need to load before the visitor can read the page. Many can load after the first interaction or after a short delay. Take care with consent and tracking scripts, and test afterwards that they still fire.
- Simplify the page. Huge pages with thousands of elements make style and layout work expensive. See excessive DOM size.
- Cut heavy animations and sliders. Auto-playing carousels, scroll effects and background videos keep the main thread busy. A static image is often just as persuasive.
- Update and trim your theme or app set. Older themes and bloated page builders often ship large bundles of JavaScript for features you never switched on.
- For developers: split large JavaScript bundles so each page loads only what it needs, break up long tasks, and avoid doing heavy work during page load.
Common platforms
Exact menu names depend on your version and theme, so treat these as pointers.
- WordPress: the usual cause is plugins and a heavy theme. Deactivate plugins one at a time on a staging copy and retest. Look in Plugins, then check which ones add front-end scripts (sliders, popups, social feeds, form builders). Caching plugins sometimes have a setting to delay JavaScript, which can help but must be tested.
- Shopify: apps are the common source. Each installed app can add scripts to your storefront, and uninstalling an app does not always remove its code from the theme. Check Online Store, Themes, and ask a developer to look for leftovers.
- Wix and Squarespace: you have less control over the platform code, so focus on what you add: fewer apps and embeds, no autoplay video backgrounds, simpler animations and fewer third-party code snippets in the header or footer injection areas.
- Elementor and other page builders: disable widgets and effects you do not use, avoid stacking many animated sections, and keep pages short.
- Next.js and React: the usual fixes are code splitting, loading heavy components only when needed, and moving work to the server where possible. This is developer territory.
How to confirm the fix worked
Change one thing at a time, then retest the same page on mobile in PageSpeed Insights. Lab scores vary a little between runs, so test two or three times and compare the pattern, not a single number. Check that the "Minimize main-thread work" time has dropped and that the script list is shorter. Then click through the site yourself: menus, forms, checkout and any tracking you rely on. Real-user INP data updates slowly (it covers a rolling period of weeks), so give it time before judging the result.
How to stop it coming back
This problem returns quietly, one new tool at a time. Make it a rule that every new plugin, app or tracking script is tested for speed before and after it goes live, and that someone owns the list of what is installed. Review that list a few times a year and remove anything unused. A recurring check helps too, since SiteMonday repeats its speed review as part of the yearly cycle, so regressions show up in the next report rather than in lost sales. Remember that SiteMonday finds and explains the problem; the fixing is for you or your developer.
Step by step for your platform
- Excessive main thread work on WordPress
- Excessive main thread work on Shopify
- Excessive main thread work on Wix
- Excessive main thread work on Next.js
- Excessive main thread work on React
- Excessive main thread work on Elementor
- Excessive main thread work on Squarespace
Questions
What is the main thread in a browser?
It is the single worker in a browser that runs scripts, calculates layout and responds to taps and clicks. If it is busy with one big job, everything else on the page has to wait.
Is main-thread work the same as page load speed?
Not exactly. A page can appear quickly but still feel stuck afterwards because scripts keep the main thread busy. Main-thread work mostly affects how responsive the page is.
Will fixing this improve my Google rankings?
It can help, because it improves Total Blocking Time and INP. INP is one of the Core Web Vitals. Do not expect it to outweigh good content, but it also improves how visitors experience your site.
Which scripts are usually the worst offenders?
Third-party tools such as ads, tag managers, chat widgets, heatmaps and social feeds are common causes. Large theme or page builder JavaScript is the next most common.
Do I need a developer to fix it?
Not always. Removing unused plugins, apps and widgets is something most site owners can do. Splitting code bundles or breaking up long tasks needs a developer.
Why does my site feel fine on my computer but slow on my phone?
Phones have slower processors, so the same scripts take much longer to run. Always test on mobile, and treat the mobile result as the one that matters.