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?


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.


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

  • 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
    Sep 11 '14 at 16:12
  • @Chris sorry, no other thoughts Sep 11 '14 at 19:31
  • Maybe the removeEmpty setting will help Oct 26 '14 at 2:55

Best I can figure it's either:

  1. A Redactor bug
  2. A known behavior and Redactor just really doesn't like <span></span> tags.

Even if you explicitly set Redactor's 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.

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.