WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

To optimise the speed of my platform (beyond caching, database optimisation, JPEG compression, CSS sprites etc), it has come to my attention that disabling the wptexturize() function may give some minor results.

We can disable this function by using this script (written by our own "observer of everything" toscho):

foreach ( array (
    ,   'comment_text'
    ,   'comment_author'
    ,   'link_name'
    ,   'link_description'
    ,   'link_notes'
    ,   'list_cats'
    ,   'single_post_title'
    ,   'single_cat_title'
    ,   'single_tag_title'
    ,   'single_month_title'
    ,   'term_description'
    ,   'term_name'
    ,   'the_content'
    ,   'the_excerpt'
    ,   'the_title'
    ,   'nav_menu_attr_title'
    ,   'nav_menu_description'
    ,   'widget_title'
    ,   'wp_title'
    ) as $target )
    remove_filter( $target, 'wptexturize', 40 );

My question is, how safe is it to disable wptexturize()? When is this function being used? What should I consider when disabling it? The codex page gives an overview but doesn't detail when it is being used.

share|improve this question
up vote 2 down vote accepted

wptexturize() (in wp-includes/formatting.php) tries to convert typewriter quotes " and ' into typographically correct pendants like “ or «, depending on current translation files.

If you cannot type correct quotes, you should not disable it.

There are some related replacements for dashes and ellipsis (not localized for whatever reason).

All these replacement are done with expensive regexes, and they are not really safe. <samp>$var["foo"]</samp> for example will be changed, but it shouldn’t.

Disabling it does no harm, the function is not essential for anything else.

See also: Ticket #19550 Please provide option to disable wptexturize entirely

share|improve this answer

Yes, it is absolutely safe to remove the wp_texturize() filter.

Generally, it is only used as a filter callback. You can see those uses here. Note that you'll have several remove_filter() calls to make:

$texturized_text = array(
    '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',
foreach ( $texturized_text as $text ) {
    remove_filter( $text, 'wptexturize' );

But there are other, non-filter uses as well, such as:

(See more here.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.