Preconnect DNS Prefetch WordPress - Speed Up Connections to Other Domains (2026)
Every external domain your page uses, such as a font service, CDN or analytics provider, needs a connection before anything downloads. Resource hints let the browser start that work early.
What Happens When a Browser Connects
Before downloading a file from a new domain, the browser has to:
- Look up the domain's address (DNS).
- Open a connection.
- Set up encryption for HTTPS.
On mobile networks, this can take a noticeable fraction of a second per domain. If a critical file sits on another domain, that delay lands right on your loading time.
Preconnect vs DNS Prefetch
| Hint | What It Does | Cost | Use For |
|---|---|---|---|
| dns-prefetch | Resolves the domain name early | Very low | Domains used later in the page |
| preconnect | Resolves, connects and sets up encryption early | Higher; connections may close if unused | Critical domains needed in the first seconds |
| preload | Downloads a specific file early | Uses bandwidth | Specific late-discovered critical files |
Preconnect does more work up front, so it's best kept for a small number of domains. Browsers may close unused preconnected connections after a short time, wasting the effort.
Which Domains to Consider
| Domain Type | Preconnect? | Better Option |
|---|---|---|
| Google Fonts | If not self-hosted | Self-host the fonts |
| CDN serving your images | Yes, if it serves above-the-fold images | Same-domain CDN or DNS-level CDN |
| Analytics | Usually no | Delay analytics scripts |
| Ad networks | Sometimes, if ads are above the fold | Limit ad density |
| Video embeds | No | Use preview images |
| Chat widgets | No | Delay until interaction |
How WP Rocket Handles Resource Hints
WP Rocket adds preconnect hints to external domains automatically, as one of its built-in optimizations. Older versions had a separate DNS prefetch setting where you listed domains by hand; current versions no longer show that setting, because preconnect is handled automatically.
You don't need to configure anything for most sites. If you've added resource hints through your theme or another plugin, check for duplicates.
How to Check Resource Hints
View the page source
Look in the head for link tags with rel="preconnect" or rel="dns-prefetch".
Check the Network dependency tree
Lighthouse 13 shows chains of requests and suggests origins to preconnect.
Look at the waterfall
In WebPageTest or GTmetrix, connection setup for preconnected domains should happen early.
Watch the console
Chrome warns about preconnected origins that weren't used.
A Worked Example
A business site loads Google Fonts from Google's servers, a booking widget from a third-party domain and analytics. The network dependency tree shows the font stylesheet waiting on a new connection before text can render.
The owner enables WP Rocket's Self-host Google Fonts option, which removes both Google font domains entirely. The booking widget only appears on the booking page and is delayed until interaction elsewhere, so it doesn't need a hint. Analytics is delayed too. With fewer external domains in the first seconds, there's little left to preconnect to, and FCP improves on mobile.
Resource Hints and HTTP/3
Modern protocols reduce the cost of new connections, but they don't eliminate it: each new domain still needs a lookup and a secure connection. Resource hints remain useful for the few domains you can't avoid early on, even on fast networks.
Adding Resource Hints Manually
If you need a hint WP Rocket doesn't add, for example for a specific font CDN, you can add it in your theme. Developers typically use WordPress's resource hints filter or add a link tag in the head. Keep it to one or two critical domains.
| Situation | Hint |
|---|---|
| Fonts from a third-party font CDN, used above the fold | Preconnect |
| Image CDN serving the hero image | Preconnect |
| Analytics loaded after interaction | None, or DNS prefetch |
| Social embeds lower on the page | None; use facades |
| Many ad domains | Reduce domains; avoid preconnecting to all of them |
How Many Is Too Many?
Each preconnect opens a connection that competes with your own domain for attention early in the load. A common rule of thumb is to preconnect to no more than a few domains. If you find yourself listing many, that's a sign the page depends on too many external services.
Fewer Domains Beats More Hints
Resource hints soften the cost of external domains; removing those domains eliminates it. Self-host fonts, serve images from your own domain or a DNS-level CDN, and delay third-party scripts. See reducing third-party code.
Preconnect DNS Prefetch WordPress FAQ
What's the difference between preconnect and DNS prefetch?
DNS prefetch only resolves the domain name. Preconnect also opens the connection and sets up encryption, which saves more time but costs more.
How many domains should I preconnect to?
Usually only one or two critical domains needed in the first seconds.
Does WP Rocket still have a DNS prefetch setting?
No. Current versions add preconnect hints to external domains automatically.
Are resource hints still useful if I self-host fonts?
Less so. Self-hosting removes the need to connect to font domains.