Speculative Loading
Enables browsers to speculatively prerender or prefetch pages to achieve near-instant loads based on user interaction.
Next Milestone 80K
Unlock Exact Install Count
See the precise estimated active installs for this plugin, calculated from real-time ranking data.
- Exact install estimates within tiers
- Track install growth over time
- Milestone progress predictions
Rank Changes
Downloads Growth
Upgrade to Pro
Unlock 30-day, 90-day, and yearly download history charts with a Pro subscription.
Upgrade NowReviews & Ratings
Tracked Keywords
Showing 5 of 5| Keyword | Position | Change | Type | Updated |
|---|---|---|---|---|
| prerender | 1 | — | Tag | 1 month ago |
| speculation rules | 1 | — | Tag | 1 month ago |
| prefetch | 2 | — | Tag | 1 month ago |
| javascript | 3 | — | Tag | 1 month ago |
| performance | 10 | — | Tag | 1 month ago |
Unlock Keyword Analytics
Track keyword rankings, search positions, and discover new ranking opportunities with a Pro subscription.
- Full keyword position tracking
- Historical ranking data
- Competitor keyword analysis
Support Threads Overview
Track This Plugin
Get detailed analytics, keyword tracking, and position alerts delivered to your inbox.
Start Tracking FreePlugin Details
- Version
- 1.6.0
- Last Updated
- Dec 03, 2025
- Requires WP
- 6.6+
- Tested Up To
- 6.9
- PHP Version
- 7.2 or higher
- Author
- WordPress Performance Team
Support & Rating
- Rating
- ★ ★ ★ ★ ★ 5
- Reviews
- 18
- Support Threads
- 1
- Resolved
- 100%
Keywords
Upgrade to Pro
Unlock keyword rankings, search positions, and detailed analytics with a Pro subscription.
Upgrade NowSimilar Plugins
Frequently Asked Questions
Common questions about Speculative Loading
<?php
add_filter(
'plsr_speculation_rules_href_exclude_paths',
function ( array $exclude_paths ): array {
$exclude_paths[] = '/cart/*';
return $exclude_paths;
}
);
Keep in mind that sometimes it may be useful to exclude a URL from prerendering while still allowing it to be prefetched. For example, a page with client-side JavaScript to update user state should probably not be prerendered, but it would be reasonable to prefetch.
For this purpose, the plsr_speculation_rules_href_exclude_paths filter receives the current mode (either "prefetch" or "prerender") to provide conditional exclusions.
The following example ensures that URLs like https://example.com/products/... cannot be prerendered, while still allowing them to be prefetched:
<?php
add_filter(
'plsr_speculation_rules_href_exclude_paths',
function ( array $exclude_paths, string $mode ): array {
if ( 'prerender' === $mode ) {
$exclude_paths[] = '/products/*';
}
return $exclude_paths;
},
10,
2
);
As mentioned above, adding the no-prerender CSS class to a link will prevent it from being prerendered (but not prefetched). Additionally, links with rel=nofollow will neither be prefetched nor prerendered because some plugins add this to non-idempotent links (e.g. add to cart); such links ideally should rather be buttons which trigger a POST request or at least they should use wp_nonce_url().
Are there any special considerations for speculative loading behavior?
For safety reasons, the entire speculative loading feature is disabled by default for logged-in users and for sites that do not use pretty permalinks. The latter is the case because plugins often use URLs with custom query parameters to let users perform actions, and such URLs should not be speculatively loaded. For sites without pretty permalinks, it is impossible or at least extremely complex to differentiate between which query parameters are Core defaults and which query parameters are custom.
If you are running this plugin on a site without pretty permalinks and are confident that there are no custom query parameters in use that can cause state changes, you can opt in to enabling speculative loading via the plsr_enabled_without_pretty_permalinks filter:
<?php
add_filter( 'plsr_enabled_without_pretty_permalinks', '__return_true' );
Speculating with the default moderate eagerness decreases the risk that the prerendered page will not be visited by the user and therefore will avoid any side effects of loading such a link in advance. In contrast, eager speculation increases the risk that prerendered pages may not be loaded. Alternatively, the plugin offers to only speculate on mouse/pointer down (conservative) which reduces the risk even further and is an option for sites which are concerned about this, at the cost of having less of a lead time and so less of a performance gain.
A prerendered page is linked to the page that prerenders it, so personalisation may already be known by this point and changes (e.g. browsing other products, or logging in/out) often require a new page load, and hence a new prerender, which will then take these into account. But it definitely is something to be aware of and test! Prerendered pages can be canceled by removing the speculation rules <script> element from the page using standard JavaScript DOM APIs should this be needed when state changes without a new page load.
Where can I submit my plugin feedback?
Feedback is encouraged and much appreciated, especially since this plugin may contain future WordPress core features. If you have suggestions or requests for new features, you can submit them as an issue in the WordPress Performance Team's GitHub repository. If you need help with troubleshooting or have a question about the plugin, please create a new topic on our support forum.
Where can I report security bugs?
The Performance team and WordPress community take security bugs seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.
To report a security issue, please visit the WordPress HackerOne program.
How can I contribute to the plugin?
Contributions are always welcome! Learn more about how to get involved in the Core Performance Team Handbook.