IkimashoZ
IkimashoZ
Matt Buscemi's Personal Webspace
Matt Buscemi's Personal Webspace

Removing Curly Quotes from Wordpress

I was quite surprised when I first began publishing my WebDevTutorial to WordPress that all my quotation marks were magically becoming curly.  You know, normal quotes looks like this: ".  This is what I typed into Wordpress, but what I got were these: “ ”.  This surprised and fascinated me.  Then I started looking at the code samples in my book and suddenly surprise and fascination turned into annoyance.

However, a quick Google search turned up this nice post.  Basically, the solution to this problem lies in turning off the WordPress filter that changes straight quotes to curly quotes automatically when the page is rendered.  You just add these lines of code to your theme's functions.php file:

//remove curly quotes
remove_filter('the_title', 'wptexturize');
remove_filter('the_content', 'wptexturize');
remove_filter('the_excerpt', 'wptexturize');
remove_filter('comment_text', 'wptexturize');

So now, you can safely copy and paste code from my book. This was a nice find.  Happy New Year everyone!