<p>Seems like a simple <a href="http://twig.sensiolabs.org/doc/filters/striptags.html" rel="nofollow"><code>striptags</code></a> filter would do nicely in this case:</p>

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

<p>If you're having issues with linebreaks, you might want to add the <a href="http://twig.sensiolabs.org/doc/filters/nl2br.html" rel="nofollow"><code>nl2br</code></a> filter as well:</p>

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

CC BY-SA 3.0
2016-10-19T12:44:25.323Z
Didn't know this was a thing. To add something on it.  Use `|raw` behind the 'striptags()' Function if you also include `<a>` tags or else they show the entire tag. Atleast on my end.
Justin Dekkers
CC BY-SA 3.0
2016-10-19T12:45:47.470Z
You're absolutely right, @JustinDekkers – I'll add the `|raw` filter to my answer. Thanks!
Mats Mikkel Rummelhoff
CC BY-SA 3.0
2016-10-17T19:29:33.927Z
2016-10-19T12:46:00.153Z
2016-10-19T12:46:00.153Z
Mats Mikkel Rummelhoff
<p>Another option would be to use <a href="https://github.com/pixelandtonic/Parsedown" rel="nofollow">Parsedown</a> to add formatting:</p>

<pre><code>{{entry.titleField|pd('line')}}
</code></pre>

CC BY-SA 3.0
2016-10-19T16:22:30.580Z
2016-10-19T16:22:30.580Z
Marion Newlevant
<p><strong>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.</strong></p>

<p>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 <code>&lt;p&gt;</code> tag to my text which makes the Indexing go wrong etc plus it shouldn't be so hard to remove but apparently it is...</p>

<p>This is my custom json at the moment:</p>

<pre><code>{
    buttons: ['bold', 'italic'],
    maxHeight: 50,
    paragraphize: false,
    replaceDivs: false,
    linebreaks: true,
    enterKey: false
}
</code></pre>

<p>In every fix I find here this should do it but somehow it wont..</p>

CC BY-SA 3.0
2016-10-17T18:22:37.067Z
Can you link to the similar solutions which you have already tried?
Lindsey D
<templating><redactor><richtext><json>
Removing P tag's in rich text area's
# Removing P tag's in rich text area's

(Asked by: username_0 on 2016-10-17)

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  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..

**Tags:** templating, redactor, richtext, json
> **Comments:**
> **username_1**: Can you link to the similar solutions which you have already tried?  

---

## 2 answers

### Answer by username_2 on 2016-10-17. Score: 5 | Accepted answer

Seems like a simple striptags filter would do nicely in this case:
{{ entry.titleField|striptags('')|raw }}

If you're having issues with linebreaks, you might want to add the nl2br filter as well:
{{ entry.titleField|striptags('')|raw|nl2br }}

> **Comments:**
> **username_0**: Didn't know this was a thing. To add something on it.  Use `|raw` behind the 'striptags()' Function if you also include `<a>` tags or else they show the entire tag. Atleast on my end.  
> **username_2**: You're absolutely right, @JustinDekkers – I'll add the `|raw` filter to my answer. Thanks!  

---

### Answer by username_3 on 2016-10-19. Score: 1

Another option would be to use Parsedown to add formatting:
{{entry.titleField|pd('line')}}


---

