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

  • 1
    What is the shortcode in question? Commented Mar 30, 2011 at 3:13

2 Answers 2


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' );

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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