8

I need a filter for the "Full HTML" input format that allows me to strip specific tags. I want to allow all HTML tags, except the ones specified in the input format options.

I am using Drupal 7.

6

You can get that functionality out of the box with the HTML Purifier module.

Once you've installed the module, go to the admin/config/content/formats page, choose the text format you want to edit, and select the "HTMLPurifier" checkbox. In the settings below, quite a bit further down the page, you'll find the ForbiddenElements textarea:

enter image description here

That's where you need to put your disallowed tags. It's probably worth looking at the rest of the settings to make sure they match up with your expectations (there are a lot of them though, HTMLPurifier is pretty configurable).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.