Make WordPress Comments DoFollow

If you're new here, you may want to subscribe to our RSS feed. Thanks for visiting!

In WordPress the links on any comment made on posts have the HTML attribute of NoFollow by default.  What this simply means is that it tells the search engines that a hyperlink will just ignore or not influence the target’s ranking in the search engine’s indexing.  If you are not familiar with it, the attribute should look like this within the tag if you look at the source:

<a href='http://link_of_site_here' rel='external nofollow' class='url'>

The highlighted part of the <a> tag is how WordPress writes the link.  If you want to change this to something else,  like the ever popular DoFollow attribute, there are 2 ways of achieving this.

1) Hacking Your Wordpress – The first method is to “hack” the source code of your WordPress blog.  It is very easy and doesn’t involve any programming know-how.  All you need to do is to find and edit the file named  comment-template.php.  This should be easily found under the wp-includes directory of your WordPress installation.

Once you’ve found this file, open it with your favorite editor then go to the function named get_comment_author_link() as seen below:

function get_comment_author_link() {
 $url    = get_comment_author_url();
 $author = get_comment_author();

 if ( empty( $url ) || 'http://' == $url )
 $return = $author;
 else
 $return = "<a href='$url' rel='external nofollow' class='url'>$author</a>";
 return apply_filters('get_comment_author_link', $return);
}

Again take note of the highlighted part on the code above.  That is the part that you should edit.  There is actually no DoFollow attribute.  Instead taking out the nofollow from the code is all you need to do.  After you’ve done the necessary changes, the result should look like this:

 $return = "<a href='$url' rel='external' class='url'>$author</a>";

Save the file, upload it to your host server and you’re good to go!  Do note that this will only take out the nofollow attribute on the “author link” part of the comment.  Links on the body of the comment will stay the same – NoFollow.  But that is good since we do hate links dropped on the comment body don’t we? It looks too spammy.  Most of the time this kind of comment goes directly to the spam bin.  If you want to make all links made on the comment DoFollow, you’ll have to do more hacking.  However, I don’t recommend this method of making comments on your blog DoFollow.  Directly altering WordPress code is something you should avoid doing since this breaks on version upgrades.

By the way, External, in case you were wondering is an attribute that tells your browser to open the link in another page or tab.  It is the valid XHTML strict equivalent to target=’_blank’, which is not supported.  This, however, needs javascript to function properly.

2) Plugins – The 2nd method, and what I recommend, is to install a WordPress plugin to take care of making links on comments DoFollow.  There are several plugins available at the WordPress plugins page.  Or you can search for it directly from the control panel.  Keyword for the search? Dofollow of course!  I will leave it up to you to decide which plugin best suits your taste

How does a DoFollow link benefit you?  Well for one you should be getting more comments from people who are trying to build backlinks to their site.  (More traffic perhaps?)  I see this as a 2-way benefit too.  You comment on my site, I follow.  I do the same on your site.  Well if you’re not a believer of DoFollow, at least approve our comment. LOL!

Anyway, DoFollow encourages commenting on your posts but be warned that spammers love DoFollow blogs a lot.  Once you have enabled this, expect to see more spam comments on your site.  Of course you wouldn’t be running a blog without some form of spam protection, would you?

You can leave a response, or trackback from your own site.

10 Comments »

 
  • untell.com says:

    Make WordPress Comments DoFollow | Write Effects…

    In WordPress the links on any comment made on posts have the HTML attribute of NoFollow by default.  What this simply means is that it tells the search engines…

  • Really valueable information for all webmasters. Also didn’t know the attribute ‘external’.

    Thanks!

  • JAVIER says:

    I’m always looking for more information about this, thanks for the awesome post, keep them coming!

  • lcd says:

    You have great blog and this post is good!

  • Ski Resorts says:

    Can you automate this process by using some sort of wordpress plugin?

    Thank in advance…

  • No. 2 suggests the use of Plugins to make it easier. =D So yeah that’s some sort of automation already.

  • Jane says:

    Good info, always gotta comeback to the well that keeps giving! :)

  • Bodziony says:

    This was actually a nice read. I was just looking around the web and just happened to bump into your article on how to gain more web publicity and exposure by submitting articles. I personally tried a few article directories like EzineArticles and GoArticles, but there happens to be one article directory that I simply love because it allows the author have more options, is Mooladays.com.

  • Hi, I like to reinforce the idea that any blog with great content will get many backlinks. Commenting and have comments in a blog is the best gifts that blog owners wish for their best ranking. You are going to be visible faster is your content is update often, by the webmaster and by allowing more comments on it. Good luck for the best top positions.

  • Amy says:

    “How does a DoFollow link benefit you? Well for one you should be getting more comments from people who are trying to build backlinks to their site. (More traffic perhaps?) I see this as a 2-way benefit too. You comment on my site, I follow. I do the same on your site. Well if you’re not a believer of DoFollow, at least approve our comment. LOL!”

    Amen to that ;p

 

U Comment I Follow

We love comments and you are welcome to say what you want. However, all comments will be manually approved. Please observe the following:
  • Write your comments in english. It doesn't have to be perfect grammar as long as it's understandable. Non-english comments will most likely be deleted.
  • Make your comments relevant and related to the subject. Anything out of topic will most likely end up in the spam bin or the link removed from the comment.
  • Links within the body of the comment will be removed even if your comment is relevant and related to the subject.
  • Avoid using keywords, and the likes, as your names. We might be a little lenient on this, but it would be nice if you used a human name.
Thanks!

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>