Speculative loading lets a browser prepare a likely next page before the visitor finishes navigating to it. WordPress added this feature to core in version 6.8 using the browser Speculation Rules API. WordPress 7.1 kept the feature and added more control over the default mode and eagerness.
The feature can make navigation feel much faster, but it needs safe rules. A site should not prerender a logout link, a destructive action, a cart-changing URL, or a page whose JavaScript causes side effects merely because it was loaded in the background.
Prefetch and prerender are different
Prefetch prepares a future navigation by fetching the document so it may be available sooner. Prerender goes further by loading and rendering the page in a hidden state so the browser can switch to it quickly if the user navigates there.
Prerender can produce a larger speed gain, but it also does more work. It can execute page JavaScript and create network traffic for a navigation that never happens. That is why conservative defaults matter.
What WordPress enables by default
WordPress core uses speculative loading for logged-out visitors when pretty permalinks are enabled. Logged-in users are excluded by default. Sites without pretty permalinks are also excluded by default because safe URL matching is harder when important routing depends on query parameters.
In WordPress 7.1, the core default still resolves to prefetch with conservative eagerness. Conservative eagerness means the browser starts speculative work very late in the user’s intent, such as when a link is being activated. This limits wasted requests.
Earlier 7.1 planning discussed more aggressive defaults for well-cached sites, but the final core code retains the conservative prefetch default. WordPress 7.1 instead added ways for hosting providers to override the default mode and eagerness through constants or environment variables.
Why the feature can still help
A fraction of a second matters when the browser can begin fetching the next HTML document before the normal navigation request would start. The benefit can be larger when the destination has a good page cache and the browser can fetch it quickly.
WordPress reported performance gains during the feature’s earlier testing and rollout. The effect varies by site, browser support, navigation pattern, cache state, and server response.
Speculative loading is not a cure for a slow origin. If a prefetched page still takes a long time to generate, fix WordPress TTFB and caching first.
Page caching makes speculation safer for the server
Speculative requests are extra requests. If every guessed navigation must run full PHP and database work, aggressive settings can add origin load. A good page cache can serve likely next pages cheaply.
That is one reason speculation should be considered together with WordPress page caching. Fast cached HTML gives the browser something useful to prepare without asking PHP to rebuild each candidate page.
Object cache is not the same as page cache
A persistent object cache such as Redis can reduce repeated database work, but WordPress still runs PHP to build the page. Full-page cache can skip much more application work for eligible public pages.
If you are evaluating a more aggressive speculation policy, understand which layers are actually active. The WordPress caching guide separates page, browser, object, opcode, and CDN caching.
Do not speculate destructive or state-changing URLs
A background navigation must not cause a business action just because the browser considered the link likely. Logout links, delete actions, cart mutations, unsubscribe actions, and other state changes should already be designed safely, but speculation makes correct HTTP behavior even more important.
WordPress core builds exclusions into its rules. Plugins and custom code that change speculation behavior need the same care. Never add a broad “prerender every internal link” rule without reviewing account, admin, cart, search, query-string, and action URLs.
Analytics can see prerendered pages differently
Prerendered pages may run JavaScript before the visitor actually sees them. Analytics and advertising code needs to understand page visibility and activation so it does not count an unseen prerender as a normal view.
Modern browser APIs expose prerender state, but every third-party script may not handle it perfectly. If you enable more aggressive prerendering, verify pageview counts, conversion events, session behavior, and consent handling.
Our third-party JavaScript guide explains why outside scripts need testing as part of performance work.
Check forms and personalized content
A public content site with simple internal links is an easier fit than a site with personalized prices, account data, one-time tokens, or complex form state. Speculation should not expose private content or make one user’s cached state appear to another user.
WordPress disables its default rules for logged-in users, which reduces many account-related risks. Ecommerce and membership plugins may add their own exclusions. Test the real application paths before overriding core defaults.
WordPress 7.1 adds host-level default control
WordPress 7.1 introduced WP_SPECULATIVE_LOADING_DEFAULT_MODE and WP_SPECULATIVE_LOADING_DEFAULT_EAGERNESS as constants or environment-variable overrides for the defaults that auto resolves to.
This is useful for hosting providers that know their infrastructure and caching stack. A host can choose a different default without forcing a plugin to filter every site. Explicit plugin configuration can still take precedence.
Site owners normally do not need to set these values just because they exist. Core’s conservative default is a safe place to start.
Plugins can change the configuration
Developers can use the wp_speculation_rules_configuration filter to change the mode or eagerness, or disable speculative loading. Valid document-level choices include prefetch or prerender and eagerness values such as conservative, moderate, or eager. WordPress does not allow the most aggressive immediate behavior for its document-level rules.
Any change should be tested against the site’s navigation and server load. A more aggressive setting can be faster for successful navigations while wasting more bandwidth on links the visitor never opens.
How to test speculative loading
Use a supporting browser and DevTools. Visit a public page while logged out, inspect the page’s speculation rules, and watch the Network panel while you approach or activate internal links.
Compare navigation timing with and without the feature. Also watch origin request count, cache hit rate, analytics, cart behavior, and any scripts that run on page load. One near-instant navigation is not enough evidence if the setting doubles unnecessary server work.
Test from a realistic connection. The gain may be more visible when network latency is meaningful.
Do not combine several speculation systems blindly
A CDN, performance plugin, theme, or browser hint library may already prefetch links. Adding WordPress speculation on top can create duplicate or conflicting behavior.
Inspect the final page. Choose one clear system for navigation speculation where possible. This is the same principle used throughout the main speed guide: overlapping optimization tools are harder to reason about than one measured strategy.
When to keep the default
Keep WordPress’s default behavior when the site has normal public navigation, the server is stable, and you have no measured reason to be more aggressive. Conservative prefetch offers a low-risk improvement without turning every hover into a full hidden page load.
Move toward moderate or prerender behavior only when you understand the site’s cache, dynamic URLs, JavaScript, analytics, and server capacity. Fast navigation is valuable, but not when it creates wrong actions or needless load.
A safe review checklist
- Confirm the site is on a current WordPress release.
- Verify page caching and normal server response are healthy.
- Inspect core speculation rules while logged out.
- List account, cart, action, and query-string URLs that must not be speculated.
- Check analytics and third-party scripts under prerender if you change modes.
- Measure origin request count and cache hits.
- Change one setting at a time and keep a rollback path.
If navigation still feels slow with healthy speculation, investigate the destination page itself with the WordPress speed testing guide. Speculation can hide some waiting, but it should not become a reason to leave slow pages unfixed.
Browser support still matters
Speculation Rules are a progressive enhancement. Browsers that do not support the API should still follow normal links. Do not build navigation that depends on speculation to work correctly. The page must remain complete and usable when no prefetch or prerender occurs.
That fallback is part of safe progressive enhancement.
Sources and further reading
- WordPress speculative loading introduction
- WordPress speculation configuration
- WordPress default speculation configuration
- Chrome prerender guidance
- MDN Speculation Rules API
- WordPress 7.1 roadmap