Remove tags from the kses filter

I know one can modify the kses filter to add new allowed tags to it, but is there a way to remove some of them? I can’t find how. I need to disallow DIV tags.

Any ideas?

Thanks

1 Answer
1

The allowed tags are stored in $allowedposttags (located in /wp-includes/kses.php) as an array. For each element it looks something like this:

$allowedposttags = array(
  'div' => array(
    'align' => true,
    'dir' => true,
    'lang' => true,
    'xml:lang' => true,
  )
);

You can remove a single element of an array via unset

unset($allowedposttags['div']);

Leave a Comment