How To: DoFollow/NoFollow

By default WordPress makes most of the links nofollow, this in many ways is beneficial to your blog and doesn’t hinder you much in the way of SEO.

But this isn’t always what blog owners want, so today I will show you how to make Blogroll Links nofollow as they are dofollow by default, and make blog comments dofollow as they are nofollow by default.

This snippets will be added to your sites functions.php page, so backup before making any changes.

Make Blogroll Links NoFollow

function no_follow( $links ) {
foreach($links as $link) {
$link->link_rel .= ' nofollow';
$link->link_rel = trim($link->link_rel);
return $links;
add_filter('get_bookmarks', 'no_follow');

Make Comment Links DoFollow

function do_follow($string) {
$string = str_ireplace(' rel="nofollow"', '', $string);
return $string;
add_filter('comment_text', 'do_follow');

Whats The Point?

Not everyone wants blogroll links getting link juice from their blog, or they might feel the links are not relevant to their niche and may hinder them in SEO and SERPS.

The other end is some blog owners might want to offer dofollow comment links as a way to encourage readers to post comments.

At the end of the day its personal preference to your blog and the way you run it, these snippets are easy to add and remove and solves a problem if you feel you have one.

You Might Also Like