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 need to insert into post a simple form handler, but WordPress' engine deleted my code after saving. how can I fix it?

share|improve this question

migrated from webmasters.stackexchange.com Jul 20 '12 at 12:18

This question came from our site for pro webmasters.

Posts cannot contain PHP code, they get cleaned when you submit form. This is an obvious security precaution.

There are plugins that will enable you to do this.

For example: http://wordpress.org/extend/plugins/allow-php-in-posts-and-pages/

share|improve this answer

As an alternative to adding your PHP it may be easier to use a plugin like Contact Form 7 to create your form.

share|improve this answer

Your Answer


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