×

How to make Post links do follow in wordpress

default single post image

Do not confuse yourself ,  I am not going to suggest you any plugin to make a post link do follow?  I am sure you have searched a lot of website and find a lots of silly plugins to make comment author or their comments links do follow. Yes most of the time we try to make give back something to our valuable commentator.

Some times, we need to even reward our guest bloggers for their valuable work as they render their best to us. I think they also need a do-follow links. Most of the time, your wordpress templates and famous WordPress plugins, by default create all  external links no-follow and all the internal links do-follow.

A very simple tricks can make all your no-follow links into do follow link. follow the steps-

Open your post in your editor in HTML mode ( do not turn it into visual mode)

  • Locate the link , you want to make do follow
  • add rel=”do-follow”   like this < a rel=”do-follow”  “http://binaryNote.com” target=”_black” title=”reliable , accurate, secure technological blogging tips”> Binarynote.com </a>
  • Save your work

Now check your work. it looks very fine if you check these links using some sort of  extensions or plugins. BUT whenever you check the same using it’s source code you are little bit troubled .Becouse it display both nofollow and do-follow both. Confused !!!!!!!!How your link may behave like a no-follow and do-follow  at the same time.  Your customer and Guest Blogger will never ever accept this solution

So where it the solution? Solution lies in the core of WordPress, BUT, I would never suggest you to hack your wordpress core. Another perfect simple solution

Open your WordPress function.php file and type the following code in this file

function strip_nofollow($text = '') {
return preg_replace_callback("/<s*as+(.+?)>/is", 'strip_nofollow_callback', $text); }
function strip_nofollow_callback($match) {
$attr = $match[1];
$attr = " $attr ";
$attr = preg_replace("/
s
rels*=s*(['"])
([^1]*?s+)?
nofollow
(s+[^1]*?)?
1
/ix", " rel=$1$2$3$1", $attr);
$attr = preg_replace("/
s
rels*=s*(['"])s*1
/ix", '', $attr);
$attr = trim($attr);
return '<a ' . $attr . '>';
} add_filter('the_content', 'strip_nofollow', 15);

The above function does not make any changes in the core or in the WordPress database, it simply changes all the occurrence of no-follow tags into do-follow tags.

How do you like this do-follow hack to make post links do-follow, Be sure to share your experience with us.

rakesh

The Whole concept was developed by the man you are watching here. I am rakesh Kumar Serial Niche Blogger and SEO Enthusiast. find me onfacebookandon twitter.. Developed popular WordPress theme for Wallpapers and funny Image WordPress theme. Love SEO optimized WordPress theme Designing and Customization.
Related Posts

32 thoughts on “How to make Post links do follow in wordpress”

    1. Hi Sabrina, Welcome on my blog binarynote.com, happy to know that you find these tips useful. Keep in touch :)

    2. Hi Sabrina Dix, As you like this post to make post links do-follow. Hope you would definatly love my latest post “9 WordPress mistakes that would not let your WordPress site to rank”. Thanks for stopping by, Keep in touch :)

  1. I found a plugin that can make WordPress links no-follow, But is this practice safe (Making all the external links nofollow)?

    1. Hi Sudhanshu, The plugin is not the solution of the problem, We discussed in the article. To make a single link do-follow, You have to follow our method.

  2. I want to know that is there is a plugin that makes only a particular link dofollow and rest nofollow?

  3. Hello Rakesh Kumar,
    I was searching to change the nofollow link to dofollow link and after searching about it I came to your website and found a perfect technique to make post links dofollow in wordpress. Going to use it.

    Thanks
    Chiranshu Monga

  4. it does not work on my blog, error message is “Parse error: syntax error, unexpected ‘]’ in /home/ooraopal/public_html/acaiberrydietx.com/wp-content/themes/codium-extend/functions.php on line 10”

    1. Commentluv wordpres plugin can enable comment’s link ad do-follow. But most webmaster refrain them self from it.

  5. This information is extremely helpful, knowing how to change a post from nofollow into dofollow can help get so much more pagerank and seo juice. Bookmarked and I even gave this post a nice backlink from one of my other sites for the great information, thanks =)

  6. hi. i agree with your opinion. this post was very well written, and it also contains many useful facts because the author have made it very easy for us to understand. right?

  7. Hi
    There is something that I see on many blogs,but don`t how it is done.I`m really hoping you can help me:

    “You can follow …… on Twitter, join our Facebook fanpage and add me on Google+ to keep yourself updated on the latest news”

    This is a post ender on a large number of sites.I`m trying to create one but dont know ho.Also if there is a way to do it with a plugin,that would be much better for am not any really good with codes
    Thaks

  8. You can instead download and activate a simple plugin in order to get this thing done . Every WP theme is different and this code cannot be applied to all of them

    1. Agreed, but a lots of people love to tweek thier website for optimum speed. This code snippet is only for those. Thank for your feedback dear.

  9. thanks for this rajesh, will this code do the trick in functions.php?

    function remove_nofollow($string) {
    $string = str_ireplace(‘ rel=”nofollow”‘, ”, $string);
    return $string;
    }
    add_filter(‘the_content’, ‘remove_nofollow’);
    add_filter(‘comment_text’, ‘remove_nofollow’);

Leave a Reply

Your email address will not be published.

+-