Disable HTML in WordPress Comments
WordPress comes with a lot of incredible functions, mostly ignored by website designers. One that makes a big difference for cutting down on unwanted comments is the ability to filter out content you don’t want posted.
For example, you can filter all HTML out of your comments (that includes formatting as well as links) simply by adding this code to your functions.php file:
<?php
add_filter('comment_text', 'filterComment ');
add_filter('comment_text_rss', 'filterComment ');
add_filter('comment_excerpt', 'filterComment ');
function filterComment ($contentToFilter) {
return strip_tags($contentToFilter);
}
?>
You’ll notice, as with many of my WordPress tutorials, that at its core the platform is basic PHP with some pretty awesome custom functions that make integration with complex PHP scripts a snap.

1 Comment
Tweets that mention Tutorials :: Disable HTML in WordPress Comments » Christopher Ross — Topsy.com
[...] This post was mentioned on Twitter by Christopher Ross, WordPress News. WordPress News said: Disable HTML in WordPress Comments http://bit.ly/ezAo7t [...]
Leave a Comment