<p>To prevent Rich Text fields from stripping your ID attributes, you'll need to <a href="https://craftcms.com/docs/rich-text-fields#settings" rel="nofollow">disable the "Purify HTML?" setting</a> for your field.</p>

<p>Note that disabling the HTML purifier does represent a potential security risk, but as long as you trust your content editor(s), you should be fine.</p>

CC BY-SA 3.0
2016-09-06T09:05:26.903Z
2016-09-06T09:05:26.903Z
Mats Mikkel Rummelhoff
<p>I'm using the plugin Redactor Extras <a href="https://github.com/elliotlewis/Redactor-Extras" rel="nofollow">https://github.com/elliotlewis/Redactor-Extras</a> as I need be able to insert IDs to then anchor link to them.</p>

<p>However I'm finding the plugin adds the IDs as it should but on save they get stripped out. Oddly this plugin also allows you to add Classes which seems to be working but is still a bit temperamental.</p>

<p>Are there any settings I could try for Redactor to stop it doing this?</p>

CC BY-SA 3.0
2016-09-06T08:44:46.590Z
Have you tried turning off the "Purify HTML?" setting for your Rich Text field?
Mats Mikkel Rummelhoff
CC BY-SA 3.0
2016-09-06T08:56:31.633Z
That does work! Although the warning puts me off doing this as a long term solution. I guess if there's no other way.
sarah3585
CC BY-SA 3.0
2016-09-06T09:03:12.687Z
Excellent. I'll add a real answer.
Mats Mikkel Rummelhoff
<redactor>
Redactor removing IDS
# Redactor removing IDS

(Asked by: username_0 on 2016-09-06)

I'm using the plugin Redactor Extras <https://github.com/elliotlewis/Redactor-Extras> as I need be able to insert IDs to then anchor link to them.

However I'm finding the plugin adds the IDs as it should but on save they get stripped out. Oddly this plugin also allows you to add Classes which seems to be working but is still a bit temperamental.

Are there any settings I could try for Redactor to stop it doing this?

**Tags:** redactor

> **Comments:**
> **username_1**: Have you tried turning off the "Purify HTML?" setting for your Rich Text field?  
> **username_0**: That does work! Although the warning puts me off doing this as a long term solution. I guess if there's no other way.  
> **username_1**: Excellent. I'll add a real answer.  

---

## 1 answers

### Answer by username_1 on 2016-09-06. Score: 3 | Accepted answer

To prevent Rich Text fields from stripping your ID attributes, you'll need to [disable the "Purify HTML?" setting](https://craftcms.com/docs/rich-text-fields#settings) for your field.

Note that disabling the HTML purifier does represent a potential security risk, but as long as you trust your content editor(s), you should be fine.


---

