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

I make some changes over the post before storing it in the database.

I use content_save_pre to do this.

Some characters like " get done into “ in the JavaSript code which I insert (part of the change). How do I prevent that from happening?

share|improve this question

migrated from stackoverflow.com Jul 2 '11 at 23:00

This question came from our site for professional and enthusiast programmers.

Could you please provide a sample of the code you're inserting? The function wptexturize() is doing this on the fly at runtime, so knowing the structure is important for figuring out how to stop it. – John P Bloch Aug 26 '10 at 13:14

It seems that the "convert_chars" filter is causing the trouble, try removing it by:

remove_filter( 'the_content', 'convert_chars' );

Also try removing the richedit_pre hook (which formats the text for the rich text editor, also uses convert_chars function) by:

remove_filter( 'the_editor_content', 'wp_richedit_pre' );

Hope that helps!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.