What invisible characters do to a CMS

What goes wrong

A published URL 404s even though the slug looks right. Search on your own site cannot find an article you know exists. A headline renders with an odd gap in one template and not another. Each of these traces back to a character in the copy.

Copy arrives from writers, from documents, and increasingly from assistants, and it carries whatever came with it. A slug generated from a headline containing a non-breaking hyphen is not the slug you think it is. A zero-width space inside a title breaks the search index entry for that word. Exotic spaces render at different widths depending on the font a template uses, which is why the gap appears in one place and not another.

What to do about it

Clean at the point of paste, before the CMS derives anything from the text. That matters more than cleaning afterwards, because a slug, a search index entry and a social card are generated once from whatever was there at the time, and fixing the article later does not always regenerate them.

Questions

Why does the slug break rather than just look odd?

Slug generation usually strips or transliterates characters it does not recognise, so an invisible one can silently vanish or become a separator, and the result no longer matches the link you published.