Is there any way to do it with striptags only or we have to use another filter?

1 Answer 1


You can simply use striptags filter which removes all HTML tags. But if you want an html tag to be not removed by striptags so you can pass it as argument, then It removes other tags except the ones you pass in.

In other words, if you don’t  want to remove tag, just use it in this way:

{{entry.content|striptags('<strong>') | raw }}

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.