Prerender Links on Hover
Upgrades WordPress speculative loading (6.8+) from prefetch to prerender with moderate eagerness, so pages open almost instantly after a hover.
Opens WPIDE on
Code
add_filter( 'wp_speculation_rules_configuration', function ( $config ) {
if ( is_array( $config ) ) {
$config['mode'] = 'prerender';
$config['eagerness'] = 'moderate';
}
return $config;
} );
Notes
Prerendering runs page scripts early; analytics tools that are not prerender-aware may count extra page views.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.