How to insert PHP code in a WordPress Post

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

2 Answers
2

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.

Leave a Comment