Avoiding Duplicate Title Tag on WordPress Post

One of the common tag available in WordPress blog is <--nextpage-->. It used to break a long post into several pages. Many blogger try not to use this tag because it will generate duplicate title tags error on Google. WordPress itself hasn’t really do something with it on the last version come out. Actually, it is possible to avoid it by adding a few line of code on the blog template.

Modifying the template

Duplicate title tags is bad for Search Engine Optimization (SEO). This is what we should do with the template to avoid the error:

header.php
Use your theme editor on blog dashboard to edit the file header.php

Find this line:

<title> ... </title>

Add before </title>

<?php
     if ( get_query_var('page') ) {
          print ' - Page ' . get_query_var('page');
     }
?>

index.php
Edit your index.php using theme editor

Find this line (or something similar that used to show your post title)

<?php the_title(); ?>

Change the code into this:

<?php
     the_title();
     if ( get_query_var('page') ) {
          print ' - Page ' . get_query_var('page');
     }
?>

That’s it, now you won’t see any duplicate title tag on your WordPress blog anymore and will be happy to use <--nextpage--> tag without worrying any duplicate title tag. Don’t forget to make backup before you do anything to your template.

15 comments on "Avoiding Duplicate Title Tag on WordPress Post"
7 trackbacks
  1. [...] read about how to avoid duplicate title tag due to separated post(paginated post) Share together [...]

  2. [...] そこでいろいろ調べるとAvoiding Duplicate Title Tag on WordPress Postには下記のようなソースが掲載されている。 <?php the_title(); if ( [...]

  3. [...] Сегодня потратила добрую половину дня, чтобы понять, как это решить. Поиск по официальной документации и форуму WordPress ничего не дал, равно как и применение различных SEO-плагинов. Наконец-то, к большой моей радости, такое решение нашлось в статье одного  индонезийского веб-дизайнера «Avoiding Duplicate Title Tag on WordPress Post». [...]

  4. [...] Сегодня потратила добрую половину дня, чтобы понять, как это решить. Поиск по официальной документации и форуму WordPress ничего не дал, равно как и применение различных SEO-плагинов. Наконец-то, к большой моей радости, такое решение нашлось в статье одного  индонезийского веб-дизайнера «Avoiding Duplicate Title Tag on WordPress Post». [...]

  5. [...] Сегодня потратила добрую половину дня, чтобы понять, как это решить. Поиск по официальной документации и форуму WordPress ничего не дал, равно как и применение различных SEO-плагинов. Наконец-то, к большой моей радости, такое решение нашлось в статье одного  индонезийского веб-дизайнера «Avoiding Duplicate Title Tag on WordPress Post». [...]

  6. Anonymous

    forex ea…

  7. [...] Сегодня потратила добрую половину дня, чтобы понять, как это решить. Поиск по официальной документации и форуму WordPress ничего не дал, равно как и применение различных SEO-плагинов. Наконец-то, к большой моей радости, такое решение нашлось в статье одного  индонезийского веб-дизайнера «Avoiding Duplicate Title Tag on WordPress Post». [...]

Leave a Response