Add rel=nofollow to Comment Reply Links

This document is deprecated! The information on this page refers to a Thesis version that is now obsolete. Please visit the Thesis Docs for current documentation.

If you allow threaded comments on your blog, you no doubt have noticed the extra “Reply” links which appear on each & every comment on your site.

In order to prevent them from passing unnecessary link juice, you should consider adding rel="nofollow" to them.

This is very easy to do, and it involves adding a few lines of code to your custom_functions.php file:

# rel="nofollow" for Comment Reply
function custom_comment_reply_link_nofollow( $link ) {
	global $user_ID;

	# Registration required login link is already nofollowed
	if ( get_option( 'comment_registration' ) && ! $user_ID )
		return $link;
	# Add nofollow otherwise
	else
		return str_replace( '")\'>', '")\' rel=\'nofollow\'>', $link );
}
add_filter( 'comment_reply_link', 'custom_comment_reply_link_nofollow' );

Save & upload your file (and flush any cache which you may be using). That’s it! Google and other search engines should now happily ignore the multitudes of “Reply” links which may appear on your site.