3

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

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

This question came from our site for pro webmasters.

6

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.

2

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