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

Does anyone know why wordpress converts some html entities to their numeric equivalents?

I've found that in some posts, where a non-breaking space   entity would be appropriate, wordpress uses   instead.

Seems to me that using the symbolic version of the entity would be better than a numeric version.

The routine that this is being done in (appears to be) ent2ncr in wp-includes/formatting.php.

When I converted my blog from a single site to multi-site (different install & database), the numeric entities were not converted properly (possibly due to a database difference). Had the symbolic entities been used, I doubt this would have been a problem.

share|improve this question
Ok so disregard last comment your post was edited when i was typing. That is a good question. – xLRDxREVENGEx May 20 '11 at 17:13
up vote 6 down vote accepted

In XHTML entities are not part of the DTD, and user agents are not required to support them. Exceptions: &, <, >, " and '.

To keep WordPress X(HT)ML compatible numeric references are used instead.

share|improve this answer
That makes since. back to the old days instead i guess with that format. – xLRDxREVENGEx May 20 '11 at 17:22
Seems like a step backwards to me, but oh well. – david Jun 4 '11 at 19:00

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.