WordPress Plugin: “Disable wptexturize”

September 25, 2007 by · 51 Comments 

"Disable wptexturize" is the second plugin I've created for WordPress. To be honest, as far as plugins go, they don't get much simpler than this one. Aside from the header info, it consists of a grand total of three lines of code. Those three lines, though, make a world of difference to someone trying to run a site where formatting is important.

The purpose of this plugin is to stop the wptexturize filter from running on your content, the excerpt for your content (if you use it), and the comments left by your visitors. The texturizer mangles your code by converting what you actually type to what it thinks you mean. For example, the difference between "--" and "–" or straight quotes (what normal people use) and smart quotes (what Microsoft Word uses) is night and day when you're trying to run a command on a *nix system or compile a bit of code.

To be honest, I don't have any idea why disabling the texturizer isn't an option in the default code. I have to believe that there are tons of people who are annoyed by it, just as I was...

Regardless, here's the solution for you. Turn my plugin on, the texturizer goes away. Turn my plugin off, it comes back. Installation is simple, just unzip the file below into your plugins directory and then activate it from the plugins page in your blog's admin section.

Download the "Disable Texturizer" WordPress Plugin

Comments

51 Responses to “WordPress Plugin: “Disable wptexturize””
  1. Jesse says:

    I think you have the wrong link posted 🙂

  2. Jason says:

    @Jesse,

    Whoops... Fixed. Thanks for the heads up.

  3. Ben says:

    Thank you so much for writing this plugin. The WP Texturizer has always been my biggest headache with wordpress and your plugin has fixed it forever (I hope). Thanks for publishing this.

  4. Jason says:

    @Ben,

    Glad you like it.

  5. Todd Werth says:

    Thank you sir, you saved me from having to search through the code to disable it. Now I just need to figure out what is changing n into n.

  6. Klark says:

    does this work in the feed as well?

  7. Jason says:

    @Klark,

    Yes, it does work on the feed.

  8. Eule says:

    Is this plugin still up to date? Is it working with the newest version of wordpress?

  9. Jason says:

    @Eule,

    It's only three lines so there's not really anything to keep up to date. As to the versions it works with, I'm using it here and I'm running 2.3.3 right now.

  10. Rob Thunder says:

    Thank you.

    Thank you.

    Thank you.

    Thank you...

    THANK YOU!!!

    That damnable wptexturize filter has been the bane of my existence in the world of WordPress for years. Finally I am rid of that.

    Having extensive PHP experience, it was getting so that I was willing to spend several days -if need be- to simply plow through every single line of code in all the WordPress files to see if I could locate exactly what it was that was prettifying all my single and double quotes (as well as mangling my example codes) and eradicate it with extreme prejudice. You saved me that trouble, Jason. :o) I can now begin blogging the way I want to for the first time.

    I read elsewhere about those 3 lines of code but no one seemed to have a clear idea as to exactly where to use them. I read vague implications that it had something to do with myhacks.php (couldn't find this file in WordPress 2.51) and vars.php in the wp-includes folder (of course, no one said exactly where to use those lines of code in vars.php).

    Well, well, just slap it in a plugin and that's it, that's all. Who'da thunk it? (obviously you did)..

    Thanks again, man.

    Oh and for others, it works fine in WordPress 2.51 (latest version as of this writing)

  11. Leo says:

    FYI, there's a already plugin created for the same purpose.

    http://sparanoid.com/taxonomy/blog/wordpress/quotmarks-replacer/

  12. Mire says:

    hey. Thx for the plug in. Works like a charm

  13. andar909 says:

    hi, andar here, i just read your post. i like very much. agree to you, sir.

  14. Alan says:

    Thanks Jason, I did discover that titles are still getting "wptexturized" so I added the following lines to "disable-wptexturize/disable-texturize.php":

    remove_filter('the_title', 'wptexturize');

    The wptexturize feature has been, in my opinion, the worst built-in feature in WordPress. How hard would it have been to put a simple option in the admin to turn it off.... Jeez. HTH.

  15. Kathy K says:

    Many thanks!

    And thanks to Alan, too - I also added the title.

  16. Joel says:

    Help! how do I turn texturize off for custom fields? My blog depends on having certain urls in the custom fields and wp always ruins them by converting characters like parentheses into character entities (why the idiots at the destination website are using those characters in their urls is another story).

  17. Paul says:

    It does not seem to work with WordPress 2.7. Is an update in the works?

    Thank you

  18. webmaestro says:

    What changes would be necessary to make it work only in RSS feeds?

    I like the elegance of this solution, but the only place I need to implement it is in the RSS feed.

    Thanks!

  19. Stefan says:

    Hi Jason,
    Thank you for this plugin. I don't care how "simple" it is. It works wonders!

  20. Henry Gomez says:

    Genius. That texturizer thingy was screwing up our ellipsis.

  21. Romeo says:

    Thank you very much for this plugin. Great

  22. Heartburn Home Remedy says:

    This topic is quite hot in the net at the moment. What do you pay attention to while choosing what to write ?

  23. andy49 says:

    anodized assume beginning counteracting entirely feebler Giuliano Hudson mice plumbs probation rules saddest salted Thornburg tired c99 shell achieves bares capaciousness coroutine degenerates impassive imperialism subsume .

  24. Bryan says:

    Is anyone using this successfully under 2.7.1? I thought it would remove curly quotes when I pasted them from other sources but maybe I misunderstood what it's supposed to do.

  25. Major Slack says:

    "Is anyone using this successfully under 2.7.1? I thought it would remove curly quotes when I pasted them from other sources but maybe I misunderstood what it's supposed to do."

    I am. This plugin has been rock solid throughout numerous WordPress upgrades.

  26. Bryan says:

    If you cut & paste some text that has curly quotes in it, will the plugin convert them to normal quotes? That doesn't work for me.

  27. "Disable wptexturize" plugin is very useful. It works well with wordpress 2.7 for me. Thank you Jason for sharing the plugin with us. Wish you all the best for your future work.

  28. webmaestro says:

    This plugin works great in WPMU 2.7.

    As I mention above, the only place I really need it is in the RSS feeds. What would it take to enable disable wptexturize to only do its magic in RSS feeds?

  29. Dude, making things a lot simpler is harder than making things complicated. I hope that make sense. That 3 lines of code is so easy to use and edit.

  30. Barnevern says:

    Thanks for this very small an useful plugin to WP 🙂

  31. Dan W. says:

    I just installed it on wp 2.8.4 and it is working great - thank you for this 🙂

  32. Hikari says:

    That's nice!

    I'm trying to make a further mod in wordpress, release admin to post comments with the same freedom we have in posts. Use any HTML we want, JavaScript, shortcodes and even PHP!

    Wanna help me make it possible? 😀

  33. Brad says:

    I am using it with wordpress version 2.8.4 and it works just fine. Thanks. I have also used it with older versions and it worked perfectly. I havent tried it with newer versions though but I think i am going to wait a while before I do.

  34. Great work. I noticed that the wptexturize filter is installed in some other places. I ended up with this:

    remove_filter('the_title', 'wptexturize');
    remove_filter('the_content', 'wptexturize');
    remove_filter('the_excerpt', 'wptexturize');
    remove_filter('comment_text', 'wptexturize');
    remove_filter('list_cats', 'wptexturize');
    remove_filter('single_post_title', 'wptexturize');
    remove_filter('comment_author', 'wptexturize');
    remove_filter('term_name', 'wptexturize');
    remove_filter('link_name', 'wptexturize');
    remove_filter('link_description', 'wptexturize');
    remove_filter('link_notes', 'wptexturize');
    remove_filter('bloginfo', 'wptexturize');
    remove_filter('wp_title', 'wptexturize');
    remove_filter('widget_title', 'wptexturize');

  35. Tom says:

    Thank you so much for this plugin, it as really helped me in terms of rendering code correctly so that when people copy and paste off of my site, it stays the same!

  36. Alex says:

    Actually, wptexturize have a LOT of crazy regex things, and more over, a simple lexal parser. It's doing a hell of a perf impact on the blog 🙂

  37. meggan says:

    These codes are very much manageable than the others (even for a newbie like me)..Thanks for sharing!

  38. Steve says:

    Nearly 4 years later & it's still good!

Trackbacks

Check out what others are saying about this post...
  1. Plain text Wordpress (Look Ma! No curly quotes!) says:

    [...] Install Jason Litka's Disable Texturizer plugin. [...]

  2. Perseverance Trumps Talent » Blog Archive » Code Snippet 2.0 + Disable wptexturize = Code in my blog says:

    [...] solutions: Code Snippet 2.0 for syntax highlighting and "Disable wptexturize" to, well, disable that particular "feature." The plugin is built on top of Geshi, a multiple [...]

  3. Texturize? What kind of word is that? | A Stata Mind says:

    [...] copy of Jason Litka's "Disable wptexturize" plugin. The original description of how it works is on Jason's blog. If you were looking for the same thing and Google sent you here, go [...]

  4. Two Essential WordPress Plugins - CashTrix says:

    [...] solution? A simple and free plugin written by Jason Litka called disable wptexturize. Download it and upload it via FTP to your plugin-folder: your domain » wp-content » [...]

  5. Blog de chakal^-^ » Solución para evitar que wordpress cambie ciertos caracteres says:

    [...] lee algo como: "hola", lo traduce con “hola”, la solución fue deshabilitarlo usando el plugin wptexturize y code-snippet para colorizar el código que coloquemos en los [...]

  6. [...] WordPress Plugin Disable wptexturize at Utter Ramblings Posted by root 21 minutes ago (http://www.jasonlitka.com) Thanks and best regards private krankenversicherung 17 kathy k anyway the 2 7 comment the code you used to need in your functions file appeared to be your name your address powered by sharethis Discuss  |  Bury |  News | WordPress Plugin Disable wptexturize at Utter Ramblings [...]

  7. Wordpress – Plugins for easy blog writing/editing — krishna2.com says:

    [...] Disable wptexturize : This is a plugin to make wordpress not escape certain elements. But this did not fully suit my [...]

  8. [...] Plugins for new site? Exper Chaotic Flow Blog Archive Disable Revisions and Autosave plugins WordPress Plugin: “Disable wptexturize” at Utter Ramblings Those 2 plugins will save you lots of trouble and [...]

  9. [...] to remove /category/ from category URL. Then leave Category base in Options | Permalinks blank.Use Disable wp-texturize plugin, if you have problems with HTML  comments in the posts.Next step is to download all the [...]

  10. Using Dreamweaver to edit Wordpress pages and posts | RCH Tech Solutions says:

    [...] If you only use WordPress as a CMS,  you can turn off the WordPress HTML mangler.  (wptexturize)  with a little plugin called “Disable Texturize”. It is not listed in the WordPress plugin repository,  but I found it here last…   http://www.jasonlitka.com/2007/09/25/wordpress-plugin-disable-wptexturize/ [...]

  11. ?????????? | ??????? says:

    [...] Disable wptexturizeWordPress ??????????????????? [...]



This site is no longer updated. If you have a need for RHEL/CentOS LAMP Stack updates outside the normal channels, I recommend ART. https://updates.atomicorp.com/channels/