
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"
thanks for the info.
Duplicate title is the worst thing and it affects your search engine rankings. Avoiding it will help you get better rankings for search. Thanks for your useful input on this matter.
thank you, dude. I have found that tip much time. Can i replace “Pages” to custom names ( page 1 to Music, page 2 to Video, page 3 to text, for example)?
@4net …
In theory, yes you can .. but it’ll need more advance script to be able to do that. I’ll take a try, I’ll contact you ASAP …
Woww, Thank you brother . Very good theme .
i have solve this problem but the worst is how to manage to handel the same roblem when it apply to search.php. could yu give me some clue ?
@uwiuw, I think it’s the same way to the way how it managed in index.php.
by the sori about the url…i shuld submit too many url :D
I can see that your given URL’s are redirecting to a same page. So I think there will be no problem since google will only index the reached page
yes, i have set my ..ahttacces dan some robot.txt order. Hofully i couple of mothn, all the search cache will be long gone :D thanks
Saya sebenarnya tidak begitu paham bahasa inggris tapi penjelasan yang berikan begitu lugas dan jelas sehingga saya bisa memahaminya
thank Brother, sorry my english is bad
Wew…Nice info gan,
How about add rel=canonical, is it useful?
One more question, I used to break my comments into several page (paginate comments), is that good for SEO?
@rismaka,
IMO, as long as there aren’t ‘perfectly’ the same content with different URIs, or different URIs with the same title tags, it’d be fine..cmiiw
I haven’t heard about rel=canonical and hav not do some research about it. But I knew splitting comment without further modification on the theme could be break your SEO, I read this somewhere but forget where it was .. hehehe …
Amazing blogpost, didn’t thought reading this was going to be so awesome when I read your title with link!
7 trackbacks
[...] read about how to avoid duplicate title tag due to separated post(paginated post) Share together [...]
[...] そこでいろいろ調べるとAvoiding Duplicate Title Tag on WordPress Postには下記のようなソースが掲載されている。 <?php the_title(); if ( [...]
[...] Сегодня потратила добрую половину дня, чтобы понять, как это решить. Поиск по официальной документации и форуму WordPress ничего не дал, равно как и применение различных SEO-плагинов. Наконец-то, к большой моей радости, такое решение нашлось в статье одного индонезийского веб-дизайнера «Avoiding Duplicate Title Tag on WordPress Post». [...]
[...] Сегодня потратила добрую половину дня, чтобы понять, как это решить. Поиск по официальной документации и форуму WordPress ничего не дал, равно как и применение различных SEO-плагинов. Наконец-то, к большой моей радости, такое решение нашлось в статье одного индонезийского веб-дизайнера «Avoiding Duplicate Title Tag on WordPress Post». [...]
[...] Сегодня потратила добрую половину дня, чтобы понять, как это решить. Поиск по официальной документации и форуму WordPress ничего не дал, равно как и применение различных SEO-плагинов. Наконец-то, к большой моей радости, такое решение нашлось в статье одного индонезийского веб-дизайнера «Avoiding Duplicate Title Tag on WordPress Post». [...]
forex ea…
…
[...] Сегодня потратила добрую половину дня, чтобы понять, как это решить. Поиск по официальной документации и форуму WordPress ничего не дал, равно как и применение различных SEO-плагинов. Наконец-то, к большой моей радости, такое решение нашлось в статье одного индонезийского веб-дизайнера «Avoiding Duplicate Title Tag on WordPress Post». [...]