Removing the Smart Quotes from your WordPress Blog
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.
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | // 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.



For those of you out there who prefer using plugins, I just found a great one that takes care of those nasty smart quotes.
You can download it at http://www.jasonlitka.com/2007/09/25/wordpress-plugin-disable-wptexturize/
Ah… so that is what caused the quote characters to change! It is good to know this tip!
[... - bavotasan.com is other useful authority of tips. Car insurance claims [... -
Thank you. Still works in WordPress 2.9
thats right. great to see it work in 2.9
Some people think that car insurance is a waste of money but it is really very essential that you have one.,.:
So I betcha this fix works, but it seems like you have to actually modify the core files… ugh. Hate to do that!
Insightful writing. Will need a bit of time to think about your stuff.
Insightful points. Will take a decent amount of time to toy with the info!