Your Website Is Running Code You Didn't Write. Audit It Before It Costs You Sales
Your Website Is Running Code You Didn't Write. Audit It Before It Costs You Sales A chat widget here. A tracking pixel there. A review badge, a heatmap, an A/B testing snippet. Each one took two minutes to add. None of
Your Website Is Running Code You Didn't Write. Audit It Before It Costs You Sales
A chat widget here. A tracking pixel there. A review badge, a heatmap, an A/B testing snippet. Each one took two minutes to add. None of them has been reviewed since.
That is the quiet reality of most websites in 2026. The November 2026 State of Web Vitals analysed 236,675 crawled sites, and the findings are uncomfortable: 79.1% of audited sites execute third-party scripts, 64.7% still ship render-blocking synchronous scripts, and the worst offenders load more than 1.5 MB of unused JavaScript before the visitor sees anything at all.
The most expensive JavaScript on your site is not the code you wrote. It is the code you never audited.
The hidden tax on every visit
Every script on your page competes for the same two scarce resources: the network and the browser's single main thread. A synchronous script in your <head> stops the HTML parser dead until it downloads, parses and executes. While it runs, nothing else can happen β no rendering, no interaction, nothing.
This is not a theoretical problem. The State of Web Vitals data shows the cost in plain numbers. Sites with render-blocking scripts pass Largest Contentful Paint at 79%, with a 1.7-second median. On React and Next.js sites, the gap is sharper: pages with synchronous blocking scripts pass LCP at 66%, against 86% for pages using defer β a 20-point difference from one loading attribute.
WordPress is the worst offender of the major platforms: 89.1% of WordPress sites load render-blocking synchronous scripts. And the third-party problem is nearly universal β across WordPress sites, 77.6% execute cross-origin third-party scripts on top of their own code.
Then there is Interaction to Next Paint, the metric that measures whether your site feels fast. INP grades your worst interaction, not your first. A chat widget that wakes up on a timer, a heatmap recorder mutating the DOM, a tag manager firing on every click β any of them can turn one tap into a 400 ms freeze. Your Lighthouse score can be green while your visitors still feel the lag.
Audit your site in ten minutes
You do not need a performance consultancy to find the damage. You need ten minutes and the browser you already have.
First, list everything your page actually loads. Paste this into your DevTools console on your homepage:
const thirdParty = performance.getEntriesByType('resource')
.filter(r => new URL(r.name).origin !== location.origin)
.map(r => ({
url: r.name,
sizeKB: Math.round(r.transferSize / 1024)
}))
.sort((a, b) => b.sizeKB - a.sizeKB);
console.table(thirdParty);
console.log('Total third-party weight:',
Math.round(thirdParty.reduce((s, r) => s + r.sizeKB, 0)), 'KB');
That table is your inventory. Every row is a vendor running code on your site. Now ask three questions about each one: who added it, what job does it do, and when was it last checked? If nobody can answer all three, it is a candidate for removal.
Second, run Chrome DevTools Coverage (Ctrl+Shift+P, then "Show Coverage") and reload. It shows exactly how much of each script executes on first load β and how much is dead weight shipped "just in case".
Third, run PageSpeed Insights and read the "Reduce unused JavaScript" and "Reduce the impact of third-party code" diagnostics. They name the offenders and attach numbers to them. Those numbers are your business case.
Delete first, optimise second
The instinct is to optimise what you have. The right move is usually to remove what you do not need.
GitHub learned this in September 2026, when its engineering team published the results of moving github.com away from CSS-in-JS to CSS Modules. The Primer migration alone cut server-side rendering time by 55% and component initialisation time by 25%. The lesson was not "CSS Modules are magic". It was that a runtime abstraction, doing work on every single request, had become a tax the team no longer needed to pay.
Shopify proved the same point from the other direction. Rebuilding its five Checkout Blocks extensions on Preact and Polaris web components cut transferred bundle sizes by 40% to 85% across the family β payment-icons alone dropped 84.4% β and every extension loaded faster.
Both teams did the same thing: they measured first, then removed the work that should not exist, and only then optimised what remained. Apply that order to your third-party scripts:
1. Delete. Remove anything with no owner, no measurable job, or no recent use. The old A/B test, the heatmap from a campaign that ended in March, the second analytics tag nobody remembers installing. Deleting is free and instant.
2. Defer or delay. Anything that is not needed for the first screen should not block it:
<!-- Blocks rendering until it loads: avoid this -->
<script src="https://cdn.example.com/widget.js"></script>
<!-- Parses after the HTML: use this for your own scripts -->
<script src="/app.js" defer></script>
<!-- Loads in parallel, runs when ready: use this for independent tags -->
<script src="https://cdn.example.com/analytics.js" async></script>
Better still, load heavy widgets on interaction. A chat widget that only loads when a visitor clicks "Chat" costs zero milliseconds for the 95% of visitors who never click it. That pattern β called a facade β is the single highest-leverage change most sites can make.
3. Offload. For the scripts you genuinely need, move the execution off the main thread. Tools like Partytown run third-party code inside a web worker, and edge tag managers like Cloudflare Zaraz execute tags on the server side, so the browser never pays the cost at all.
Give every script an owner and an expiry date
The technical fixes are the easy half. The reason sites drift back into bloat is that nobody owns the inventory. Treat every third-party script like a vendor, because that is what it is:
- An owner. One named person who can explain why it is there.
- A job. One sentence describing what it does and what breaks if it goes.
- A removal date. A date in the calendar when it gets reviewed or deleted. No date, no script.
Then set a performance budget and enforce it in CI, not in good intentions: a maximum number of third-party scripts per page, a maximum third-party JavaScript weight, and a rule that any new script needs the owner's name in the pull request. WordPress sites should be stricter still β with 89.1% of them shipping render-blocking scripts, the default plugin install is the risk, not the exception.
Re-audit quarterly. Scripts accumulate the way clutter accumulates: one reasonable addition at a time, until the total is unreasonable.
The work that should not exist
Most performance advice tells you to make the browser do more, faster: another caching layer, another CDN rule, another optimisation pass. But the fastest code is the code that never runs. The teams I audit are usually optimising work that should not exist in the first place β and the fix is a delete key, not a new tool.
Open your site's DevTools console today and run the audit above. Count the scripts you did not write, add up their weight, and ask the only question that matters: if this script disappeared tomorrow, would anyone notice β and would the visitor?
I break down systems like this daily β follow for more.
Sources: The State of Web Vitals, November 2026 (corewebvitals.io) β 236,675 crawled sites; GitHub Engineering, "Improving site performance by shipping more CSS" (September 2026); Shopify Engineering, "Upgrading Checkout Blocks app to Polaris web components" (2026).
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.