Nach dem ich im Artikel You Big Blog ist DoFollow Blog offiziell ankündigte, habe paar Kommentare von Lesern gekriegt, wie ich das gemacht habe, fragen möchte ich beantworten. Klar es gibt einfache Methoden, Dofollow Plugin oder NoFollow Free Installieren, einstellen und das wars.
Ich bin ein absolute Plugin Minimalist und wenn ohne Plugin gehen kann, dann nutze dies.
functions.php findet man in → wp-admin → Aktuelles Theme Desing → Editor
wordpress tool

/*------------------------------------------------*/
/* nofollow-Attribut ganz Deaktivieren
/*-----------------------------------------------*/

function strip_nofollow($ret) {

$ret = str_replace(“rel=’external nofollow’”,”rel=’external’”, $ret);

return $ret;

}

add_filter(‘get_comment_author_link’, ‘strip_nofollow’);

/*------------------------------------------------*/
/* Dofollow ab dem dritten Kommentar
/*-----------------------------------------------*/

function strip_nofollow($ret) {

global $wpdb, $comment;

$queryString=”SELECT COUNT(*) as comments FROM “.$wpdb->comments.” WHERE comment_author_url=’”.$wpdb->escape($comment->comment_author_url).”‘”;

$comments_count = $wpdb->get_var($queryString);

if ($comment->comment_type == “pingback” || $comment->comment_type == “trackback”) {

$ret = str_replace(“rel=’external nofollow’”,”rel=’external’”, $ret);

return $ret;

}

if ($comments_count >= 3) {

$ret = str_replace(“rel=’external nofollow’”,”rel=’external’”, $ret);

return $ret;

} else {

return $ret;

}

}

add_filter(‘get_comment_author_link’, ‘strip_nofollow’);
/*------------------------------------------------*/
/* Dofollow ab dem dritten Kommentar plus manuelles dofollow
/*-----------------------------------------------*/
function strip_nofollow($ret) {

global $wpdb, $comment;

$queryString=”SELECT COUNT(*) as comments FROM “.$wpdb->comments.” WHERE comment_author_url=’”.$wpdb->escape($comment->comment_author_url).”‘”;

$comments_count = $wpdb->get_var($queryString);

if ($comment->comment_type == “pingback” || $comment->comment_type == “trackback”) {

$ret = str_replace(“rel=’external nofollow’”,”rel=’external’”, $ret);

return $ret;

}

$cmntURL = $comment->comment_author_url;

$dontfollow_link = stristr($cmntURL, ‘dontfollow’);

if ($comments_count >= 3 && $dontfollow_link === FALSE) {

$ret = str_replace(“rel=’external nofollow’”,”rel=’external’”, $ret);

return $ret;

} else {

$ret = str_ireplace(“/dontfollow”, “/”, $ret);

return $ret;

}

}

add_filter(‘get_comment_author_link’, ‘strip_nofollow’);