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:

  1. Look up the domain's address (DNS).
  2. Open a connection.
  3. 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

Illustration for Preconnect vs DNS Prefetch on the Preconnect DNS Prefetch WordPress page, showing a compare diagram
Resource hints compared
HintWhat It DoesCostUse For
dns-prefetchResolves the domain name earlyVery lowDomains used later in the page
preconnectResolves, connects and sets up encryption earlyHigher; connections may close if unusedCritical domains needed in the first seconds
preloadDownloads a specific file earlyUses bandwidthSpecific 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

Common external domains on WordPress sites
Domain TypePreconnect?Better Option
Google FontsIf not self-hostedSelf-host the fonts
CDN serving your imagesYes, if it serves above-the-fold imagesSame-domain CDN or DNS-level CDN
AnalyticsUsually noDelay analytics scripts
Ad networksSometimes, if ads are above the foldLimit ad density
Video embedsNoUse preview images
Chat widgetsNoDelay 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

Illustration for How to Check Resource Hints on the Preconnect DNS Prefetch WordPress page, showing a globe diagram
  1. View the page source

    Look in the head for link tags with rel="preconnect" or rel="dns-prefetch".

  2. Check the Network dependency tree

    Lighthouse 13 shows chains of requests and suggests origins to preconnect.

  3. Look at the waterfall

    In WebPageTest or GTmetrix, connection setup for preconnected domains should happen early.

  4. 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

Illustration for Adding Resource Hints Manually on the Preconnect DNS Prefetch WordPress page, showing a globe diagram

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.

Example decisions
SituationHint
Fonts from a third-party font CDN, used above the foldPreconnect
Image CDN serving the hero imagePreconnect
Analytics loaded after interactionNone, or DNS prefetch
Social embeds lower on the pageNone; use facades
Many ad domainsReduce 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.