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

When I put -- into a post it is automatically converted to the – – character in the output by wordpress.

How can I get normal '--' double dashes in my content.

share|improve this question

2 Answers 2

In your functions.php:

remove_filter( 'the_content', 'wptexturize' );

And the same for the_excerpt or the_title (if required).

share|improve this answer
what else does this disable, or does it just target the -- conversion? – radman Aug 1 '12 at 19:36
@radman View codex - wptexturize for what this function does, obviously filtering this function will stop all other conversions mentioned there. – amit Aug 3 '12 at 18:29

I found a solution: If you are using WordPress, in the beginning of your file single.php add these lines:

remove_filter( 'the_title', 'wptexturize' );
remove_filter( 'the_content', 'wptexturize' );
remove_filter( 'the_excerpt', 'wptexturize' );

And do your test. I am 99.99% sure that will work because I had the same problem and I fixed it using that lines 10 seconds ago. ;)

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.