Posted By

chrisaiv on 09/13/14


Tagged

wordpress


Versions (?)

Wordpress: Disallow HTML in Comments


 / Published in: PHP
 

URL: http://www.labnol.org/internet/wordpress-optimization-guide/3931/

Disallow HTML in WordPress comments, add this snippet to your functions.php file.

  1. /** ******** ******** ******** ******** ******** ******** ******** ********
  2. * TITLE: Disable HTML in WordPress comments
  3. * DESCRIPTION: Disallow HTML in WordPress comments, add this snippet to your functions.php file.
  4. *
  5. * http://www.labnol.org/internet/wordpress-optimization-guide/3931/
  6. */
  7. add_filter( 'pre_comment_content', 'wp_specialchars' );

Report this snippet  

You need to login to post a comment.