Remove automatic or clickable links from WordPress comments

Remove automatic or clickable links from WordPress comments

Whenever someone leaves a comment with a URL (eg. www.w3bits.com) on your WordPress site, it gets automatically converted to a clickable link. Sometimes it may lead to SPAM even when you’ve HTML disabled for comments. And if you realized today that there has been a lot of comments that contain such clickable links, you might have a headache, how to remove or disable those unwanted auto links!

Such auto links bear a nofollow relationship attribute in general. But still, your potential visitors may visit those links and a link spam may discourage their reading.

Well, there’s a way to get rid of such auto links in your WordPress comments, even from your existing comments in the past posts. All you need to do is add the below code in your functions.php just before the closing PHP tag, i.e. ?> and save the changes:

remove_filter( 'comment_text', 'make_clickable', 9 );

Now, you won’t see any automatic clickable links anymore in comments on your WordPress site.