Wordpress: Disallow HTML in Comments


/ Published in: PHP
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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' );

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.