HTML in Comments


You can disallow HTML code in WordPress comments by adding the following code to the child theme’s functions.php file anywhere after the first line. WordPress will strip out any HTML tags and disable the linking capability of web addresses. This helps to increase the security of your site. It’s optional.

add_filter('comment_text','wp_filter_nohtml_kses');
add_filter('comment_text_rss','wp_filter_nohtml_kses');
add_filter('comment_excerpt','wp_filter_nohtml_kses');

Instead of putting this code into the functions.php file of your child theme, you could create a
site-specific plugin.