I need to insert into post a simple form handler, but WordPress' engine deleted my code after saving. how can I fix it?


You cannot save raw PHP inside post content, it gets cleaned out on save. This is an obvious security precaution.

However, there are plugins that will enable you to do this, for example: http://wordpress.org/extend/plugins/allow-php-in-posts-and-pages/

This is not recommended though, better solution would be to create a generic shortcode for your from.


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

Your Answer

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