Posted
7 July 2008 @ 6pm

Tagged
Uncategorized

How to Disable Smart / Curly Quotes on WordPress 2.5

Smart / curly quotes might look nice typographically, but they can be a major pain if you want to copy and paste source code onto your blog (as I do with Ruby Inside and Rails Inside). Luckily there’s an easy solution, though it took me a while to discover it.

Basically, go to the functions.php file within your current theme (usually wp-content/themes/[theme name]/functions.php) and add this to the end:

<?php remove_filter('the_content', 'wptexturize'); ?>

Now you’re good to go! If you want to be a bit more extreme and remove smart quoting from comments, add this:

<?php remove_filter('comment_text', 'wptexturize'); ?>

3 Comments

Posted by
Brent
21 July 2008 @ 10pm

Any thoughts on how to make this work for the post that comes down to the user via RSS?


Posted by
andrew
27 August 2008 @ 10pm

Thanks for this bit of code. “str_replace” did not recognize the curly quotes, so my PHP code couldn’t replace them, and my RSS was not validating. Placing this line in the function.php file gave me clean RSS that displays in the IE browser perfectly.


Posted by
icie
27 September 2008 @ 8am

Thank you so much for this tip. I think there is a more fundamental problem with my WP installation, but WordPress had applied the texturize function on the HTML code of my content, jumbling everything up (you know how important quotation marks are for HTML). That simple line in functions.php saved my sanity.


Leave a Comment

Pipex Filtering HTTP Traffic In A Rather Weird Way How Lies Are Destroying Both Businesses and Consumers