A premium user asked how to remove links from comments which is the reason for publishing this code.
Add the following PHP code to your child themes functions file.
add_filter( 'comment_text', 'wp_filter_nohtml_kses' );
The code converts this link :
<a href="http://example.com" rel="nofollow">http://example.com</a>
Into this :
<p>http://example.com</p>
So its not clickable and the nofollow attribute has also been removed.
Was This Tutorial Helpful?