Stylishly writing quality and affordable content for your site.

Make WordPress Comments DoFollow

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?

Related posts:

  1. Effective Link Building Via Blog Comments
  2. Top Dofollow Social Bookmarking Sites 2009

Tagged with Website Building

U comment I follow

32 Comments, Leave a comment or Ping

  1. 2

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

    Thanks!

  2. JAVIER

    3

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

  3. lcd

    4

    You have great blog and this post is good!

  4. 5

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

    Thank in advance…

  5. 6

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

  6. Jane

    7

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

  7. Bodziony

    8

    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.

  8. 9

    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.

  9. Amy

    10

    “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

  10. 11

    Excellent! Use of a plugin is better so that whenever you upgrade versions the changes will remain. Lessens the headache of having to redo everything again.

  11. 12

    Been looking for some good comment suggestions for a while now. This is perfect!

  12. 13

    I don’t think it really matters that much anymore.

  13. 14

    Just curious, what wordpress theme are you using as it looks cool?

  14. 15

    You can see the link to the website of the author of the theme at the bottom of this page.

  15. 16

    Just what I was looking for, you saved my day

  16. 17

    Great tips! I didn’t realize how easy it was to change that. Going to adjust the setting on my site right now.

  17. 18

    Funny to see what a lively discussion this becomes on other blog comment sections. Why not only approve comments from members of your blog? Or a Captcha?
    The higher the alexa rank of the commenters’ blog, the more they’re against it, saying stuff like just produce better content duhh…
    I am a positive thinker and I feel a comment deserves a raise. And spammers need love too man ;)

    Cheers,
    Andy

  18. 19

    Can’t think of an instance when spammers are deserving of some love. But yeah, I’d probably love it if these spammers got a dose of their own medicine. :)

  19. 20

    I appreciate you teaching us how to do this with and without a plugin. A clear explanation of how to “hack” the files means anyone can do it.

  20. 21

    Thanks for this. I think a lot of people appreciate when your blog has “dofollow” comments enabled and are more likely to contribute something useful to it. As long as they don’t spam your site then they are helping you so enabling dofollow comments can help to get your blog out there!

  21. 22

    answer is not really required ….
    Thank you for sharing code! This can be a great help to those who are looking to follow the blog. And of course we should also remember that whenever our opinion it must be relevant to the topic so that it will be approved by admin. Anyway, this is great! hope you can post to the technique more just like this. thank you list this blog

  22. 23

    Good tips for make a blog do follow but y most of the time a blog convert it in to No follow when its get popular

  23. 24

    good information about do-follow and no-follow one must think that blog having do follow tag helps a lot and every should think about this
    thanks.

  24. 25

    post thank you much, very good article I need it

  25. 26

    I like to reinforce the idea that any blog with great content will get many backlinks

  26. 27

    So are wordpress and moveable type blogs nofollow by default? Or does the blog owner have to change it to that?

  27. 28

    Great post and very useful code! The info is very open and very clear explanation of issues. Nice! If there is an interest I have too much information that I can share with you.

  28. 29

    Thanks for this. Useful info as always. Does anyone out there publish the fact that their site is do follow to get more comments?

  29. 30

    dofollow blog is more beneficial for us
    it takes good backlinks
    Thanks

  30. themeparkguru

    31

    Finally somebody who solved my problem. I was looking on the right side in the control panel in word press itself and could not find rel=”external nofollow”. When I read your post I then loged in with FTP and found exactly the function that you refer to. I also wanted to put rel=”external dofollow” but you have explained that dofollow does not exist. So i just left it blank. It worked like a charm. I use Firefox plugin that highlights nofollow red. it is green now. Great tips..Thank you so much..Problem solved

  31. 32

    Hi All ,

    My requirement is different.

    1. Author should be in no-follow
    2. Link in comment should be in do-follow.

    Please help me it is very necessary for me.

    Thanks All

untell.com - Dec 5th