<p>I came upon this issue when wrapping copy with a span tag in order to style it differently. The span tag was removed when I saved the entry.</p>

<p>By design, Redactor removes span tags that don't have attributes. The fix is to edit the Redactor config file and add the <a href="http://imperavi.com/redactor/docs/settings/clean/#setting-removeWithoutAttr" rel="nofollow"><strong>removeWithoutAttr</strong></a> config as an empty array.</p>

<pre><code>removeWithoutAttr: []
</code></pre>

<p>This prevents tags without attributes from being removed by Redactor.</p>

CC BY-SA 3.0
2015-09-29T02:56:06.353Z
2015-09-29T03:05:02.693Z
2015-09-29T03:05:02.693Z
Anna_MediaGirl
<p>If you are using a custom redactor config (defined in /craft/config/redactor) and it has <code>allowedTags</code> in the configuration, that list of allowed tags will need to include span</p>

CC BY-SA 3.0
2014-09-11T16:12:41.010Z
Sorry to circle back so late. Auto notifications weren't on. We don't have anything defined there, so that's not the case. Any other thoughts?
CFA
CC BY-SA 3.0
2014-09-11T19:31:05.797Z
@Chris sorry, no other thoughts
Marion Newlevant
CC BY-SA 3.0
2014-10-26T02:55:24.423Z
Maybe the [removeEmpty](http://imperavi.com/redactor/docs/settings/clean/#setting-removeEmpty) setting will help
Marion Newlevant
CC BY-SA 3.0
2014-08-13T21:05:07.437Z
2014-08-13T21:05:07.437Z
Marion Newlevant
<p>Best I can figure it's either:</p>

<ol>
<li>A Redactor bug</li>
<li>A known behavior and Redactor just <em>really</em> doesn't like <code>&lt;span&gt;&lt;/span&gt;</code> tags.</li>
</ol>

<p>Even if you explicitly set Redactor's <a href="http://imperavi.com/redactor/docs/settings/#set-allowedTags" rel="nofollow">allowedTags</a> config setting to include span, they will strip it out simply swapping between source and rendered view, whereas any other tag I set in that list will be allowed as expected.</p>

CC BY-SA 3.0
2014-09-15T23:01:04.590Z
2014-09-15T23:06:48.810Z
2014-09-15T23:06:48.810Z
Brad Bell
<p>We've unchecked the clean HTML feature on a few rich text fields but our attempts to add some html (span tags) keep getting cleaned out. Is there another setting we should be looking for?</p>

<field><richtext>
Unchecking Rich Text option to clean up HTML still cleaning?
# Unchecking Rich Text option to clean up HTML still cleaning?

(Asked by: username_0 on 2014-08-13)

We've unchecked the clean HTML feature on a few rich text fields but our attempts to add some html (span tags) keep getting cleaned out. Is there another setting we should be looking for?

**Tags:** field, richtext

---

## 3 answers

### Answer by username_1 on 2015-09-29. Score: 3

I came upon this issue when wrapping copy with a span tag in order to style it differently. The span tag was removed when I saved the entry.
By design, Redactor removes span tags that don't have attributes. The fix is to edit the Redactor config file and add the removeWithoutAttr config as an empty array.
removeWithoutAttr: []

This prevents tags without attributes from being removed by Redactor.


---

### Answer by username_2 on 2014-08-13. Score: 2

If you are using a custom redactor config (defined in /craft/config/redactor) and it has `allowedTags` in the configuration, that list of allowed tags will need to include span

> **Comments:**
> **username_0**: Sorry to circle back so late. Auto notifications weren't on. We don't have anything defined there, so that's not the case. Any other thoughts?  
> **username_2**: @Chris sorry, no other thoughts  
> **username_2**: Maybe the [removeEmpty](http://imperavi.com/redactor/docs/settings/clean/#setting-removeEmpty) setting will help  

---

### Answer by username_3 on 2014-09-15. Score: 1

Best I can figure it's either:

1. A Redactor bug
2. A known behavior and Redactor just *really* doesn't like  tags.

Even if you explicitly set Redactor's [allowedTags](http://imperavi.com/redactor/docs/settings/#set-allowedTags) config setting to include span, they will strip it out simply swapping between source and rendered view, whereas any other tag I set in that list will be allowed as expected.


---

