One thing that will work is:
add_filter ("comment_text ", "my_filter_function");
function my_filter_function ($content) {
return strip_tags ($content);
}
That will remove all HTML tags from the comment text before it’s displayed on the site. Please note that it doesn’t remove the tags from what’s submitted or stored in your DB, it jsut keeps things clean on the public-facing side of your site.
Thank you very much for your suggestion, catacaustic 🙂
The “problem” is this: when I upgrade WordPress I edit the kses.php to fit my needs; removing some allowed tags and add some. Editing WPs core files is never a good idea, so I hoped there was a way to do this via a php snippet in the functions.php file.
Have a look at the function that does what you are looking for in the kses.php file and see if there’s any calls to do_filter()
. If there is take note of the filter that’s being called and set up your own filter in your functions.php file. If there’s no filters there you could try and go through the process tree to find out where things come after this and see if there’s any filters available further down the track, but that’s going to be hard going.
Thanks again, catacaustic 🙂
I will digg a little more into it and see if I can find a solution. Was hoping that someone else already had a solution to it 😉