
Most slow WordPress sites I audit are not slow because of WordPress. The theme is fine, the server is fine, the images are compressed – and then the waterfall shows forty requests to domains the owner has never heard of. Third-party scripts – tag managers, chat widgets, analytics, ad and social pixels, video embeds, A/B testing tools, review badges – are code you did not write, loading from servers you do not control, running on your visitors’ devices at a cost you never see on an invoice. On a typical business site they now account for more JavaScript than the theme and every plugin combined.
After 500+ WordPress projects, my speed work has shifted: ten years ago I spent most of an optimisation project on images and CSS; today I spend most of it negotiating with marketing tags. This guide is the diet plan I use with clients and agencies – how to find out what actually loads on your pages, which scripts cost the most and why, what to do about Google Tag Manager specifically, and the four strategies that fix the problem in order of preference: remove, replace, defer, self-host. Real numbers, real tool names, and the honest trade-offs, including the tracking accuracy you risk when you delay a pixel.
Table of contents
- The third-party tax: why other people’s code slows your site
- The census: finding out what actually loads
- The usual heavyweights, ranked
- Google Tag Manager: the script mall
- The diet plan: remove, replace, defer, self-host
- Remove: the quarterly “who uses this” audit
- Replace: facades for chat, video and maps
- Defer: delay until interaction, and the risks
- Self-host what you can
- Measuring per-script cost and keeping tags under control
- Before and after: what a script diet is worth
- Frequently asked questions
The third-party tax: why other people’s code slows your site
Every third-party script charges your visitors three times. First, the network cost: a new domain means a DNS lookup, a TCP connection and a TLS handshake before a single byte arrives – on a mobile connection that is easily 100-300 ms per new origin, and a site with a tag manager, a chat widget, two pixels and a video embed talks to ten or fifteen origins. Second, the download cost: the scripts themselves, often hundreds of kilobytes each, competing for bandwidth with your images and fonts. Third – and this is the one that actually hurts – the main-thread cost: JavaScript has to be parsed, compiled and executed on the visitor’s device, and the browser’s main thread can only do one thing at a time. While a chat widget initialises, the page cannot respond to a tap.
That main-thread cost is why third-party scripts damage INP (Interaction to Next Paint), the Core Web Vitals metric that measures responsiveness. A visitor taps a menu button while a tag manager is busy firing six pixels; the browser queues the tap; the menu opens 400 ms later; the site feels broken. If you want the full background on how INP, LCP and CLS are measured and what Google does with them, my Core Web Vitals guide covers it – the short version is that third parties are the single most common reason I see sites fail INP while passing everything else.
The waterfall picture makes the tax visible. Load your site in the browser’s Network tab and look at what happens after your own HTML, CSS and hero image: a long tail of requests to googletagmanager.com, connect.facebook.net, widget chat domains, doubleclick.net, each triggering more requests of its own. Scripts loading scripts loading scripts. Your beautifully optimised theme finished its work at second one; the tail keeps the phone’s CPU busy until second eight. That tail is what this post is about.
The census: finding out what actually loads
You cannot put a site on a diet without weighing it first, and most owners genuinely do not know what loads on their pages – tags accumulate over years, added by agencies, plugins and “just paste this snippet” emails. Two tools give you the full census, both free:
- Chrome DevTools. Open the site in an incognito window (so your ad blocker does not hide the problem), open DevTools, and use the Network tab with the “3rd-party requests” filter to see every external domain. Then run the Performance panel with CPU throttling set to 4x slowdown – that approximates a mid-range phone – and look at the main-thread flame chart. Long solid blocks labelled with third-party domains are your targets. The Coverage panel adds a humbling detail: it shows how much of each downloaded script actually ran. Chat widgets routinely ship over a megabyte of JavaScript of which less than a third executes.
- WebPageTest. Run a test on a “Moto G (or slower)” mobile profile, then open the request waterfall and the “Domains” breakdown. WebPageTest groups bytes and requests by origin, so you get a ranked list of who is costing you what. The filmstrip view shows the visual price: frames where the page is visible but frozen are usually third-party execution time.
Make a simple spreadsheet from the census: script name, domain, what it does, who asked for it, transferred size, and main-thread blocking time from the Performance panel. On a typical audit this list has 10-20 entries and at least three that nobody in the business can explain. Keep the spreadsheet – it becomes the audit document in the remove step, and the before/after evidence when you are done. Lighthouse (built into DevTools) adds a ready-made “Reduce the impact of third-party code” section that attributes blocking time per origin, which is a good sanity check on your manual numbers.
The usual heavyweights, ranked
Across a decade of audits the same culprits appear in roughly the same order. The numbers below are typical ranges I measure on real WordPress sites with mobile CPU throttling – your exact figures will differ, but the ranking rarely does:
| Script type | Typical transfer size | Typical main-thread blocking | Standard fix |
|---|---|---|---|
| Live chat widget | 500 KB – 2 MB | 300-900 ms | Facade: load on first click |
| YouTube/Vimeo embed | 500-800 KB per video | 200-500 ms | Click-to-play thumbnail facade |
| Tag manager + its tags | 100 KB – 1 MB total | 200-600+ ms | Prune tags, consider server-side |
| A/B testing tool | 100-300 KB | 100-400 ms + anti-flicker delay | Remove when no test is running |
| Google Maps embed | 400-600 KB | 100-300 ms | Static image, real map on click |
| Social/ad pixels (each) | 50-150 KB | 50-150 ms | Consent-gated, fire on interaction |
- Chat widgets are the worst offenders per install. They ship a full messaging application – React or similar framework, emoji sets, sound files, real-time connection code – to every visitor, when perhaps two percent will ever open the chat.
- Video embeds are the worst per instance. One default YouTube iframe pulls the whole player before anyone presses play; three testimonial videos on a page triple it.
- Tag managers are the worst multipliers. The container itself is moderate; the twelve tags inside it are the problem, which is why GTM gets its own section below.
- A/B tools are the sneakiest. Many load synchronously with an “anti-flicker” snippet that deliberately hides your page for up to a few seconds so visitors do not see the variant swap – a self-inflicted delay on every visit, including the months when no experiment is running.
- Pixels are the death by a thousand cuts. Each one looks cheap; sites commonly run four to eight (Meta, Google Ads, LinkedIn, TikTok, Pinterest, a heatmap tool), and they fire at the exact moment the visitor starts interacting.
- Review and social feed widgets sit at the lighter end but often load fonts and images from their own slow origins and cause layout shift where the badge pops in.

Google Tag Manager: the script mall
Google Tag Manager deserves its own section because it is on most business sites I audit and because it is misunderstood in both directions. GTM is not inherently slow – an empty container costs very little. But GTM is a shopping mall for scripts: it makes adding a tag so easy that nobody thinks about the cost, and containers grow the way a garage fills up. I regularly open containers with 30-60 tags, of which a third are paused-but-not-deleted, a third duplicate each other (two GA properties, an old Universal Analytics tag still firing into the void, the same conversion tracked three ways), and a third belong to campaigns that ended years ago.
The container audit is the highest-value hour in this whole post. Export the container, list every tag with its trigger, and ask the same question as in the remove step: who looks at this data? Delete what has no owner. Then check triggers – tags firing on “All Pages” that only need to fire on a thank-you page are pure waste. A container pruned from 40 tags to 12 routinely halves GTM’s measured blocking time without losing a single report anyone reads.
Consent mode interplay matters in Europe. Done properly, your consent management platform tells GTM what the visitor agreed to, and tags wait for that signal – which has a performance silver lining: denied tags never load. Done badly, tags fire before consent (a legal problem, covered in my GDPR compliance guide) or the consent platform itself becomes another blocking script. Test both states: what loads before the banner is answered, and what loads after “reject all”. On a compliant site, “reject all” should make your site faster – if it does not, tags are ignoring consent.
Server-side GTM, in plain language: instead of every tag running in the visitor’s browser, the browser sends one stream of events to a server container you run (typically on a cloud service for roughly EUR 10-40 per month), and that server forwards the data to Meta, Google and the rest. The visitor’s device does dramatically less work – often one script instead of ten. When is it worth it? For sites where advertising data genuinely drives revenue – stores spending real money on paid traffic – yes, the performance and data-quality gains justify the setup and running cost. For a brochure site with GA4 and one pixel, it is overkill; pruning the container and deferring wisely gets you most of the benefit for free.
The diet plan: remove, replace, defer, self-host
Every fix for a third-party script falls into one of four strategies, and the order is the point – each step down the list keeps more functionality but recovers less performance:
- Remove what nobody uses. Costs nothing, recovers everything, and applies to more scripts than any business likes to admit.
- Replace the heavyweights with lightweight stand-ins: facades that look identical and load the real thing only on interaction, or lighter tools that do the same job.
- Defer what must stay: load it after the page is interactive, or when the visitor shows intent. Full functionality, delayed cost – with measurable trade-offs for tracking.
- Self-host what you can: move assets from third-party origins onto your own domain so they follow your caching rules and skip the extra connections.
Work the list top to bottom for every script in your census spreadsheet. The discipline matters because the industry sells the strategies in reverse: “delay all scripts” is a checkbox in every optimisation plugin, so people defer forty scripts that should have been eight, and the cost comes back the moment the visitor touches the page. Deferring a script you should have removed is not optimisation – it is procrastination at 4x CPU throttling.

Remove: the quarterly “who uses this” audit
The cheapest millisecond is the one you stop spending. Once a quarter – book it in the calendar, thirty minutes – take the census spreadsheet and ask one question per row: who looked at this data in the last three months, and what decision did it change? Not “might we need it” – who, specifically, used it. If the answer is a name and a decision, the script stays. If the answer is silence, it goes.
The usual removals, from real audits:
- Dead pixels from ad platforms the business stopped using – the LinkedIn pixel from a hiring campaign two years back, a TikTok pixel from an experiment that never scaled.
- Duplicate analytics – GA4 plus a second analytics tool “we were trying out”, plus a heatmap tool recording every session that nobody has watched since the redesign.
- A/B testing scripts with no running test. The tool blocks rendering every day; the last experiment ended last year. Remove it and re-add it for the next test – it takes ten minutes.
- Widgets for retired features – the popup tool from an old lead magnet, a countdown script for a sale that ended, a social feed for an account nobody posts to.
- Plugin-injected scripts. WordPress plugins quietly add third parties too: sharing buttons loading their own trackers, a form plugin loading reCAPTCHA on every page instead of only pages with forms. Deactivate what you do not use; scope what you do.
Removal is also the one strategy with zero downside – no facade to design, no tracking accuracy debate, no maintenance. On an average first audit I remove a quarter to a third of all third-party requests this way, before touching any clever techniques.
Replace: facades for chat, video and maps
A facade is a lightweight fake that looks exactly like the real widget and loads the real thing only when the visitor interacts. It is the single best technique for the three heaviest script categories, because it matches cost to usage: the two percent who open the chat pay the chat’s price, the ninety-eight percent who do not, do not.
- Chat: render the familiar round chat button with plain HTML and CSS – a few hundred bytes. On first click, load the real widget script and open it. The visitor sees perhaps half a second of “connecting” the first time, which chat users find completely normal. Every major widget (Intercom, Tawk.to, Crisp, LiveChat, HubSpot) can be loaded this way from a small custom snippet, and several WordPress performance plugins ship the pattern ready-made.
- Video: show a thumbnail image with a play button; on click, swap in the real YouTube or Vimeo iframe and autoplay it. On WordPress this is nearly free – use a lightweight embed plugin or a small block, and use the video’s own poster frame so the page looks identical. Three videos on a page drop from roughly 1.5-2 MB of player code to three optimised images.
- Maps: a static image of the map (a screenshot works, or a static map image generated once), linked so a click opens the interactive map – either loading the embed in place or simply linking out to the map service, which is often what visitors wanted anyway: directions on their phone.
Facades carry a bonus for European sites: the click-to-load pattern is exactly the “two-click” consent solution privacy regulators like, because no data flows to the third party until the visitor actively chooses the feature. One technique, two problems solved. The other flavour of “replace” is swapping the tool itself for a lighter one – the clearest case is analytics, where privacy-focused alternatives weigh a few kilobytes against GA4’s much larger footprint; I compare the options in my GA4 and privacy-friendly analytics post.
Defer: delay until interaction, and the risks
Whatever survives removal and replacement still does not need to compete with your hero image. Deferring means loading third-party scripts after the page is usable – and it comes in grades:
- Standard
defer/async loading gets scripts out of the parser’s way but still executes them during load, so the main-thread cost remains. Necessary, not sufficient. - Delay-until-idle: load the script a few seconds after the page becomes interactive. Good for scripts that must run for every visitor eventually.
- Delay-until-interaction: load nothing until the visitor scrolls, taps or moves the mouse, with a timeout fallback (commonly 3-5 seconds) so passive visitors still get tracked. WP Rocket’s “Delay JavaScript execution”, Flying Scripts and Perfmatters all implement this, with keyword lists to choose which scripts to delay.
Delay-until-interaction produces spectacular lab scores because lab tests do not interact – the page loads almost nothing third-party at all. Be honest with yourself about what that means: your PageSpeed score improves more than your real INP does, because for real visitors the delayed scripts execute at the exact moment they first touch the page. It still helps genuinely – execution happens once, later, instead of in the critical loading window – but the gap between lab and field data is real, and I explain it to every client before they celebrate the score.
The bigger trade-off is tracking accuracy. Delay an analytics script and visitors who bounce in the first seconds are never counted – reported traffic drops (typically a few percent, more on high-bounce landing pages) even though real traffic did not change. Delay an ad pixel too aggressively and conversion attribution suffers, which quietly mis-trains automated bidding. My working rules: never delay the consent banner itself; keep revenue-critical conversion pixels on delay-until-idle rather than interaction; delay everything decorative as hard as you like; and after any change, compare a week of analytics and ad platform numbers against the previous week so the marketing team is deciding with open eyes rather than discovering a “traffic drop” that is actually a measurement change.
Self-host what you can
Some third-party cost is not the script’s work but its address. Every asset served from someone else’s origin pays connection overhead and follows their caching rules – moving it to your own domain removes both problems without changing functionality.
- Fonts first. Google Fonts served from Google’s servers means extra connections on every visit; downloading the WOFF2 files and serving them from your theme is faster, gives you proper cache headers and preloading, and removes a GDPR headache German courts have already ruled on. Every site I build self-hosts fonts by default.
- Analytics, where the tool allows it. Several analytics platforms let you proxy or self-host the tracking script so it loads from your domain. Some optimisation plugins can also cache the GA scripts locally. This trims connection overhead – though the execution cost stays the same, so it is a refinement, not a rescue.
- Static embeds. Review badges and social proof widgets often exist to show a number and some stars. Fetch the rating server-side on a schedule (or update it monthly by hand), render it as HTML in your theme, done – the “widget” becomes zero requests. The same applies to social feeds: a periodic import into WordPress beats a live embed for speed and for control.
Two honest caveats. Self-hosting means updates are your job – a proxied analytics script that never updates can drift behind the vendor’s version, so use a mechanism that refreshes automatically. And do not self-host scripts whose vendors change them constantly or whose terms forbid it – tag manager containers and most ad pixels belong in defer territory, not on your server. Self-hosting is the fourth strategy for a reason: it recovers the least, but on assets like fonts it is pure profit.
Measuring per-script cost and keeping tags under control
To prioritise – and to prove your work – you need blocking time attributed to each script, not just a total. Three ways, in increasing order of effort:
- Lighthouse’s “Reduce the impact of third-party code” lists each origin with its transfer size and main-thread blocking time. Free, instant, good enough for the first pass and for before/after comparisons.
- DevTools Performance panel, bottom-up view: record a page load with 4x CPU throttling, group activity by domain, and read the self-time per origin. This catches what Lighthouse averages away, like a script that is cheap on load but expensive on scroll.
- Block and re-test: the gold standard. WebPageTest can block a chosen domain, and DevTools has request blocking built in – measure the page with and without one script and the difference is that script’s true cost, including everything it loads in turn. When a marketing team insists their tool is “lightweight”, a with-and-without filmstrip settles the discussion in two minutes.
Then keep it clean with a governance rule, because every script diet fails without one – tags grow back like weeds. The rule that works is small enough to actually follow: one named person owns the tag inventory; every new script needs a stated owner, a stated purpose and a measured cost before it ships (block-and-compare, two minutes); anything above an agreed budget – I suggest 200 ms of added blocking time on the throttled mobile test – needs a trade-off conversation, not a silent paste into GTM; and the quarterly audit from the remove step is in the calendar. Agencies I work with put this in their maintenance contracts; it turns “the site got slow again” from an annual emergency into a non-event.
Before and after: what a script diet is worth
Generic but real numbers from recent projects, measured on throttled mobile profiles:
- A client’s store (Germany): 19 third-party scripts down to 8. Total blocking time 2,100 ms to 480 ms; INP in field data 460 ms to about 170 ms; mobile PageSpeed 54 to 88. The chat facade alone was worth around 600 ms.
- An agency’s brochure-site client (UK): no code changes at all – a GTM container pruned from 43 tags to 11 and an A/B tool removed between experiments took Lighthouse’s third-party blocking figure from roughly 1,200 ms to under 300 ms.
- A services site with three embedded videos: click-to-play facades cut page weight from 4.1 MB to 1.9 MB and LCP from 4.8 s to 2.6 s, because the player scripts had been competing with the hero image.
The pattern across all of them: third-party work is usually the largest single win available on an already-decent site, and it is invisible to visitors until you measure it – nothing looks different, everything feels different. The condensed checklist:
- Run the census: DevTools + WebPageTest, build the spreadsheet of every script, owner, size and blocking time.
- Remove everything without a named owner and a recent use; prune the GTM container; delete paused tags.
- Replace chat, video and maps with facades; consider lighter analytics.
- Defer the rest: interaction delay for decorative scripts, idle delay for revenue-critical pixels; never delay the consent banner.
- Self-host fonts; make static versions of badge and feed widgets.
- Verify: before/after Lighthouse third-party report, plus a week of analytics comparison for tracking accuracy.
- Install the governance rule and book the quarterly audit.
Third parties are one lever among several – server response, images, fonts, CSS and caching all still matter, and the full sequence lives in my complete WordPress speed guide. But if your own stack is already tidy and the site still fails Core Web Vitals, the tail of the waterfall is almost always where the answer is.
Want the script diet done for you?
My WordPress speed optimisation service includes exactly this work: the full third-party audit with per-script costs, facades for the heavyweights, a pruned tag setup that respects consent, and before/after Core Web Vitals evidence – at EUR 15 per hour or a fixed price quoted within 24 hours. See the portfolio for results on real sites, or send me your URL and I will reply within 24 hours with what I would remove first.
Frequently asked questions
What are third-party scripts and why do they slow down a website?
Third-party scripts are JavaScript loaded from external services – tag managers, chat widgets, analytics, pixels, embeds. They slow sites through extra network connections, large downloads and, above all, main-thread execution time that blocks the page from responding to taps and clicks.
Which third-party scripts are the heaviest?
Per install, live chat widgets and default video embeds are usually the worst – often 500 KB to 2 MB each. Tag manager containers are the biggest multipliers because of the tags inside them, and A/B testing tools are costly because many deliberately delay rendering.
Does Google Tag Manager slow down a WordPress site?
An empty container barely does; a bloated one absolutely does. The cost comes from the tags inside it. Pruning unused and duplicate tags, tightening triggers and respecting consent mode typically halves GTM’s blocking time without losing useful data.
What is a facade, and is it safe to use for chat and video?
A facade is a lightweight lookalike (a chat button, a video thumbnail) that loads the real widget only on click. Visitors who use the feature wait a moment on first interaction; everyone else saves the full cost. It is safe, widely used and doubles as a two-click GDPR consent pattern.
Will delaying scripts hurt my analytics or ad tracking?
It can. Delay-until-interaction misses visitors who bounce before interacting, so reported traffic drops slightly, and aggressive delays can weaken ad attribution. Keep conversion pixels on a gentler idle delay, never delay the consent banner, and compare a week of numbers after any change.
Is server-side Google Tag Manager worth it?
For stores and sites with serious paid-traffic budgets, usually yes – one server stream replaces many browser scripts and improves data quality, for roughly EUR 10-40 per month in hosting. For a brochure site with basic analytics, container pruning and deferral achieve most of the benefit for free.
How many third-party scripts should a website have?
There is no magic number, but every script needs a named owner and a measured cost. Most business sites run comfortably on five to eight third parties after an audit; if you cannot say who uses a script’s data, the right number of copies of it is zero.