Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

2 Answers

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

 
discard

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