<p>I've found that this happens when you end a line or string with a space and put nothing after it.</p>

<p>"Text "<br> becomes "Text&nbsp;"</p>

<p>If you then copy "Text " and paste it repeatedly you'd end up with "Text&nbsp;Text&nbsp;Text&nbsp;Text&nbsp;Text&nbsp;Text&nbsp;"</p>

<p>Same for a lone space on a line.</p>

<p>" "<br> becomes ";nbsp"</p>

CC BY-SA 3.0
2015-02-10T15:16:03.613Z
2015-02-10T15:16:03.613Z
Andrew S
<p>This is a bug in Redactor. There has been an <a href="https://craftcms.uservoice.com/forums/285224-bugs/suggestions/11027331-redactor-2-adds-extra-non-breaking-spaces" rel="nofollow noreferrer">ongoing bug report about it here</a>.
But I found that if you use Firefox it doesn't add the non-breaking spaces when editing.</p>

<p>onebrightlight (on Slack) suggested a temporary fix to replace them with spaces in your template code: </p>

<pre><code>{{ entry.fieldname | replace({'&amp;nbsp;' : ''})|raw }}
</code></pre>

CC BY-SA 3.0
2017-02-09T10:51:36.923Z
2017-02-09T10:51:36.923Z
Paul Frost
<p>Is there any rhyme or reason to the adding of non-breaking spaces or traditional space? It seems to appear at random throughout the content in my rich text fields.</p>

CC BY-SA 3.0
2015-12-15T13:49:52.153Z
Yep I'd like to know as well how to prevent Redactor adding those pesky `&nbsp;` all over the place. Seems the problem is worse with redactor 2.
Jérôme Coupé
<redactor><richtext>
Rich text field adding &nbsp; and normal space char at random
# Rich text field adding &nbsp; and normal space char at random

(Asked by: username_0 on 2014-12-11)

Is there any rhyme or reason to the adding of non-breaking spaces or traditional space? It seems to appear at random throughout the content in my rich text fields.

**Tags:** redactor, richtext
> **Comments:**
> **username_1**: Yep I'd like to know as well how to prevent Redactor adding those pesky `&nbsp;` all over the place. Seems the problem is worse with redactor 2.  

---

## 2 answers

### Answer by username_2 on 2015-02-10. Score: 4

I've found that this happens when you end a line or string with a space and put nothing after it.

"Text "  
 becomes "Text "

If you then copy "Text " and paste it repeatedly you'd end up with "Text Text Text Text Text Text "

Same for a lone space on a line.

" "  
 becomes ";nbsp"


---

### Answer by username_3 on 2017-02-09. Score: 1

This is a bug in Redactor. There has been an ongoing bug report about it here.
But I found that if you use Firefox it doesn't add the non-breaking spaces when editing.
onebrightlight (on Slack) suggested a temporary fix to replace them with spaces in your template code: 
{{ entry.fieldname | replace({' ' : ''})|raw }}


---

