How to get rid of curly quotes in your WordPress blog

October 8, 2008 at 3:17 pm

Ah, curly quotes. They look nice, but they’re also such a pain if you display code on your blog, or copy/paste it from another blog. Here’s a very simple recipe that I urge you to use if you display code on your blog. Your readers will say thanks you!

This very useful hack is also very simple to implement: Open the functions.php file from your theme (if your theme don’t have a functions.php file, create one) and paste the following code:

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

As you can see, we used the remove_filter() function, which allow us to remove a function attached to a particular filter hook.

Filters function are very powerful because they allow you to override some WordPress features without modifying WP core.