Categories
Wordpress

How To Disable HTML In WordPress Comments

How To Disable HTML In WordPress Comments

In this tutorial we will explain you How To Disable HTML In WordPress Comments.We are also using WordPress as a blogging option, but sometime we have lots of comments which consist of HTML tags on it.To solve this we just have to put a single line of code on our functions.php file.

By adding that line we disallow readers to input HTML tags on our comment box.

Code:

add_filter( 'pre_comment_content', 'wp_specialchars' );

Add above code in your functions.php file and enjoy.