SmartyPants On Demand

SmartyPants is a web publishing utility that translates plain ASCII punctuation characters into “smart” typographic punctuation HTML entities. This plugin allows you to conditionally enable SmartyPants for a single post/entry, affecting the the_title, the_content, and the the_excerpt fields by simply adding a custom field named smartypants-on-demand with a value of 1. Replace 1 with a 0 or simply delete the custom field to use WP’s wptexturize() instead.

This is a modification of Michel Fortin’s PHP SmartyPants, based on the original Perl version by John Gruber.
Based on version 1.5.1b of PHP SmartyPants.

Why not use SmartyPants all the time? Currently, PHP SmartyPants is significantly slower than WP’s texturize() by as much as 20% in certain situations. If an entry’s punctuations is handled well by texturize(), then there is no need to use SmartyPants. But if encounter funny punctuations, try SmartyPants instead.



  • PHP4 (version 4.0.6 or higher)
  • GD Library (version 2)

More Information

For now, everything you need to know is the zip file.

  1. Unzip the package in an empty directory.
  2. Drop rp-plugin-smartypants-on-demand.php into your wp-content/plugins/ directory, and activate in your Plugins menu.
  3. To enable SmartyPants for certain post/entry, just add a custom field named smartypants-on-demand with a value of 1.
  4. That’s it!