Smart quote fix
This is a test of my smart-quote fix.
There’s an apostrophe in this sentence.
“This sentence is surrounded by double quotes.”
‘This sentence is surrounded by single quotes.’
Here’s how I fixed it:
Create a file in wp-content/plugins called my-hacks.php. Put the following in the file:
<?php
/*
Plugin Name: my-hacks
Plugin URI: #
Description: Resting place for a variety of changes. Presently includes removing
the wptexturize filter from comment_text, the_excerpt and the_content
Version: 0.1
Author:
Author URI:
*/
remove_filter(’comment_text’, ‘wptexturize’);
remove_filter(’the_excerpt’, ‘wptexturize’);
remove_filter(’the_content’, ‘wptexturize’);
?>
Now, log in to WordPress and choose Plugins. Activate my-hacks. That’s it!
Credits:
- WordPress Wiki - my-hacks.php explains about my-hacks.php, but refers to an earlier version of WordPress
- SuperDeluxo4.2 wgets and curls explains what to put in the my-hacks.php file
Comments
5 Responses to “Smart quote fix”
no problem.
Getting rid of smart quotes in WordPress
Thanks a ton to Matt (one of the developers of WordPress) for patiently showing me how to get rid of smart quotes in this blog. Smart quotes are all well and good and pretty, but they invalidated any text intended for the command-line. If anybody els…
Its great that Matt showed you how to do it, but why did Matt not make it a simple check box, turn off smart quotes on the admin page? That would allow one to specify the character set…why not these items? Thanks for this blog post. My blog is 90% code snippets and that smart quote for the user is damaging on copy and paste….
It appears that the latest version of Wordpress no longer uses filters you mentioned and smart quotes are still outputted…check your own text.
Yeah - the smart quote hack was something I did several years (and revs of WP) ago.