Skip to main content
InstantClick

Speed up your WordPress site with InstantClick

By May 19, 2014April 12th, 2019No Comments

InstantClick by @dieulot is a very neat little script that sounds very simple, but is oh-so-effective: start loading the next page when the visitor hovers over the link. It’s like lighting up your car’s brake lights when you abruptly take your foot of the gas. Okay, the milliseconds saved by InstantClick may not be as life-saving as the brake-lights, but pages will seem to load instantaneously, and that’s pretty cool too. (And did I mention it adds a YouTube-style loading bar to your site?)

Want to use InstantClick to speed up your WordPress site? Download the free InstantClick plugin for WordPress now!

Installing InstantClick

As soon as you install and activate the plugin on your WordPress install, InstantClick will start taking care of your page loading and speed up your WordPress site. InstantClick comes with an options page in the submenu under ‘Settings’.

Preload Behaviour

By default, InstantClick will start preloading pages when a visitor hovers over a link. This may not be ideal for every website or server set up. You can set a delay of 50 or 100ms, or trigger preloading only on mousedown (saving 50-70ms in load-time already!).

Conflicting Scripts

In most cases it will work out of the box, but plugin conflicts are not unlikely. To learn more about the what and why, check out the documentation on InstantClick.io.

Every script found inside your `<body>` tags will be re-evaluated by InstantClick when it loads a page. This may cause script conflicts. To prevent a script to be reloaded, add its handle to the “No-Instant Scripts” list in the options page.

(The ‘handle’ is the internal name for the script defined in the first parameter of `wp_enqueue_scripts(…)`. Sometimes you may need to dig through plugin files to find the handle a plugin author has used)

Custom Scripts

For some scripts you need to add custom code to keep them working. Stats and analytics set up in your `<head>`, for example, won’t automatically register new pages when you use InstantClick. In the options page for InstantClick, you can add custom JavaScript in the code editor. The InstantClick initialization code is included, so you have an idea of where your code will eventually be ran. Again, see the documentation on InstantClick.io, and the TurboLinks Compatibility page.

InstantClick Editor

Also, keep an eye on the plugin docs and this blog for example scripts and compatibility issues.

Development

The plugin is open source (licensed under the MIT License) and development can be followed on GitHub. The stable version will always be released on WP.org plugin repo.