How to Implement Google Instant Pages on WordPress

Share & Comment

Recent numbers from StatCounter, the web analytics service, shows that Google Chrome is gaining a significant share in the web traffic. It has risen to 3rd most popular web browser. That being said, you can expect about 20-25% of users coming to your website using Google Chrome so adding Chrome specific features to your website makes a lot of sense.

StatCounter-browser-ww-monthly-201007-201107-bar

Today, we will talk about one such feature, Google Instant Pages.

Add Google Instant Pages in WordPress

Google Instant Pages, is a way to tell Chrome Browser about one link on your web page which is most likely to be visited from current page, which it can try to prefetch in background.

Adding support for Instant Pages in wordpress is very simple. Open your theme’s functions.php and add the following code

[php]

function add_google_instant_pages() {
if ( is_archive()) { ?>
<link rel="prerender" href="<?php echo get_next_posts_page_link(); ?>">
<?php }
}
add_action( ‘wp_head’, ‘add_google_instant_pages’);

[/php]

Thesis Theme users could add the above code to “custom_functions.php”.

The above code is just sample to give you an example of the usage on archive pages as the users are more likely to go on the next page of archive and the complete usage of this is left for you. You can read more about Google Instant Pages here.

How Goes it. Let me know in the comments.

Vijay Sharma

Vijay Sharma is an aspiring tech blogger and internet consultant focused on helping the community with the tips and tricks that can help you build better web business.