You click a link and the next page is simply there. No white screen, no waiting. More often than not, that is not a faster server at work but a browser that thought ahead. That is Speculative Loading in a nutshell: the browser guesses which page you will open next and starts loading it early. If it guesses right, the page change feels instant. If it guesses wrong, it has fetched a few kilobytes for nothing. Since WordPress 6.8 this technique is built right into WordPress, and many site owners have no idea their site already uses it. Here you will learn how it works, what WordPress sets up by default and when it is worth adjusting.
What is Speculative Loading? A simple explanation
Speculative Loading is the umbrella term for techniques that let a browser request pages before anyone actually opens them. Speculative, because nobody knows for sure whether the visitor will really click the link. The browser is placing a bet.
Picture the barista at your regular coffee shop. They see you walk through the door and start your cappuccino before you have ordered. Most of the time they are right and you get your coffee without waiting. On the rare day you order tea, one cappuccino goes to waste. Speculative Loading works in much the same way.
The idea is not new. Years ago, <link rel="prefetch"> and <link rel="prerender"> already let websites recommend pages for the browser to load in advance, and libraries such as instant.page or Quicklink added the same thing with JavaScript. None of it was truly reliable. Chrome even replaced the old rel="prerender" long ago with a slimmed down variant that no longer renders anything. So when people talk about Speculative Loading today, they almost always mean the Speculation Rules API that Google introduced in Chrome.
Why go to all this trouble? Because load time feeds directly into the Core Web Vitals. If a page is fully prepared in the background, the Largest Contentful Paint (LCP) the visitor experiences is practically zero. It does not get any faster than that.
How does the Speculation Rules API work?
The website hands the browser a few rules. They are written as JSON inside a block of type speculationrules. A simple rule looks like this:
<script type="speculationrules">
{
"prerender": [
{
"where": { "href_matches": "/*" },
"eagerness": "moderate"
}
]
}
</script>In plain words: every link on this site may be prerendered as soon as the visitor shows interest, for example by resting the mouse on the link for a moment. Rules like this, which refer to the links in the document, are called document rules. There are also list rules, where you give the browser a fixed list of URLs, such as the next page of an article series.
Two things make the API pleasantly uncomplicated. First, the browser has the final say on whether it follows a rule. If the battery is almost empty or memory is tight, it simply skips it. Second, browsers that do not know the API just ignore the block. Nothing can break. Instead of placing them in the HTML, you can also deliver the rules through a header in the server response (Speculation-Rules), which is mostly what CDNs do.
Prefetch vs. prerender: what is the difference?
The Speculation Rules API has two modes, and the difference between them is bigger than the names suggest.
With prefetch, the browser fetches only the bare HTML of the target page and keeps it on hand for a short while. Images, stylesheets and scripts are left out, and nothing is executed. When the visitor clicks, they skip the wait for the server, which is essentially the Time to First Byte. Everything else loads as usual. Prefetch is cheap and has hardly any side effects.
With prerender, the browser goes all in. It loads the complete page including images, CSS and JavaScript in an invisible tab and renders it fully. On click it simply swaps the visible page. For the visitor it feels as if the page had been there all along. The price: more data, more processing power, and JavaScript runs even though the visitor may never see the page. For security reasons, prerender only works for pages on the same domain by default.
As a rule of thumb: prefetch is the safe default, prerender is the turbo for pages that are very likely to be opened next.
Do not confuse either of them with preload and preconnect. Those hints speed up files of the current page, such as fonts or the largest image. You can learn how to use them properly in our article on using preload and preconnect for fonts and assets in WordPress.
When does the browser load ahead? The four eagerness levels explained
With eagerness you decide how early the browser may start. The earlier, the more time it saves, but the more often it guesses wrong.
- immediate: right away, as soon as the browser reads the rule. Only sensible for a handful of URLs you are very sure about.
- eager: almost as early. Chrome has refined the behavior in recent versions, so this level now sits between immediate and moderate.
- moderate: on desktop, speculation starts when the pointer rests on a link for about 200 milliseconds, or earlier when the mouse button goes down. On smartphones, where there is no hover, Chrome relies on other signals such as the tap.
- conservative: only when the visitor actually clicks, or more precisely, the moment the mouse button or finger goes down. Only a fraction of a second passes before the click completes. The head start is small, but almost no speculation is wasted.
Chrome also makes sure nobody overdoes it. For moderate and conservative, the browser keeps at most two speculations at a time and drops the oldest one as soon as a new one comes in. For immediate and eager, up to 50 prefetches and 10 prerenders are allowed. In energy saver mode, with data saver turned on, when memory is low or when the user has switched off page preloading in the settings, Chrome does not speculate at all. Google describes the details in its documentation for Chrome.
Speculative Loading in WordPress: what happens automatically since version 6.8
The WordPress Performance Team first tested the feature as a standalone plugin called Speculative Loading. It ran on more than 50,000 sites, and according to data from the HTTP Archive and the Chrome UX Report, the LCP passing rate of those sites improved by about 1.9 percent at the median. That sounds small, but for a feature that requires zero work it is a solid gain. With WordPress 6.8 in April 2025, the whole thing moved into core. The default configuration is deliberately cautious:
- Mode prefetch, eagerness conservative. So only the HTML is loaded, and only once a click has already started.
- Only for logged out visitors. Logged in users see the toolbar and often personal content. Such pages never end up in a cache and would be expensive to load in advance.
- Only with pretty permalinks. If Settings › Permalinks is still set to Plain, the feature stays off.
- No URLs with query parameters. Anything with a question mark in the address is excluded, such as search results or a link like
?add-to-cart=123in an online store. The admin area, the login page and links withrel="nofollow"are off limits as well. - Exceptions via class. Links with the class
no-prefetch, or links inside a block with that class, are never loaded in advance. The classno-prerenderonly excludes prerendering.
Why so careful? The plugin defaulted to prerender with moderate eagerness and got more speed out of it. But with millions of sites running countless combinations of themes and plugins, the team considered the risk too high that JavaScript would run on pages nobody ever visits. That is also how the team explains it in the official announcement. If you want more, you can still install the Speculative Loading plugin. It adds a settings section under Settings › Reading where you can change mode and eagerness without code and, if you like, enable the feature for logged in users too.
How to customize or disable Speculative Loading in WordPress
Without the plugin, you use filters. The following snippets belong in the functions.php of your child theme or, even better, in a small custom plugin so they survive a theme switch.
Use prerender instead of prefetch:
add_filter( 'wp_speculation_rules_configuration', function ( $config ) {
if ( is_array( $config ) ) {
$config['mode'] = 'prerender';
$config['eagerness'] = 'moderate';
}
return $config;
} );The is_array() check matters. For logged in users and sites without pretty permalinks, WordPress passes null here, and thanks to the check the feature stays off in those cases.
Exclude specific sections:
add_filter( 'wp_speculation_rules_href_exclude_paths', function ( $paths, $mode ) {
$paths[] = '/go/*';
if ( 'prerender' === $mode ) {
$paths[] = '/cart/*';
}
return $paths;
}, 10, 2 );Typical candidates are redirects for affiliate links that count a click when opened, a shopping cart, or pages whose content changes all the time. You specify the paths relative to the home page, and WordPress adds a subdirectory on its own. The second parameter lets you exclude paths for one mode only, in this example the cart for prerendering only.
Exclude individual links: Give the link or the surrounding block the class no-prefetch. In the block editor you can do this under Advanced in the field for additional classes, no code required.
Disable Speculative Loading completely:
add_filter( 'wp_speculation_rules_configuration', '__return_null' );You should only switch the feature off entirely if you have a concrete reason. With the default settings it costs next to nothing.
What are the downsides of Speculative Loading?
The speed gain is not entirely free. These are the points you should know about:
More load on the server. Every speculation is a real request. If a page cache serves the finished page, the server barely notices. Without a cache, every prefetch starts PHP and database queries as if a real visitor had arrived. On tightly sized shared hosting, an aggressive setting such as immediate or eager can therefore become noticeable. The same applies on a smaller scale to visitors with a limited data plan.
Links that trigger something. In theory, a simple link should never change anything. In practice, some do anyway: logout links, affiliate click counters, one click ratings or a quick "Add to cart". By excluding all URLs with query parameters, WordPress catches many of these cases, but not pretty addresses like /go/partner/. You should exclude those explicitly.
Skewed statistics. Prefetch does not run any JavaScript, so analytics tools like Matomo or Google Analytics never notice it. Statistics built from the server log files, such as those in the control panel of many hosting providers, may count the requests as visits, though. With prerender, JavaScript really runs. Google Analytics and Google Publisher Tag wait on their own until the page is actually shown. Tools that do not do this count visits that never happened. For your own scripts there is a simple check:
if (document.prerendering) {
document.addEventListener('prerenderingchange', startTracking, { once: true });
} else {
startTracking();
}On the server you can recognize speculative requests by the Sec-Purpose header, which carries the value prefetch or prefetch;prerender.
Content can be slightly out of date. Chrome keeps preloaded pages for a few minutes. With conservative this does not matter, because the click follows immediately. With earlier levels, a page with fast changing content, such as a live ticker, may already be a few minutes old when it opens.
Which browsers support Speculative Loading?
Chrome fully supports the Speculation Rules API, as do Edge, Opera and other browsers built on Chromium. Safari is working on its own implementation, but in recent versions it is still hidden behind a developer flag. Firefox does not support the API yet.
That sounds like a gap, but in practice it is not a problem. Because browsers ignore rules they do not understand, everyone using Chrome benefits and nothing changes for the rest. For most websites, Chrome is by far the biggest share of traffic anyway. As early as the beginning of 2025, before the launch in WordPress, more than 8 percent of all page navigations in Chrome already relied on Speculation Rules, according to the WordPress Performance Team.
How do I check whether Speculative Loading is active on my site?
Three quick ways:
- Look at the source code. Open your site in a private window so you are not logged in and search the page source for
speculationrules. WordPress places the rules in the footer. - Use Chrome DevTools. In the Application tab, you will find the Speculative loads section under Background services. It shows the active rules, which URLs were loaded in advance and why a speculation did not work out.
- Check the headers. If a CDN adds its own rules, for example Cloudflare with its Speed Brain feature, they are not in the HTML but in the
Speculation-Rulesheader of the response. In that case, two sets of rules may be running side by side. That does no harm, but you should know about it before you change a setting in one place and wonder why nothing happens.
How InspectWP helps you keep an eye on load time and resource hints
The InspectWP report first shows you which version of WordPress your site is running. From 6.8 on, that tells you Speculative Loading is active by default for logged out visitors, provided pretty permalinks are enabled. In the HTML section, the report also lists the classic resource hints, meaning prefetch, DNS prefetch, preconnect and prerender, and flags entries that appear more than once in the source code. That often points to plugins getting in each other's way. If an old rel="prerender" still shows up there, it is a good reason to switch to the Speculation Rules API. Since preloaded pages cost far less with a cache, it is also worth looking at the detected caching plugins and the headers of the server response. A free report quickly shows you where your site stands.