WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to force WP to ignore multiple whitespaces so in the frontend so there’s only one visible?

It’s because when my client writes something in the editor sometimes he enters two spaces instead of one and doesn’t notice that.

I was quite confused about the fact that multiple whitespaces aren’t ignored automatically because in the source code there is a double whitespace " " which to my mind is ignored by all browsers, not "  " or   .

share|improve this question

Not aware of a global setting to do this but you have a few options.

Use add_filter( 'the_content', 'filter_function_name' ) and replace the double spaces. Generally a bad idea because you'd have to account for the valid use of double spaces.

Install a plugin like 'After the Deadline' or similar that shows spelling and typo errors. Of course you can't force the user to accept the changes/corrections.

share|improve this answer
Thanks for your help! – user1706680 Nov 5 '12 at 21:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.