wpuntexturize
wpuntexturize

wpuntexturize

Scott Reilly

By default, WordPress converts single and double quotation marks into their curly alternatives. This plugin prevents that from happening, so you can enjoy your quotation marks in their non-curly glory. If your content happens to already have curly quotation marks in it, then this plugin can optionally also convert them to their non-curly alternatives.

Note: Despite the unfortunately misleading name, this plugin is NOT the antithesis of WordPress’s wptexturize() function. This ONLY prevents WordPress from making HTML entity code substitutions of single and double quotation marks with their curly alternatives and does NOT prevent wptexturize() from making any other character and string substitutions. See the FAQ for details on the filters processed by the plugin.

Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage

Developer Documentation

Developer documentation can be found in DEVELOPER-DOCS.md. That documentation covers the numerous hooks provided by the plugin. Those hooks are listed below to provide an overview of what’s available.

  • c2c_wpuntexturize : An alternative approach to safely invoke c2c_wpuntexturize() in such a way that if the plugin were deactivated or deleted, then your calls to the function won’t cause errors in your site. This only applies if you use the function directly, which is not typical usage for most users.
  • wpuntexturize_filters : customize what filters to hook to be filtered with wpuntexturize. See the Description section for a complete list of all filters that are filtered by default.
  • c2c_wpuntexturize_replacements : Customize the character replacements handled by the plugin.
  • c2c_wpuntexturize_convert_curly_quotes : Enable conversion of preexisting curly quotes into their non-curly alternatives.
Why are certain characters in my posts still being replaced by their HTML entity encoded version?

This ONLY prevents WordPress from making HTML entity code substitutions of single and double quotation marks with their curly alternatives and does NOT prevent WordPress from making any other character and string substitutions.

Why do I still see curly quotation marks in my posts?

Most likely these curly quotes are actually present in your originally post content and are being directly shown to visitors. WordPress isn’t converting these to curly quotes since they are already that way. This could happen if you copy-and-pasted text from another source.

If you don’t want any curly quotes to appear in your posts at all, then on the Settings -> Reading admin page check the checkbox labeled “Prevent all curly quotes?”. (Or if you’re a developer, look into use of the c2c_wpuntexturize_convert_curly_quotes filter.)

What text does this plugin modify/filter?

This plugin potentially modifies the post content, excerpt, title, comment text, widget text, and more.

More specifically, it performs a wpuntexturize on every filter that WordPress applies the wptexturize to by default. This list comprises:

comment_author, term_name, link_name, link_description, link_notes, bloginfo, wp_title, widget_title, single_post_title, single_cat_title, single_tag_title, single_month_title, nav_menu_attr_title, nav_menu_description, term_description, get_the_post_type_description, the_post_thumbnail_caption, the_title, the_content, the_excerpt, the_excerpt_embed, comment_text, list_cats, widget_text, widget_text_content

This complete list can be filtered via wpuntexturize’s own filter, wpuntexturize_filters.

Does this plugin include unit tests?

Yes. The tests are not packaged in the release .zip file or included in plugins.svn.wordpress.org, but can be found in the plugin’s GitHub repository.

Exactly what I needed

By klingonteacher on September 27, 2024

This plugin does exactly what I want, and it still works with any updated of WP I do.

FYI: I needed this plugin because I write many texts in Klingon. Those use the apostrophe as a letter very often, and it looks really strange if they are converted to left and right curly quotes. Here's an an example: So'wI' vIchu'Ha'be' 'e' vI'Ir.

PS: Just a ssuggestion, but if you need an idea for improvement, add the option to what is converted to what. For instance, I would enjoy having all apostrophes ['] converted only to "Right single quotation mark", but not to left curly quote. Just an idea.

thx

By pumptechbmw on April 30, 2024

working!

***RESOVLED*** Straightens quotes I don’t want straight

By clarenceinwonderland on May 16, 2020

This issue was very quickly resolved by the developer. I'm very impressed by the quick response and the plugin works great. Upped to 5-stars. --- When I type straight quotes in a post, this plugin does keep them straight, which is nice. However, when I type in curly quotes in a post, this plugin straightens them, which is not nice. In my work, a curly quote and a straight quote are semantically different, and must display as such. I would just like to have displayed what I type.

actual curly-quotes get flattened

By squeegily on March 31, 2020

Since v1.7 (2019-05-28), this plugin flattens out curly-quotes that I intentionally typed. This behaviour cannot be disabled from the UI—it can only be "configured" by way of writing a separate ad-hoc plugin. Hopefully, this gets fixed in the next release. I had hoped to get a plugin that would just leave my quotes alone / as I type them

Works great

By Siili (kbtjakbt) on February 3, 2020

Thank you for this plugin Scott

Works great and as advertised.

By touchdowntech on March 26, 2019

This plugin works great! I only wish that it would also handle quotation marks in WooCommerce variable product descriptions.

Don't work

By Loz702 on September 24, 2018

Not sure why everyone is saying this works, it don't. I'm still getting question marks in replace of hypens and apostrophe's that come out like this full-time = full?time apostrophe's = apostrophe?s anyone know of any plugins that fix this? my config file is set to UTF8, still getting these annoying things showing up. cheers

Best Plugin To Remove Curly Quotes In Wordpress

By mastersg on April 22, 2018

Thank you for this plugin Scott. Job Well done. Works straight away once activated. Ideal for those not familiar with coding or wanting to edit php functions. Perfect.

Great little fix

By Alex Hall (openhatch) on March 24, 2017

Works perfectly. Too bad my self-hosted search engine chokes on curly quotes, or I wouldn't need this.

Perfect

By jolshefsky on September 3, 2016

Turning all quotes automatically into fancy quotes probably seemed like a good idea, but it just doesn't work. Thankfully there's a way to undo the stupidity!

2.2.2 (2024-08-08)

  • Change: Note compatibility through WP 6.6+
  • Change: Update copyright date (2024)
  • Change: Reduce number of ‘Tags’ in readme.txt
  • Change: Remove development and testing related files from release packaging
  • Unit tests:
    • Hardening: Prevent direct web access to bootstrap.php
    • Change: In bootstrap, store path to plugin file constant
    • Change: In bootstrap, add backcompat for PHPUnit pre-v6.0

2.2.1 (2023-04-29)

  • Change: Note compatibility through WP 6.3+
  • Change: Update copyright date (2023)
  • Change: Add link to DEVELOPER-DOCS.md in README.md
  • New: Add .gitignore file
  • Unit tests:
    • Fix: Allow tests to run against current versions of WordPress
    • New: Add composer.json for PHPUnit Polyfill dependency
    • Change: Prevent PHP warnings due to missing core-related generated files

2.2 (2021-07-14)

Highlights:

This minor release refactors some code, extracts developer docs out from readme and into new DEVELOPER-DOCS.md, restructures unit test files, and notes compatibility through WP 5.7.

Details:

  • Change: Refactor some code to prevent code duplication
  • Change: Check if the plugin’s main class exists before defining it
  • Change: Note compatibility through WP 5.7+
  • Change: Correct documentation regarding the c2c_wpuntexturize_convert_curly_quotes filter
  • Change: Update copyright date (2021)
  • New: Add DEVELOPER-DOCS.md and move hooks documentation into it
  • Unit tests:
    • Change: Restructure unit test directories and files into new tests/ top-level directory
      • Change: Move phpunit/bin/ into tests/
      • Change: Move phpunit/bootstrap.php into tests/
      • Change: In bootstrap, store path to plugin file constant so its value can be used within that file and in test file
      • Change: Move phpunit/tests/*.php into tests/phpunit/tests/
      • Change: Remove ‘test-‘ prefix from unit test file
    • Fix: Fix test that expected a deprecation notice that wasn’t going to happen
    • New: Add test for allowed_options() that expects a deprecation notice if WP < 5.5
  • Change: Tweak formatting for older readme.txt changelog entries
  • New: Add a few more possible TODO items

Full changelog is available in CHANGELOG.md.

  1. Install via the built-in WordPress plugin installer. Or download and unzip wpuntexturize.zip inside the plugins directory for your site (typically wp-content/plugins/)
  2. Activate the plugin through the ‘Plugins’ admin menu in WordPress
  3. Optional: If you want to also convert existing curly quotation marks within posts to their non-curly alternatives, then on the Settings -> Reading admin page check the checkbox labeled “Convert existing curly quotes in posts to their non-curly alternatives”. (Reminder that the plugin will always prevent WordPress from converting non-curly quotation marks to the curly alternatives.)

Reviews

4.6 out of 5 stars

  • Version: 2.2.2
  • Last updated: 1 month ago
  • Active installations: 900
  • WordPress version: 1.5
  • Tested up to: 6.6.2
  • PHP version: false