How To Add Nofollow to the Wordpress Comments Link
July 5th, 2008 by MackI actually had a damn hard time finding this posted anywhere on the web, so I thought I would share. I don't think I need to tell anyone why this is a good idea, but it is basically eliminating search engines from indexing useless links. We will use the following as an example.
Useless Links For Search Engines (possibly dup content)
http://www.lobolinks.com/blog/which-search-engine-had-the-best-4th-of-july-display/#respond
http://www.lobolinks.com/blog/entrecard-suggestions/#comments
I think you see my point.
How To Instructions
Open wp-includes/comment-template.php
Find (was around line 763 for me)
Change To
Save and Upload. Your done.
Related Post
- Forcing the Wordpress index.php to the Main Url and Avoiding Duplicate Content with a .htaccess - Duplicate Content on a large scale basis can ruin your blog. I blame it on the search engines for not being smart enough to know exactly what yo ...
- Top Entrecard Droppers Widget for Wordpress - I am embarrassed to say I Google'd this for almost 20 minutes before I realized how stupid I was to make this more complicated that it actually was.& ...
- 301 redirects for Directory Owners - Earlier today I was checking on some new links for the directory and some old ones. I ran across a blog post from Links Juice Blog by eazenet. Eaze wa ...















By Squeaky on Jul 6, 2008 | Reply
Thanks for the very useful code. I think this will work rather well, but if I would ever decide to let registered users post have the follow tag on their comments, then it would be an issue to address.
Since I am rather new to blogging, not sure if it is important to allow a follow tag on registered users comments, if it is something to consider?
By Mack on Jul 6, 2008 | Reply
Squeaky, their are lots of dofollow plugins for Wordpress that will allow you to control what is followed.
http://kimmo.suominen.com/sw/dofollow/
Even if you have one of the dofollow plugins it shouldn't conflict with this hack.
By Dennis Edell on Jul 8, 2008 | Reply
I'm a little confused. On the links you gave, are you referring to the duplicate "related posts" entries?
By Mack on Jul 8, 2008 | Reply
Well lets compare the urls, this is the normal permalink.
http://www.lobolinks.com/blog/how-to-add-nofollow-to-the-wordpress-comments-link
This is the one to jump straight to comments.
http://www.lobolinks.com/blog/how-to-add-nofollow-to-the-wordpress-comments-link/#comments
The problem is, search engines will see that as two different urls. So, we need to eliminate one of them with nofollow. We would all like to think the "bots" are smart enough to know the difference, but probably not.