Soft Hyphenate
Adds soft hyphens to titles and content from a list of words you keep, so long names break cleanly where the browser won’t break them.
WordPress 6.7 or later · PHP 7.4 or later · GPL v2 or later
What it does
Browsers hyphenate for themselves when a stylesheet asks with hyphens: auto, but Chrome and Firefox leave capitalized words alone. So a department’s name or a place name in a heading runs out of its column on a phone, where a plain word would have broken. Soft Hyphenate puts the break points in for the words you choose.
It adds a soft hyphen, the invisible one, to titles and content as they are shown. The word reads as itself until it has to break at the edge of its box; then the browser breaks it at the point you marked and shows a hyphen there. Nothing is written into the post.
How it works
Under Settings, Soft Hyphenate takes a list of words, one to a line, with a hyphen wherever the word may break:
Ac-cred-i-ta-tion
In-ter-dis-ci-pli-nary
Su-per-in-ten-dentCode language: plaintext (plaintext)
On the front end the plugin looks through each title and each post’s content for those words and puts a soft hyphen at every mark. In the page’s source the word carries them; on the screen it looks as it always did until a narrow column needs one.
That’s the whole plugin. There is no algorithm guessing at the rest of the dictionary, because the browser already does that part well.
Good for
- Headings with long names in them. Departments, programs, places, and titles, which are capitalized and so left alone by the browser.
- Narrow columns. Sidebars, cards, and phones, where one long word decides whether the layout holds.
- A site that already uses the browser’s hyphenation and needs a few words it misses.
What to know
- It is curated, not automatic. Only the words on the list are touched. For hyphenation of everything, a plugin like wp-Typography is the heavier tool.
- It works with the browser’s own hyphenation, not instead of it. Keep
hyphens: autoon and let the list cover what the browser won’t. - The stored post is unchanged. The hyphens go in as the page is shown, so editing and search see the plain word.
- Soft hyphens travel with copied text. They stay invisible in most places, but a word pasted into a search box carries them.