My wordpress site has this annoying problem: it converts the single quotes (e.g. it's) into double quotes (it"s) and it looks bad.

For example, look at the title of this post. I have searched long and hard about this.

I have read about php.ini and the magic quotes parameter, but it is already off on my server (and everything other that has to do with magic quotes)

I have commented the wp_magic_quotes(); line on wp-settings.php but it changed nothing.

I have found some 6+ years old posts on wordpress forums that reference plugins that don't exist anymore and changes on wordpress files that also don't exist.

Any suggestions will be greatly appreciated.


3 Answers 3


Add this code your functions.php

Reference : Issue with double dash

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

Sometimes asking for some help is the best way to find help for yourself. Luck works in strange ways, doesn't it?

I just had to add these lines in the function.php of my theme

//Remove from Post Content
remove_filter('the_content', 'wptexturize');
//Remove from Post Title
remove_filter('the_title', 'wptexturize');
//Remove from Post Excerpt
remove_filter('the_excerpt', 'wptexturize');
//Remove from Post Comments
remove_filter('comment_text', 'wptexturize');

To start with, I would check that the content has the correct type of quote in the database entry for the page.

If the d/b entry has the correct quote, next, look at what filters are being applied to the content before it's being rendered out. Find the code in your template & see what function is being used to display it, then track back until you can find out what it is that's changing the content.

If the d/b does not have the correct quotes, then look at the action\filter hooks that are called when the post is saved. You could try a plugin like this to see what hooks are being called, although with the save action, you may not see the results as the page will redirect.

  • Thanks for the input. I fixed it by adding the line remove_filter('the_title', 'wptexturize'); on my theme's function.php (and similar lines for the content, the excerpt and the comments). I was waiting for the 8 hours to post this as an answer to my original question. Jan 15, 2014 at 13:42
  • Glad you managed to fix it. Do you understand why this fixes it? If not I could explain further if you like.
    – TobyG
    Jan 16, 2014 at 14:37
  • Well, I guess the wptexturize filter changes the plain quotes to double curvy quotes, and by removing it I am left with the right ones. What I don't understand is why the filter turns a single quote in a double curvy one. Jan 16, 2014 at 18:29
  • Maybe that's a question for the developer of the plugin?
    – TobyG
    Jan 22, 2014 at 14:28
  • It wasn't a specific plugin that caused it. I don't have any plugins for the text Jan 22, 2014 at 20:53

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.