Turn off curly quotes in WordPress

If - like me - you're using WP to share code - PHP, HTML, javascript or whatever - you're probably getting very frustrated with seeing the quotes get messed up in the code you're posting. By default, WordPress turns straight quotes ' ' and " " into curly quotes ‘ ’ and “ ”. Which might be all very pretty if you're just writing text, but if you're posting code snippets, means that you have to spend a ridiculous amount of time typing &pos; " - or, of course, dealing with people complaining your code doesn't work.

Add the following to your theme's functions.php file
remove_filter('the_content', 'wptexturize');
and curly quotes will no longer be substituted in the_content.

Updated to add: I've now written a plugin which fixes this, as well as removing curly quotes from titles, excerpts and comments.

Share this post:
  • email
  • del.icio.us
  • Facebook
  • FriendFeed
  • LinkedIn
  • StumbleUpon
  • Tumblr
  • Twitter

Tags:

Posted by Sue on May 9, 2009 in WordPress.

4 comments to "Turn off curly quotes in WordPress"

  1. Thank you!! I can't believe wordpress doesn't allow you to turn off this "feature" in the dashboard. So frustrating.

  2. This fix kept creating errors in my dashboard. The plug-in is better.

Leave a Reply