Preload links

The Preload links feature will improve the perceived loading time of pages for a user navigating your site. If a user hovers over, or touches, a link for 100ms or more, the HTML of that page will be fetched in the background, so that when they actually click the link, the page will appear to load nearly instantly!

This option only improves the user experience and perceived load time - you will not notice any difference in your PageSpeed score or loading time as measured by Pingdom, GTmetrix etc.

This optimization is applied on all pages, both cached and uncached, for any visitor  who is not logged in.

Heads up! This feature is supported by Chrome and Chromium-based browsers. Other browsers may support this feature in the future.

In this Article

Preloading links in action

The gif below demonstrates this feature in action:

Automatic exclusions

We automatically exclude some URLs from this feature to prevent unexpected results:

  • Any URL from wp-admin, login/logout
  • URLs excluded from cache by WP Rocket configuration
  • Images
  • Links with a query string or an anchor
  • External URLs
  • Files with PDF, DOC, DOCX and XLS extensions
  • Link slug, as set in the ThirstyAffiliates plugin's Cloaked URL field
  • Links with /refer//go//recommend/ and /recommends/

Manual exclusions

You can manually exclude URLs from this feature using the following filter:

rocket_preload_links_exclusions

You can add a snippet like this to your theme's functions.php file:

add_filter( 'rocket_preload_links_exclusions', function ($links) {
  $links[] = '/projects';
    return  $links;
} );

You can add as many URLs as you want in $links[], to add more exclusions you can add as many lines as you need, one per URL.

๐Ÿ“ Manual code edit required before use!

๐Ÿ“ฅ   Download (.zip): WP Rocket | Regex Exclusions
Developers: You can find the code for this plugin on GitHub.

  1. Download the helper plugin zip file, then un-zip it.
  2. Open the PHP file in a text editor.
  3. On line 36 specify the file type you want to exclude from the Preload, like this: $uri[] = '(.*).doc';
  4. Re-zip the folder.
  5. Install the helper plugin on your site - go to Plugins > Add New > Upload plugin and select the zip file.
  6. Activate the plugin.

Plugin compatibility

This feature replaces the need for the following plugins and if they are detected, you will be prompted to deactivate them:

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.