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

How would this be done with javascript or a plugin? This would prevent widows from happening in my WordPress posts. Shaun Inman has created a similar plugin for post titles, but not for actual posts. Can his plugin be modified to include posts?


Here is a screenshot of my post with a widow:


share|improve this question
up vote 2 down vote accepted

Drop in add_filter( 'the_content', 'widont' ); (and the same for the_excerpt if required).

This'll apply the function to the post content in addition to the title (the_title).

share|improve this answer
That worked! I added that line of code directly underneath add_filter('the_title', 'widont'); – Dave Aug 21 '12 at 2:02

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.