How To Turn Your WordPress Blog From NoFollow to DoFollow Without a Plugin

DoFollow In this tutorial, I will show you how to easily turn your WordPress blog from the default NoFollow to a DoFollow blog without the need of a plugin. Why not turn your blog into a DoFollow blog and get more visitors, more traffic and eventualy more recognition in the Online community. Probably you already have seen some blogs displaying the DoFollow image and you wonder how it is done and what it really means. Read my next tutorial for a closer look at DoFollow versus NoFollow.

What are NoFollow and DoFollow?

DoFollow is a term that does not really exist. It is a slang term given to Websites that are not using nofollow. nofollow is a value that can be assigned to the rel attribute of the HTML anchor tag to instruct some search engines not to pass on any influence to an outbound link. The nofollow value was intended to stop comment spam in blogs. Commenting is recognized as a good way to get one way backlinks. But it has been abused and thus the creation of the nofollow value back in 2005.

You might already know that NoFollow blogs do not carry any PR value to other Websites through commenting. If your blog is DoFollow then comments made by your users get Link juice, meaning that your blog passes on the PR value to the commenter.

Should You Set Comment Links To DoFollow?

One way to encourage your readers to comment on your blog is by making your blog DoFollow. If your blog is new and you are trying to increase traffic then you need to turn your blog to a DoFollow blog. When people comment on your content they are adding value to your content. Some consider DoFollow as bribing visitors for comments, while others consider it as rewarding visitors that leave a comment. I tend to agree with the latter, but whatever your opinion is, DoFollow encourages interaction with your readers. One negative side though is that it increases comment moderation duties and an increase of spam comments.

What About a Plugin?

Yes, there are several plugins that turn your blog to a DoFollow blog. But I encourage you to read my previous article about unnecessarily adding plugins to your theme. Also, you really don´t need a plugin for such a simple task.

How does NoFollow and DoFollow Look Like?

The only way to know whether a link has been set to NoFollow is to look at the source code of the page. There are several ways to do that depending on the browser you use. To look at the source code, select “source” from your browser´s menu or you could right click on the page to view the source from the context menu. Also, Mozilla Firefox browser has add-ons that highlights a nofollow link on the page without actually looking at the source code.

The attribute that defines a link as NoFollow is rel=“nofollow”. If you remove the rel=“nofollow” attribute, then your link becomes DoFollow. There is no dofollow value. The absence of the nofollow value makes the link a DoFollow.

A typical DoFollow link is like this:

<a href="" title="">Blue Olive Online</a>

A typical NoFollow link is like this:

<a rel="nofollow" href="" title="">BOO</a>

Features of My “DoFollow” Code

  1. The code is added to your theme´s functions.php file. The core WordPress code is not modified in any way.
  2. The code is split into 2 independent sections (Section1 and Section2). You have the choice to choose either one or both.
  3. The code is tested to work with the latest version of WordPress. However it also works with earlier versions.
  4. The code is tested to work properly with all major browsers.

“DoFollow” Code | functions.php

To change your Comment links from NoFollow To DoFollow, Open the functions.php file located in your theme´s folder, and add (copy and paste) the following code.

Note: To scroll within the code: You can also click on the code window and use your keyboard´s arrow keys.

* @Author: Boutros AbiChedid 
* @Date:   October 9, 2011
* @Website:
* @Description: Function1: changes the Author's link in the comment  
* section to a 'dofollow' instead of the WordPress default of 'nofollow'
* Function2: changes all links in the comment text to a 'dofollow' 
* instead of the WordPress default of 'nofollow'
* @Tested on: WP version 3.2.1
/**** Section1: Changes the author's link in the comment section to a 
'dofollow' instead of the default WordPress  of 'nofollow' ****/
function dofollow_comment_author_link() {
	$url    = get_comment_author_url();
	$author = get_comment_author();

	if ( empty( $url ) || ('http://' == $url))
		return $author;
		$link = "<a href='$url' rel='external' class='url'>$author</a>";
		return $link;
add_action('get_comment_author_link', 'dofollow_comment_author_link');
/* End of Section1 */

/**** Section2: Changes all links in the comment text to a 'dofollow' 
instead of the WordPress default of 'nofollow' ****/
function dofollow_comment_text_link($string) {
	$string = str_ireplace('rel="nofollow"', '', $string);
	return $string;
add_filter('comment_text', 'dofollow_comment_text_link');
/* End of Section2 */

“DoFollow” Code Notes:

Note: If you don´t see the horizontal bar, and to scroll within the code, you can also click on the code window and use your keyboard´s arrow keys.

1. Section1 of the above code changes the author´s link in the Comment section to a dofollow instead of the WordPress default of nofollow.

Meaning an Author´s link such as:

<a class="url" rel="external nofollow" href="">Boutros AbiChedid</a>

will be transformed to:

<a class="url" rel="external" href="">Boutros AbiChedid</a>

2. Section2 of the above code changes all links in the Comment text to a dofollow instead of the default WordPress of nofollow.

Meaning Any link in the Comment text box such as:

<a rel="nofollow" href="">Blue Olive Online</a>

will be transformed to:

<a href="">Blue Olive Online</a>

3. You have the choice to apply either Section1 of the code or Section2 or Both. For this Blog, I applied both Sections.

Code Explanation Using an Image

The image below shows what does the above code affect in the Comments section of your WordPress blog.

Effect of the code above on the comment section of your Blog.

Code References:

General Warning

When you add several PHP code blocks in your theme´s funtions.php file, make sure that you do NOT leave any white space (spaces, newline) before the opening PHP tag or after the closing PHP tag. Like so (the correct way):

//Some Code here beetween the opening PHP tag (above) 
//and the closing PHP tag (below)...
//Some other Code here ...

In the above code, if you leave any white space or a newline between lines 4 and 5, you will get the following error: Warning: Cannot modify header information - headers already sent by … , in your login screen and after you login to your WordPress dashboard.

Your Turn to Talk

What is your opinion about NoFollow or DoFollow? Does link juice mean anything to you? How easy did you find this tutorial to implement?

If you have something to say, please share your opinion in the DoFollow Comment section and get your reward. Your opinion matters, unless it is a Spam. By the way, this blog is now a DoFollow blog.


If you enjoyed this post, please consider: linking back to it, subscribing by email to future posts, or subscribing to the RSS feed to have new articles delivered to your feed reader. Thanks!

About the Author |
Boutros is a professional Drupal & WordPress developer, Web developer, Web designer, Software Engineer and Blogger. He strives for pixel perfect design, clean robust code, and user-friendly interface. If you have a project in mind and like his work, feel free to contact him. Connect with Boutros on Twitter, and LinkedIn.
Visit Boutros AbiChedid Website.

31 Responses to “How To Turn Your WordPress Blog From NoFollow to DoFollow Without a Plugin”

  1. James Hyden says:

    i checked my page source, there is no “nofollow” term. But my website still have no comment even spam. I’m i banned from SE

  2. Good job with the explanation. This works good when implementing dofollow to your own blog, but does not work when trying to obtain a dofollow backlink on another person blog. =)

    • Your point is understood Don. And by approving your comment, you got a dofollow back-link from this blog.
      Commenting on other dofollow blogs will get you the back-link you are seeking (assuming the approval of your comment)

  3. Brian K Arnholt says:

    I really fear of turning my blog into dofollow, if someone post my blog url as dofollow in some seo forum, i am sure thousands of spammer will spam my blog with comments, software such as scrapebox has even made the condition worse.

    Any idea how to avoid spam even after making the blog do follow

  4. Olawale Daniel says:

    Great and helpful guide for changing our default nofollowed blog to dofollow in a single step.

  5. Thought I would drop you a note just to iterate the importance of locating do-follow sites in building link juice is very important in driving your ranking up in the search engines.

    Great article you have written to help those looking to allow their own site or blog to become a dofollow site. Keep up the great articles!

  6. Great article. I have been wondering how to entice traffic to my site to leave comments. Comments on my site are essentially dead. I think I will take your advice and make my site a dofollow. Thanks for the great information.

  7. Driving Lessons says:

    Hi, I think it is a good idea as providing people are making comments relating to the post then it will benefit everyone. The spammers might realise that they should take time to join in properly with reading and commenting properly and all of our sites will improve their search engine rankings.

  8. file search says:

    I agree with your viewpoint. If you are a new blogger, you’d better to use dofollow to attract reader to comment on your article.Then your traffic will grow. But you should shutdown the spam comments.

  9. Dailyblogtools says:

    Thank you. Very interesting to read.

  10. marathi matrimony says:

    Good informative post on how to remove nofollow to dofollow without plug in.

  11. Ptctrusted says:

    Hi boutros.I want to ask you if you think that this movement of converting an unfollow blog to a dofollow blog will benefit me.I have a big spam issue to my blog so i am sceptical of this.Also do you know of a software for wordpress in order to avoid spamming?
    Waiting your reply

    • @Ptctrusted:
      Thank you for your comment. Converting to a dofollow blog will benefit you as long as you have good quality content. You need to advertise/announce it in dofollow lists and make sure that it is visible in your Website (with an image).
      As far as Spam, your Website will be spammed either way as most Spam is done automatically by bots and not filled up manually by people. So auto. spammers will not look to see if your blog is ‘dofollow’ or not.
      The best plugins for Spam for WordPress are: Akismet ( and Spam Free WordPress ( .
      Also there is really no replacement for Moderating your comments.
      You probably heard in SEO that “Content is KING”.
      Hope this helps.

      • Ptctrusted says:

        Sorry for the late reply as i convert my windows to linux (they are really fast).
        I am using commentluv to my blog. I think that it is as good as Akismet.Right? Spam bots are very annoying for blog owners. Do you think i should change it to Akismet?
        Yeah content is the king. If you combine it with geo targeted advertising it is sure that you will succeed.

        • @Ptctrusted

          CommentLuv Plugin is NOT an AntiSpam plugin.
          For WordPress Anti-Spam Plugins check the following:
          Akismet and Spam Free WordPress.

          Hope this helps.

        • Ptctrusted says:

          Thanks Boutros.I will choose Akismet plugin as it is very popular.Thanks for helping.

        • Ptctrusted says:

          @Boutros where did you find the Akismet key?

        • @Ptctrusted:

          This is where you sign up for the Akismet key.

          If your blog is for personal use, then it is free. You could also try the other plugin I suggested.

        • Ptctrusted says:

          Thanks you very much Boutros. I solved my spam problem. I installed Aksimet. Thanks again.

        • Ana Hoffman says:

          Akismet absolutely SUCKS, gentlemen – it creates lots of false positives, so you have to comb through your spam folder to fish out any legit comments (like you might have to do with mine, Boutros).

          The best (and free) antispam plugin I found is GASP.

        • Thanks Ana for your feedback. Very much appreciated.
          G.A.S.P. ( is definitely worth trying.
          The only problem with it, is GASP requires JavaScript and many users disable JavaScript by choice
          or by device limitations, So I am not sure what’s the fall back strategy (I will try it and see).

          For this blog the anti-spam plugin I use is WP-reCAPTCHA – ( which I frankly found to be not-user friendly
          but it is quite effective.

          For this humble blog, I get about 150 spam comments per 24 hrs and WP-reCAPTCHA filters out about 95% of those and send them to the spam filter. Which is pretty good.
          I still have to go through them to make sure there are no valid comments, in which I never found one.

          Also in WordPress dashboard you can define how many links you can accept per comment before it is held in the queue and also there is a comment blacklist based on keywords, IP and other anti-spam features …


          Update: Dec. 1, 2011 – I tried the G.A.S.P. and they have a warning message when JavaScript is disabled.
          So I like it. The nice thing about it is that all Spam bots are not able to comments, since they don’t see the check-box, so you will not get hundreds of Emails in your Spam folder.
          Of course you still have to deal with the Manual spam (i.e. people that manually write a comment, just for Spam)
          For this reason, now I replaced the WP-reCAPTCHA plugin with G.A.S.P.

  12. Hi Boutros,

    Very nice tutorial, its easy to understand and well informative. :)

    “What is your opinion about NoFollow or DoFollow?”
    - You already explained the meaning of NoFollow and DoFollow, I always to prefer DoFollow but I’m also leaving comments at sites that NoFollow as long as I got attracted to the topic. Commenting the best way to create good relation with other blogger, so I don’t mind if I get a NoFollow or a DoFollow link.

    “Does link juice mean anything to you?”
    - Of course, it always been good to have link juice. :D

    “How easy did you find this tutorial to implement?”
    - I’m looking for lots of basic tutorial about blogs, from creating to publishing. I happen to find yours, as I stated above your tutorial is very easy to understand. I bookmarked it already for my future resources.

    - Marvin

    • @Car Accident Information:
      Hi Marvin,
      Thank you for commenting. Interesting blog you have about NY, I feel bad for the Doctor who got hit.
      I agree with you on commenting, When I find the need, I comment regardless of the link status (dofollow or nofollow). After all, this is how you get exposure and visibility online.
      When commenting, other visitors will see your Website and check it out.