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

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

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.