Plugin Directory

Test out the new Plugin Directory and let us know what you think.
!This plugin hasn’t been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Allow PHP in Posts and Pages

Allow PHP in posts and pages allows you to add php functionality to WordPress Posts and Pages

What Tags Are Automatically Removed?

Currently all <br /> and <p> (and its closing counterpart) tags are removed from the input code because these are the tags that WordPress automatically add.

How Do I Add Tags Without Them Being Stripped?

If you want to echo a paragraph tag or a line break, or any other tag (strong, em etc) instead of enclosing them in < and > tags, enclose them in [ ] brackets for example [p] instead of <p> The square brackets are converted after the inital tags are stripped and function as normal tags.

Thats All Good But I want To Include A [ and ] In My Output!

The tag replacement system only replaces [ and ] when they are paired up and text content inside e.g. it wont replace [] and wont replace [hello[ but it will replace [hello], to prevent this, escape the opening [ with a \ so write [hello]

Can I still connect to non-wordpress databases?

Yes you can, just use the standard mysql_connect or the mysql_pconnect and their parameters.

A function that was working before upgrading, no longer works

If you are upgrading Allow PHP In Posts and Pages from a version before 2.2.0 you may experience issues with the code being disrupted as the replacement method has been changed, however you can set the tag replacement method to be the older version in the plugin options or by adding mode=old to the [php] tag, similarly, if you wish to use the new method when you have the old method turn on in the plugin options, just add mode=new to the [php] tag

The sample code provided on the plugin page doesnt work!

On the plugin page, the code is written with spaces in the [php] tag, these need to be removed before the tag will work.

My code doesn't work

First of all, check that the syntax is valid, make use of the debug feature and try to use snippets with variable sharing or the advanced filter, then if it still doesn't work, come leave a question on the support page

I found a bug!

We are constantly looking to improve the plugin, found a bug, or simply have a request, let us know on the support page!

Upgrading broke my old code!!!

If you are upgrading to 3.0.x from 2.3, make sure that advanced filter is turned off if you were not using it before, if you are upgrading from a version number lower than 2.2.0, make sure you enable the option to use the old code replacement method to ensure your code continues to work

My question is unanswered

We are very busy creating new WordPress plugins and we don't always check the support forums on wordpress.org, leave a question on our website and we will try to get back to you as soon as possible

My Question Is Not Answered Here!

100's of other questions have been asked on the http://www.hitreach.co.uk/wordpress-plugins/allow-php-in-posts-and-pages/, go take a look and see if yours may be answered there!, if it isn't, leave a comment

Requires: 2.5 or higher
Compatible up to: 3.5.2
Last Updated: 4 years ago
Active Installs: 30,000+


4.2 out of 5 stars


Got something to say? Need help?


Not enough data

1 person says it works.
0 people say it's broken.

100,1,1 100,1,1
0,5,0 100,1,1 100,1,1 100,1,1 100,2,2
100,2,2 0,2,0
0,1,0 0,1,0
100,2,2 100,1,1
100,2,2 0,1,0
100,7,7 100,2,2