The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,858 other subscribers

The WordPress feature that “beautifies” (malforms!) your Blog text is called `wptexturize`: on WordPress.com you cannot disable it.

Posted by jpluimers on 2025/02/03

Over the years, WordPress started to beautify more and more text thereby malforming many (read thousands) of my older blog posts.

An example is this:

--jeroen

is now rendered as

–jeroen

The two hypen-minus signs or -- have become a en-dash or , not even an em-dash or that is is double the width of an en-dash.

So after figuring out the cause, I asked if one could change it for a WordPress.com blog backed by a premium account: [Wayback/Archive] Jeroen Wiert Pluimers on Twitter: “Hi @wordpressdotcom, how do I globally disable wptexturize for a paid wiert.wordpress.com blog (it has Premium subscription)? Over the years, it has malformed more and more of my text which I don’t want (as it is way too much work to re-visit thousands of blog posts).”

Unbelievably, the answer is no!

So WordPress.com mandatorily changes the display of all your old Premium blog posts and the only solution they offer is to upgrade for another USD ~17 per month to disable it.

I was flabbergasted so I published an excerpt of the email they sent me:

  1. [Wayback/Archive] Jeroen Wiert Pluimers on Twitter: “@wordpressdotcom It is unbelievable that you need a business plan for this, as per email response: << Thank you for reaching out. It is not possible to globally disable wptexturize on the Premium plan. It may be possible to disable this using a third-party plugin: wordpress.com/plugins/zachspearspremium.wordpress.com?s=disable+wptexturize.”
  2. [Wayback/Archive] Jeroen Wiert Pluimers on Twitter: “@wordpressdotcom Third-party plugins do require the WordPress Business plan. Please let us know if you have any additional questions. >> WordPress.com has enforced a “feature” for which one has to pay USD 17/month extra (above Premium plan) to be able to turn it off. What a world!”

A query for the plugins you might want to use [Wayback/Archive] Plugins: s=disable+wptexturize — WordPress.com (this link is blog-URL neutral unlike the link in the Tweets above that Automattic mailed me).

This is how I figured out what caused the malforms:

  1. [Wayback/Archive] wordpress en dash with double dash – Google Search
  2. [Wayback/Archive] Need to create double-hyphen — | WordPress.org
  3. [Wayback/Archive] formatting – How to prevent automatic conversion of dashes to – – WordPress Development Stack Exchange (thanks [Wayback/Archive] radman, [Wayback/Archive] TheDeadMedic and [Wayback/Archive] Manuel)
    When I put — into a post it is automatically converted to the – &ndash; character in the output by wordpress.
    How can I get normal '--' double dashes in my content.

    In your functions.php:
    remove_filter( 'the_content', 'wptexturize' );
    
    And the same for the_excerpt or the_title (if required).

    in the beginning of your file single.php add these lines:
    <?php
    remove_filter( 'the_title', 'wptexturize' );
    remove_filter( 'the_content', 'wptexturize' );
    remove_filter( 'the_excerpt', 'wptexturize' );
    ?>
  4. [Wayback/Archive] Topic: How to stop automate changing double dashes into single dash | WordPress.com Forums

    This sneaky text conversion performed behind the scenes by the WordPress engine is a “feature” offered by the wptexturize filter.

  5. [Wayback/Archive] [Solved] The double dash WP ‘feature’. | pwrusr.com

    tl;dr.

    Go to: Dashboard -> Appearance -> Editor -> “functions.php” and paste “add_filter( 'run_wptexturize', '__return_false' );
  6. [Wayback/Archive] wptexturize() | Function | WordPress Developer Resources

    Here are some of the text transformations:

    source text transformed text symbol name
    “—“ “—” em-dash
    ” — “ “—” em-dash
    “–“ “–” en-dash
    ” – “ “–” en-dash
    “…” “…” ellipsis
    opening quote
    “hello “hello opening quote
    ‘hello ‘hello opening quote
    closing quote
    world.” world.” closing quote
    world.’ world.’ closing quote
    ” ™” ” ™” trademark symbol
    1234″ 1234″ double prime symbol
    1234′ 1234′ prime symbol
    ’99 ’99 apostrophe before abbreviated year
    Webster’s Webster’s apostrophe in a word
    1234×1234 1234×1234 multiplication symbol
  7. [Wayback/Archive] wordpress-develop/formatting.php at 6.0 · WordPress/wordpress-develop

    /**
    * Replaces common plain text characters with formatted entities.
    *
    * Returns given text with transformations of quotes into smart quotes, apostrophes,
    * dashes, ellipses, the trademark symbol, and the multiplication symbol.
    *
    * As an example,
    *
    * 'cause today's effort makes it worth tomorrow's "holiday" ...
    *
    * Becomes:
    *
    * ’cause today’s effort makes it worth tomorrow’s “holiday” …
    *
    * Code within certain HTML blocks are skipped.
    *
    * Do not use this function before the {@see 'init'} action hook; everything will break.
    *
    * @since 0.71
    *
    * @global array $wp_cockneyreplace Array of formatted entities for certain common phrases.
    * @global array $shortcode_tags
    *
    * @param string $text The text to be formatted.
    * @param bool $reset Set to true for unit testing. Translated patterns will reset.
    * @return string The string replaced with HTML entities.
    */
    function wptexturize( $text, $reset = false ) {...}

  8. [Wayback/Archive] wptexturize feature introduced – Google Search (I could not find when this method was introuced)

--jeroen

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.