WordPress is great and I pretty much love everything about it. But it does have it’s little idiosyncrasies that can often give you a headache if you don’t really know how to stop it from doing something that you don’t want it to.

When you write a post in the backend of WordPress that includes quotation marks, that same post will appear on the front end with your quotation marks changed into “Smart Quotes”.

That is all fine and dandy, but when it comes to coding, smart quotes ruin everything. I didn’t realize that WordPress did this until I noticed a link back coming into my site and they mentioned that people using one of my tidbits needed to be careful of the smart quotes if they copied and pasted from my site. We can’t have that can we? So here is my simple solution to solving the plain text quotes vs. smart quotes issue.

First we need to open up wp-includes/default-filters.php and look for line 100.

// Display filters
//add_filter('the_title', 'wptexturize');
add_filter('the_title', 'convert_chars');
add_filter('the_title', 'trim');

//add_filter('the_content', 'wptexturize');
add_filter('the_content', 'convert_smilies');
add_filter('the_content', 'convert_chars');
add_filter('the_content', 'wpautop');
add_filter('the_content', 'prepend_attachment');

//add_filter('the_excerpt', 'wptexturize');
add_filter('the_excerpt', 'convert_smilies');
add_filter('the_excerpt', 'convert_chars');
add_filter('the_excerpt', 'wpautop');
add_filter('get_the_excerpt', 'wp_trim_excerpt');

//add_filter('comment_text', 'wptexturize');
add_filter('comment_text', 'convert_chars');
add_filter('comment_text', 'make_clickable', 9);
add_filter('comment_text', 'force_balance_tags', 25);
add_filter('comment_text', 'convert_smilies', 20);
add_filter('comment_text', 'wpautop', 30);

add_filter('comment_excerpt', 'convert_chars');

//add_filter('list_cats', 'wptexturize');
//add_filter('single_post_title', 'wptexturize');

Just comment out a few lines, like I have above, by adding the two slashes (//) before them. Or copy what you see above and paste it over the same line numbers in default-filters.php and all of the quotes on your website will remain as plain text quotes.