It's a strange issue and I've seen it happen with plugins, however I don't know how to fix it. Maybe just a PHP issue?

Anyhow, I have a settings/options page with several text areas. Upon saving, a "\" appears before each apostrophe. Each time it's saved, an additional back-slash appears.

I'm not sure what code would be helpful to look at for this.


It's a PHP issue. The character ' is being escaped so that it can be safely in various places, not least of which is the database. That's why your ' look like \'.

You can use PHP's stripslashes() function to clean it up, or (if it's an array you need to clean up) WordPress's stripslashes_deep() function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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