Hyphens, en dashes and em dashes in WordPress — and what wptexturize does
Few writers type real dashes. They type - or -- and let the software sort it out. WordPress does sort some of it out — but only on display, only in some places, and not always the way your language requires. This guide explains the three marks, what WordPress does with them, and when it is worth fixing the text itself.
Contents
Hyphen, en dash, em dash
| Mark | Use | Example |
|---|---|---|
Hyphen - | Joins words | well-known, e-mail |
En dash – | Ranges; a spaced dash in British style and in French | 9–5, 2020–2024 |
Em dash — | A break in a sentence (US style, unspaced); the standard dash in Ukrainian and Russian (spaced) | It was late—too late. |
What WordPress does: wptexturize
When WordPress displays post content, titles, excerpts and comments, it runs them through wptexturize(), which converts typewriter characters into typographic ones. For dashes, current WordPress versions do this:
| You type | Visitors see |
|---|---|
word---word | em dash — (word—word) |
word -- word (spaced) | em dash — (word — word) |
word--word | en dash – (word–word) |
word - word (spaced) | en dash – (word – word) |
The dashes are translatable, so a site language can change them, and plugins or themes can switch the whole conversion off with the run_wptexturize filter. Text inside <code>, <pre>, scripts and similar elements is left untouched.
So for an English blog that renders through the theme, -- in the content usually looks fine to readers.
Where the conversion does not happen
The stored text still contains hyphens, and everything that reads it without wptexturize shows them as typed:
- The editor — writers and reviewers see
--. - The REST API raw content, headless front ends and mobile apps that render it themselves.
- SEO titles and meta descriptions built by plugins, social previews, e-mail newsletters and exports, depending on how each tool reads the text.
- Sites that disable wptexturize, which some themes and performance plugins do.
Why it matters more in some languages
The spaced-hyphen rule turns word - word into an en dash. That matches British and French usage, but not Ukrainian or Russian, where the dash between words is a spaced em dash:
- Russian:
Москва - столица Россииis displayed asМосква – столица(en dash), while the correct form isМосква — столица. - Ukrainian:
Київ - столиця України→ should beКиїв — столиця.
On Ukrainian and Russian sites, the only way to get the right dash everywhere is to store it in the text.
Fixing dashes in the content
Content Polisher fixes dashes in the stored text, using the conventions of each post's language:
word -- wordbecomes a spaced dash — an em dash in English, Ukrainian and Russian, an en dash in French — as a safe fix.- In Ukrainian, Russian and French, a spaced hyphen between words becomes a dash (
Москва - столица→Москва — столица), also a safe fix. word--wordand dashes without the spaces a language requires are suggested for review.- Hyphens in compound words, number ranges, URLs and code are left alone.
Each post is checked in its own language — from Polylang or WPML, or detected from the text — so a bilingual site gets the right dash in every post. See the rules reference.