Hyphenation is finally available for the web. The addition of hyphenation is a significant step forward for the state of web typography. With it your left aligned text will be less ragged, and your justified text will avoid the ghastly word spacing that has prevented serious web designers from using it.
wp-Hyphenate includes tremendous ability to customize its application of hyphenation and adds features aid browsers to properly wrap long urls and keep widows company (a widow is the last word of a block of text that stands alone on the last line).
FAQs
- Why hyphenate?
- Hyphenation increases the visual appeal of your website. When justifying text without hyphenation, word spacing is distractingly large. With left-aligned text, the right edge will be unnecessarily ragged.
- How does hyphenation work?
-
The soft-hyphen is an invisible character that communicates to web browsers allowable line breaks within words. When a web browser wraps a line at a soft-hyphen, a hyphen is shown at line’s end.
Similar to the soft-hyphen, the zero-space character communicates allowable line breaks within strings of text. But unlike the soft-hyphen, it does not show a hyphen at line’s end. This is ideal for forcing consistent wrapping of long URLs. It also can be used to force line breaks in uncooperative web browsers after hard-hyphens in words like “zero-space” and “soft-hyphen”.
- Which browsers support hyphenation?
-
Not all browsers support online hyphenation. Notably, before version 3, Firefox did not support hyphenation. Fortunately, it failed gracefully — hyphenated text displayed as if it was unhyphenated.
That is more than could be said for early versions of Safari (1.2 and earlier). Those versions of Safari displayed a hyphen at every possible hyphenation point — even if it was not at line’s end. wp-Hyphenate includes an option to strip all hyphenation from early version of Safari using JavaScript.
Starting with Internet Explorer 6, Firefox 3, Safari 2, and Opera 8, all major web browsers have offered full support for online hyphenation.
- Does hyphenation effect search?
- It depends on the search engine. Google and Yahoo properly handle the soft-hyphen character without penalty. Microsoft and Ask improperly treat soft-hyphens as word breaks. Fortunately, Google and Yahoo comprise more than 90% of the search market.
- Can I control how a specific word is hyphenated?
- Yes. The administrative panel for wp-Hyphenate includes an editable exceptions list.
- What are widows and why protect them?
-
A widow is the final word in a block of text that falls to its own line. Especially if the widow is only a few characters long, she can get lonely. wp-Hyphenate will try to protect widows by bringing them company from the previous line.
There is danger that the widow’s company will leave the previous line with less than optimal word spacing. The risk is less if your text is left-aligned, but if it is justified, tread carefully. The protection of widows is completely customizable in the administrative options.
- Is there any other implementation of this HTML hyphenation technology?
- Yes. KINGdesk has also implemented this same technology as a simple web app at http://hyph-n.com. Submit your static HTML in the provided web form, and it will return hyphenated results for your use.
- Does wp-Hyphenate work with the Typogrify plugin?
- Yes. However, they will both try to prevent widows. Widow handling should be turned off in the Typogrify administrative options. The wp-Hyphenate handling of widows allows for more granular control, allowing the user to balance widow handling with the additional word-spacing created on the previous line.
- What hyphenation algorithm is used in wp-Hyphenate?
- The hyphenation algorithm used by wp-Hyphenate is based on the 1983 Stanford Ph.D. thesis of professor Frank Liang: Word Hy-phen-a-tion by Com-puter. Liang’s PatGen algorithm was updated in 1991 by Peter Breitenlohner. The resulting algorithm finds 90% of all allowed hyphenation points identified in the Webster’s Unabridged Dictionary with a 0% error rate.
- What language patterns are included with this library?
- wp-Hyphenate now has multi-language support. Pattern libraries are included for Basque, Bulgarian, Catalan, Chinese, Pinyin (Latin), Croatian, Czech, Danish, English (United Kingdom), English (United States), Estonian, Finnish, French, Galician, German, Greek (Ancient), Greek, Modern Monotonic, Greek, Modern Polytonic, Icelandic, Indonesian, Interlingua, Irish, Italian, Latin, Lithuanian, Mongolian (Cyrillic), Polish, Portuguese, Romanian, Russian, Sanskrit, Serbian (Cyrillic), Serbocroatian (Cyrillic), Serbocroatian (Latin), Slovak, Slovenian, Spanish, Swedish, Turkish, Ukrainian, and Welsh.
- Can I port this plugin to another CMS?
- Yes. wp-Hyphenate is licensed under the GNU General Public License 2.0. If modify it, you must retain the KINGdesk, LLC copyright information, the request for a link to http://kingdesk.com, and the web design services contact information unchanged. If you redistribute this software, or any derivative, it must be released under the GNU General Public License 2.0.
- Will this plugin slow my page loading times?
- Yes. There is a fair amount of processing that takes place every time a post is called from your MySQL database. In our internal tests, we have seen one-half a second added to single post pages, and over 1 second added to multi-post pages. While page load times will likely remain acceptable to your users, it is still recommended that you use a caching plugin (like WP-Cache or WP Super Cache) with wp-Hyphenate. There is no delay in the serving of cached pages.
- Can I make a donation to support this plugin?
- No. We don’t want your money. If you want to show your support, we would greatly appreciate a link to kingdesk.com from your website — perhaps in a nice review of this plugin.
- This site is damn sexy. Can I hire KINGdesk to design a website for my company?
- Yes. Please contact us.
Version History
- Version 1.07 beta, November 25, 2008
- Worked around last multibyte string function from English hyphenation to address obscure encoding error
- Version 1.06 beta, November 25, 2008
- Provided for single byte alphabets to not use multibyte string functions to increase performance
- Now runs 43% faster for English hyphenation
- Internationalized text in admin options
- Properly removes multiple links that may have been improperly included by the URL linking functionality
- Simplified dehyphen.js to only remove zero-width spaces from IE6
- Version 1.05 beta, November 10, 2008
- Inserted actual soft-hyphen and zero-width space characters, rather than their HTML representations. This cleans up the appearance of the source code.
- Removed errant auto-linking of URLs in the HTML title attribute
- Excluded hyphenation, URL wrapping and widow protection from feeds
- Corrected error to allow zero-width spaces to be stripped from IE6 via JavaScript
- Forced wrapping after underscore characters in the midst of words
- Corrected hyphenation of words containing select non-Latin characters
- Version 1.04 beta, November 16, 2008
- Shortened the default string length for the hyph_chunkSubject function from 4000 characters to 3000. This cured an issue where some text was being dropped (depending on server configuration).
- Unlinked urls now link automatically when the “Always Link URLs” option is selected in the Admin options.
- Version 1.03 beta, November 9, 2008
- General code clean-up to separate core functionality for easy porting to php based content management systems
- Added simple validation for user defined list of tags whose content should not be hyphenated
- Updated all calculations to properly handle multibyte characters as required for multi-language
- Added multi-language support and hyphenation patterns for the following languages: Basque, Bulgarian, Catalan, Chinese, Pinyin (Latin), Croatian, Czech, Danish, English (United Kingdom), English (United States), Estonian, Finnish, French, Galician, German, Greek (Ancient), Greek, Modern Monotonic, Greek, Modern Polytonic, Icelandic, Indonesian, Interlingua, Irish, Italian, Latin, Lithuanian, Mongolian (Cyrillic), Polish, Portuguese, Romanian, Russian, Sanskrit, Serbian (Cyrillic), Serbocroatian (Cyrillic), Serbocroatian (Latin), Slovak, Slovenian, Spanish, Swedish, Turkish, Ukrainian, and Welsh.
- Version 1.02 beta, November 5, 2008
- Resolved problem where occasional character was dropped in long posts.
- Version 1.01 beta, November 4, 2008
- Removed all new PHP 5 functions and replaced with code that is compatible with PHP version 4.3 and later .
- Version 1.0 beta, November 1, 2008
- Original Release
Your feedback is much appreciated. How can we make this plugin better?


John • 3:33 am on Nov. 3, 2008
Sounds like it’ll be a neat plugin. I’m getting a Fatal error in wp-hyphenate.php on line 53 at the moment though
Morgante Pell • 5:12 pm on Nov. 3, 2008
What license do you have this under?
I would love to port it to Habari, under an Open Source license (preferably Apache Software License).
Jeffrey D. King • 5:38 pm on Nov. 3, 2008
@John #0
I am unable to recreate your error. Did you change any of the default preferences in the admin settings?
Jeffrey D. King • 5:44 pm on Nov. 3, 2008
@Morgante #1
I’d love to see this hyphenation solution ported to other platforms.
The plugin is licensed under the GNU General Public License 2.0. If modify the plugin, you must retain the KINGdesk, LLC copyright information, the request for a link to http://kingdesk.com, and the web design services contact information unchanged. If you redistribute this software, or any derivative, it must be released under the GNU General Public License 2.0.
Ricky Irvine • 8:23 pm on Nov. 3, 2008
It’d be nice to know how this works (or doesn’t work) alongside the Typogrify plugin.
Jeffrey D. King • 8:33 pm on Nov. 3, 2008
@Ricky #4
The only point of conflict is the widow handling. If you are pleased with typogrify’s handling of widows, dewidowing can be disabled in wp-hyphenate. wp-hyphenate’s control of widows is a little more granular than typogrify’s. Typogrify just slaps a non-breaking-space before the last word of a paragraph. With wp-hyphenate, you can specify that the non-breaking-space should only be added if the preceding word (or hyphenated portion of a word) is X characters or less. It also allows you to set the maximum size of widows that should be protected from their loneliness. With this additional control, you no longer have to choose between protecting widows and improving rag. You can define your preferred balance. If you prefer the wp-hyphenate handling of widows, the typogrify widow handling can also be disabled (without losing the remainder benefits of that plugin).
wp-Hyphenate does not include the curly quote or em-dash replacement features of typogrify.
Mexside • 11:05 pm on Nov. 3, 2008
Very nice plugin!!!, I will put a review in my blog.
Jeffrey D. King • 1:21 am on Nov. 4, 2008
@Mexside #6
Thank you. I notice that your blog is not English language. Regretfully, only English hyphenation patterns are currently included. If there is demand and PatGen libraries exist, other languages may be included in future revisions.
Jeffrey D. King • 3:38 am on Nov. 4, 2008
@John #0
I have apparently used some functions that are new to php5. If you are using php4, you will get the error you mentioned. I will look to update the plugin to be backwards compatible to php4.
Jeffrey D. King • 4:17 am on Nov. 4, 2008
@John #0
The plugin is now php4 compatible.
Derek • 9:24 am on Nov. 5, 2008
Great plugin. I know it is still beta so I figured I would report a little bug I noticed. With the plugin enabled, I was seeing unordered lists not being closed properly.
Jeffrey D. King • 9:49 pm on Nov. 5, 2008
@Derek #10
On long posts, approximately every 4000th character was being dropped. The issue has been resolved in version 1.02 beta. Thanks for your assistance in recreating this issue.
Ryan • 5:25 am on Nov. 11, 2008
Once this is activated where should I find the admin page? It’s not appearing under settings.
Ryan • 5:42 am on Nov. 11, 2008
Ah, found it in the plugins menu… confused because most other plugins have the admin page in the settings. Personally I prefer the admin to stay in plugins!
bluemonkey • 1:58 am on Nov. 16, 2008
I’d like to create a language pattern file for Hungarian.
Is there a conversion utility that takes those hyph*.tex files and generates the proper php equivalent?
Or at least could you point me to some kind of ‘how to…’ doc?
Great thanks!
Jeffrey D. King • 1:44 pm on Nov. 16, 2008
@bluemonkey #14
I have the raw Hungarian pattern. It needs to be formatted to optimize performance. The reason I did not include it with the current language patterns is that the Hungarian patterns exceed 65,000 in quantity. To put this in scale, the US English patterns are fewer than 5,000. This will greatly impact performance.
If you want to spend the time to format it, I will email you the patterns and share with you the tool I created to expedite the process.
FYI, this is the same reason I have not released Norwegian patterns (27,000 in quantity)
johno • 12:37 pm on Nov. 19, 2008
I’m using it, and, thus far, I’m impressed.
PP • 5:06 am on Nov. 20, 2008
Hi! Thank you for a great plugin.
There is a problem in Polish hyphenation: the “i” character is left at the end of the line.
IT IS:
Całość zachowań związanych i
zależnych od…
IT SHOULD BE:
Całość zachowań związanych
i zależnych od…
Is there a way to fix it?
PP • 5:07 am on Nov. 20, 2008
The same goes for “od”, “do” and a number of other “stop” words.
Jeffrey D. King • 7:37 am on Nov. 20, 2008
@PP #17 & #18
Wrapping behavior of individual words is outside the scope of this plugin (excepting widows). The hyphenation functionality only looks at allowable wrapping patterns within words.
You can manually add non-breaking spaces before words you do not want at lines end. To add a non-breaking space, type in place of the relevant space.
PP • 9:32 am on Nov. 20, 2008
That answers it. Thank you!
Bobby • 2:53 pm on Nov. 21, 2008
Hi, this looks like a great plugin, but when I installed v1.05 I got the following fatal error:
Fatal error: Call to undefined function: mb_strtolower() in /home/…/wordpress/wp-content/plugins/wp-hyphenate/hyphenate.php on line 110
Can you suggest any remedy? Thanks.
Jeffrey D. King • 3:00 pm on Nov. 21, 2008
@Bobby #21
This plugin requires PHP 4.3 or later. You will need to ask your web host or network administrator to update the version of PHP running on your server.
Antonio • 2:14 pm on Nov. 28, 2008
Jeffery, my server is running PHP 4.4.8 and PHP 5.2.6 and I’m still getting the same fatal error as Bobby. Any ideas?
Antonio • 11:06 am on Dec. 8, 2008
Jeff, any help would be very appreciate. Thanks!
kristarella • 2:59 am on Dec. 10, 2008
Great idea, definitely a big step in the right direction.
Sadly, found a bug. Enabling hyphenation breaks WordPress captions. At least on my test blog, using MAMP with Apache 2.0.59 and PHP 5.2.5, on WordPress 2.7 RC1. I have no idea if it’s a WordPress bug and not your plugin, so sorry if it’s the former.
I took screenshots with the enable hyphentation option turned on and off.
Jeffrey D. King • 7:26 pm on Dec. 13, 2008
@Antonio #23
mb_strtolower was defined in PHP 4.3.0. If you are getting this error, then you are running an earlier version of PHP, or PHP is not fully installed on your web server. I would check with your web host.
Because of some other issues that have arisen, I recommend running this plugin on PHP5.
Jeffrey D. King • 7:27 pm on Dec. 13, 2008
@kristarela #25
Thanks for reporting this bug, I will look into it and include a fix in the next update.