Skip to main content
Agency Program Get 2× more leads and save 50% on hosting. Built for agencies ready to grow. Book a call
Speculative Loading icon

Speculative Loading

v1.4.0
by WordPress Performance Team · 5.0 (17 reviews)

Enables browsers to speculatively prerender or prefetch pages when hovering over links.

50K+ active installs Updated Jan 27, 2025 Tested to 6.7.2 Requires PHP 7.2
Try Demo Download
Pre-installed Ready in ~10s No card
Speculative Loading

About Speculative Loading

This plugin adds support for the Speculation Rules API, allowing you to define rules for prefetching or prerendering certain URLs. By default, the plugin is set to prerender WordPress frontend URLs when the user interacts with a relevant link, but this can be customized in the admin settings. The functionality is supported in Chromium-based browsers such as Chrome, Edge, or Opera, but other browsers like Safari and Firefox will simply ignore it.

Frequently asked questions

What is the purpose of the Speculative Loading plugin?
This plugin adds support for the Speculation Rules API, enabling browsers to dynamically prefetch or prerender pages. It aims to improve user experience by loading content before it's explicitly requested.
How does the plugin work by default?
By default, the plugin is configured to prerender WordPress frontend URLs when a user interacts with a relevant link. This behavior can be customized in the WordPress admin settings.
Which browsers support the Speculation Rules API?
The functionality used by the plugin is supported in Chromium-based browsers like Chrome, Edge, or Opera, version 121 or above. Other browsers will ignore the functionality without negative effects.
Can I prevent certain links from being prerendered?
Yes, you can exclude URL paths using a filter or by adding the 'no-prerender' CSS class to any link you do not want prerendered.

Changelog

1.4.0

Enhancements

  • Implement speculative loading considerations for safer behavior. (1784)

1.3.1

Bug Fixes

  • Check if rel contains nofollow instead of being just nofollow when excluding speculative loading. (1232)

1.3.0

Enhancements

  • Prevent speculatively loading links to the uploads, content, plugins, template, or stylesheet directories. (1167)
  • Facilitate embedding Speculative Loading in other plugins/themes. (1159)
  • Improve overall code quality with stricter static analysis checks. (775)
  • Bump minimum PHP requirement to 7.2. (1130)

1.2.2

Bug Fixes

  • Fix composition of href exclude paths to account for JSON encoding and differing site/home URLs. (1164)

Documentation

  • Update readme with browser support and FAQ section about analytics and personalization. (1155)

1.2.1

Enhancements

  • Add settings link to Speculative Loading plugin action links. (1145)
  • Bump minimum PHP version to 7.2. (1130)

Bug Fixes

  • Exclude _wpnonce URLs in speculation rules. (1143)
  • Exclude rel=nofollow links from prefetch/prerender. (1142)

1.2.0

  • Add missing uninstall.php to remove plugin’s database option. (1128)

1.1.0

  • Allow excluding URL patterns from prerendering or prefetching specifically. (1025)
  • Rename plugin to “Speculative Loading”. (1101)
  • Add Speculative Loading generator tag. (1102)
  • Bump minimum required WP version to 6.4. (1062)
  • Update tested WordPress version to 6.5. (1027)

1.0.1

  • Escape path prefix and restrict it to be a pathname in Speculation Rules. (951)
  • Force HTML5 script theme support when printing JSON script. (952)
  • Add icon and banner assets for plugin directory. (987)

1.0.0

  • Initial release of the Speculative Loading plugin as a standalone plugin. (733)

Try other plugins

Really Simple SSL icon

Really Simple SSL

4.9 · 4M+ installs

The easiest way to improve security! Leverage your SSL certificate and protect your website visitors.