Add this to your plugin file/theme’s functions.php:
remove_filter( 'pre_comment_content', 'wp_rel_nofollow', 15 );
You could then add your own filter to pre_comment_content
to use wp_rel_nofollow
selectively, based on your criteria.
URLs that are automatically made clickable from plain-text urls like example.com
aren’t filterable in a way that allows removing of the rel="nofollow"
attribute. The only solution for those is filtering comment_text
or removing the auto-adding of links entirely:
remove_filter( 'comment_text', 'make_clickable', 9 );