Removing P tag's in rich text area's Before you think this has already been answered, yes it is but I can't manage to get that fix working so I'm looking for another one.

I have a "title" field in a couple of my matrix blocks but my client want's to add a Bold word every now and then. Now I tried that with a rich text field which works fine except that it keeps adding a &lt;p&gt; tag to my text which makes the Indexing go wrong etc plus it shouldn't be so hard to remove but apparently it is...

This is my custom json at the moment:

{
    buttons: ['bold', 'italic'],
    maxHeight: 50,
    paragraphize: false,
    replaceDivs: false,
    linebreaks: true,
    enterKey: false
}


In every fix I find here this should do it but somehow it wont..
Seems like a simple striptags filter would do nicely in this case:

&lt;h1&gt;{{ entry.titleField|striptags('&lt;strong&gt;&lt;em&gt;&lt;br&gt;')|raw }}&lt;/h1&gt;


If you're having issues with linebreaks, you might want to add the nl2br filter as well:

&lt;h1&gt;{{ entry.titleField|striptags('&lt;strong&gt;&lt;em&gt;&lt;br&gt;')|raw|nl2br }}&lt;/h1&gt;