Fixing Duplicate Content So Google doesn’T See It.
Welcome to my blog, please feel free to subscribe to my RSS feed or leave a comment.
There are a lot of blogs you’ll find with an invaluable code snippet designed to ensure Google only indexes the posts on your web site and does not duplicate the categories and tags pages, unfortunately the code they’re using has a critical flaw as you’ll see by viewing my Google Webmasters Tool report to the right. Even using the tool, I keep getting duplicate content notifications.
The code is here:
<?php if(is_home() || is_single() || is_page()){
echo ‘<meta name=”robots” content=”index,follow”>’;
} else {
echo ‘<meta name=”robots” content=”noindex,follow”>’;
}?>
You can find it on a ton of blogs:
- http://www.thisismyurl.com/wordpress/meta-tags-that-kill-your-blog/ and;
- http://www.thisismyurl.com/web-advice/meta-tags-that-kill-your-blog/
if(is_home()) {echo ‘<meta name=”robots” content=”index,follow” />’; }elseif(is_page()) {echo ‘<meta name=”robots” content=”index,follow” />’; }elseif(is_single()) {} else { echo ‘<meta name=”robots” content=”noindex,follow” />’; }
$category = get_the_category();if(strpos($_SERVER['REQUEST_URI'],$category[0]->category_nicename.”/”)>0) {echo ‘<meta name=”robots” content=”index,follow” />’;} else {echo ‘<meta name=”robots” content=”noindex,follow” />’;}
if(is_home()) {echo ‘<meta name=”robots” content=”index,follow” />’; }elseif(is_page()) {echo ‘<meta name=”robots” content=”index,follow” />’; }elseif(is_single()) {$category = get_the_category();if(strpos($_SERVER['REQUEST_URI'],$category[0]->category_nicename.”/”)>0) {echo ‘<meta name=”robots” content=”index,follow” />’;} else {echo ‘<meta name=”robots” content=”noindex,follow” />’;}} else { echo ‘<meta name=”robots” content=”noindex,follow” />’; }
Other Posts of Interest
Posted on: Friday, October 24th, 2008Tags: google, meta, seo, WordPress
Posted in Search Engine Optimization, WordPress | | Read more
Did you find this article useful? You're welcome to post a link to this website along with the title but please don't copy the whole article. You can also link back using the following code:
<a http://www.thisismyurl.com/wordpress/fixing-duplicate-content-so-google-doesnt-see-it/" rel="bookmark" title="Fixing Duplicate Content So Google doesn’T See It.">Fixing Duplicate Content So Google doesn’T See It.</a>
About the author.










October 26th, 2008 at 3:56 am
Isn’t restricting crawls for tags and categories in a robots.txt file not enough? I have the first code you mention in my theme and I also have the robots file.