Hi,
We should need to create a new function to modify the default comment author link output. Do it in a child theme’s functions.php file. Create it, in case you don’t have it yet.
Then add the following PHP code into child theme’s functions.php file.
add_filter('get_comment_author_link', 'prefix_fashionistas_dofollow_author_comment', 10);
function prefix_fashionistas_dofollow_author_comment(){
$comment = get_comment($comment_ID);
$url = get_comment_author_url( $comment_ID );
$author = get_comment_author( $comment_ID );
$rel = 'nofollow';
if ( $comment->user_id > 0 && $user = get_userdata( $comment->user_id ) ) {
$rel = 'dofollow';
}
if ( empty( $url ) || 'https://' == $url )
$return = $author;
else
$return = "<a href='$url' rel='external ".$rel."' class='url'>$author</a>";
return $return;
}
I hope it helps.