Imagine if your WordPress site could read visitors’ minds, loading pages before they even click. That’s essentially what WordPress 6.8‘s fresh speculative loading feature will accomplish. By anticipating user behaviour and beginning the page load process early, this innovation delivers what once seemed impossible: near-instant page transitions that make your site feel lightning-fast.
Let’s explore the inner workings of this breakthrough technology and discover why it’s a must-have upgrade for WordPress site owners who care about user experience.
What is Speculative Loading?
Speculative loading is a performance enhancement technique that allows WordPress to begin loading URLs before a user clicks on them. This feature leverages the Speculation Rules API, a web platform capability that lets developers define rules for which URLs to prefetch or prerender and how early this speculative loading should occur. The concept is simple but powerful: by anticipating where a user might navigate next and beginning the loading process in advance, pages appear to load almost instantly when the user does click a link.
Real-World Performance Improvements
This isn’t just theoretical. Before being implemented in WordPress Core, the feature was successfully tested on over 50,000 WordPress sites via a feature plugin. According to data from HTTP Archive and Chrome User Experience Report (CrUX):
– Sites that enabled speculative loading improved their Largest Contentful Paint (LCP) passing rate by approximately 1.9% at the median
– While 1.9% might seem small, it represents a significant boost for a single feature, especially considering the diverse range of sites with various performance characteristics
Today, over 8% of Chrome navigations rely on Speculation Rules, showing the growing adoption of this technology.
Browser Support and Progressive Enhancement
The Speculation Rules API is currently supported by Chrome, Edge, and Opera, which means that most web users can benefit from its capabilities. There are no adverse effects for users on browsers without support for the API since the feature works as a progressive enhancement. Browsers without support simply ignore its presence, maintaining the same behaviour as before.
How WordPress Implements Speculative Loading
WordPress 6.8 enables speculative loading by default in the front end of all sites, with two exceptions:
- When a user is logged in
- When a site has pretty permalinks disabled
The default configuration uses prefetching with “conservative eagerness.” This means prefetching is triggered when a user starts to click on a link—just a fraction of a second before the actual navigation occurs, but enough to deliver a noticeable performance improvement.
Customization Options
WordPress developers have several ways to customize speculative loading behaviour:
1) Excluding URL Patterns
Some URLs shouldn’t be prefetched or prerendered, especially those that might trigger state changes (like adding items to a shopping cart). By default, any URLs with query parameters are automatically excluded. Developers can use the wp_speculation_rules_href_exclude_paths filter to exclude additional URL patterns.
2) Modifying Default Configuration
Site owners can modify the default configuration through the wp_speculation_rules_configuration filter. Options include:
– Mode: auto (default), prefetch, or pretender
– Eagerness: auto (default), conservative, moderate, or eager
For even greater performance, you could opt for prerender with moderate eagerness, similar to what the Speculative Loading feature plugin implements—though this requires careful consideration of potential effects on client-side JavaScript.
UI Customization
WordPress Core has built-in support for CSS classes no-prefetch and no-pre-render. These can be added to any block via the “Additional CSS class(es)” field in the “Advanced” panel, allowing for granular control over which links should be excluded from speculative loading.
Why Speculative Loading Matters
The impact of speculative loading extends far beyond technical specifications. The dramatic reduction in perceived loading times translates directly to improved user engagement and satisfaction. Site owners struggling with Core Web Vitals will appreciate how speculative loading helps improve crucial metrics like Largest Contentful Paint. Additionally, what makes this feature particularly elegant is its implementation as a progressive enhancement. Browsers without support simply maintain their normal behaviour, ensuring no adverse effects for any visitors.
This feature represents a significant performance win for WordPress and the web overall. With careful fine-tuning based on your site’s specific needs, you can achieve even greater performance improvements beyond the default configuration.
WordPress 6.8: A Broader Focus on Refinement and Performance
Speculative loading is just one piece of WordPress 6.8’s comprehensive focus on performance and refinement. Scheduled for release in April 2025, this update aims to strengthen the core WordPress experience rather than introducing numerous new features. Beyond speculative loading, WordPress 6.8 brings:
– Design Refinements: Integration of style book features for compatible classic themes, improved font family selection with visual previews, and a new button for resetting colour controls.
– Enhanced Query Capabilities: Year-based filtering options and improved block spacing controls give users greater flexibility in content organization
– Streamlined Content Management: Data Views features now include combined field layouts and a new template field in quick edit mode, making it easier to handle complex data structures.
– Improved Starter Content Experience: A more consistent editing experience with the Block Inserter panel replacing the previous modal system.
– Core Performance Optimizations: Improvements to cache key generation in the WP_Query class to reduce database load, which is especially beneficial for high-traffic sites.
– Enhanced Security: New warning systems alert administrators about potentially dangerous configurations before security vulnerabilities can occur.
– Accessibility Improvements: An accessible tooltip system using semantic HTML and ARIA attributes, plus prefixed admin notices that don’t rely solely on colour coding.
– Educational Integration: Learn WordPress resources integrated directly into the dashboard through the “WordPress Events and News” widget.
Ready to Optimize Your WordPress Site?
At Trew Knowledge, we specialize in helping businesses maximize their WordPress investment through expert optimization, customization, and support. Our team stays at the cutting edge of WordPress development to ensure your site takes full advantage of performance enhancements like speculative loading.
Contact our WordPress experts today for a consultation and discover how we can transform your digital presence with the power of WordPress and beyond.