Skip to content

Early-bird lifetime licence: $199 once, for the first 200 buyers only. See the offer

Open pages instantly on hover

When a visitor hovers over a link or starts tapping it, the browser starts loading that page, so it opens almost instantly. Uses WordPress’s speculative loading (6.8+).

  • Type PHP
  • Runs Everywhere (runs as WordPress loads)
  • Category Performance
  • Tested with WordPress 7.1
PHP
<?php

add_filter(
	'wp_speculation_rules_configuration',
	static function ( $config ) {
		if ( ! is_array( $config ) ) {
			return $config; // Switched off (for example for logged-in users): leave it.
		}
		$config['mode']      = 'prerender';
		$config['eagerness'] = 'moderate';
		return $config;
	}
);

Good to know

Prerendering runs page scripts early, which some analytics count as a visit. Use “conservative” instead of “moderate” for fewer extra loads.

In these packs

  • More speed: More ways to load less: block styles, speculative loading, fewer scripts.

Move your snippets over this afternoon.

Importing changes nothing until you switch over, and your old shortcodes keep working.