
Duplicate content is often a problem with WordPress blog, and as you probably know it, it can hurt your blog SEO. Here is a small code to insert on your header.php file, to get rid of duplicate content in your WordPress blog.

Duplicate content is often a problem with WordPress blog, and as you probably know it, it can hurt your blog SEO. Here is a small code to insert on your header.php file, to get rid of duplicate content in your WordPress blog.
Simply paste theses line between the <head> and </head> tags in your header.php file.
<?php if((is_home() && ($paged < 2 )) || is_single() || is_page() || is_category()){
echo '<meta name="robots" content="index,follow" />';
} else {
echo '<meta name="robots" content="noindex,follow" />';
}
By using WordPress conditionnal tags, this code ensure that your homepage, posts, pages and category pages are indexed by search engines spiders, but prevent all other pages (feeds, archives, etc) from being indexed and create involuntary duplicate content.
One Response
first i wanna say thank u so much for this article.
second, you miss “?>” at the end of code.
{sorry if my english is bad, i can’t speak much english]
Trackbacks: