WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

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

Is there a way to remove wptexturize only for a certain shortcode?

share|improve this question
What is the shortcode in question? – Chip Bennett Mar 30 '11 at 3:13
up vote 4 down vote accepted

There is a clue in wp-includes/formatting.php in the function wptexturize:

$default_no_texturize_shortcodes = array('code');
$no_texturize_shortcodes = '(' . implode('|',
    apply_filters('no_texturize_shortcodes', $default_no_texturize_shortcodes) ) . ')';

Try using this filter to add a shortcode to the array:

function my_no_tex( $shortcodes ) {
    $shortcodes[] = 'someshortcode';
    return $shortcodes;
add_filter( 'no_texturize_shortcodes', 'my_no_tex' );
share|improve this answer

Shortcodes run after the wptexturize function, so they shouldn't get processed by it anyway.

wptexturize runs on the_content with priority 10. The do_shortcode function runs with priority 11.

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.