Add rel=prev & rel=next Meta Tags in WordPress

5/5 - (1 vote)

You need to include the rel=”prev” & rel=”next” meta tags in your WordPress blog. These kinds of meta tags will show Google the relationships of documents that span over multiple pages and distinguish them as a series.
This is certainly great for SEO and helps Google properly index chart your information. Proper indexing means more relevant results to users and more targeted prospects to your site.
It’s quite simple to include these meta tags to the section on your blog.
First, install the following plugin:
Second, add the following and clear cache if you have 3w cache installed.

function cor_rel_next_prev_pagination() {
  global $paged;
  if ( get_previous_posts_link() ) { ?>
  <link rel="prev" href="<?php echo get_pagenum_link( $paged - 1 ); ?>">
  if ( get_next_posts_link() ) { ?>
  <link rel="next" href="<?php echo get_pagenum_link( $paged + 1 ); ?>">
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head');
add_action('wp_head', 'cor_rel_next_prev_pagination');

You should see something like this :

<link rel="prev" href="">
<link rel="next" href="">

More information can be found on the Google Webmaster Blog.
rel=prev & rel=next Meta Tags

Tags :
rel=prev & rel=next Meta Tags
Social Share :