RunPHP by James van Lommel, is a Plugin for WordPress that enables bloggers to embed PHP code directly into their posts.
How to use:
- Download the plugin from the author’s site, and upload the files to the plugin directory of your wordpress weblog (/wp-content/plugins).
- Activate the plugin by logging into your WordPress administration panel, going to ‘Plugins’ on the menu bar, then clicking Activate at the end of the RunPHP row.
- Now add php codes in your posts and pages, by simply checking the new option box that says ‘run PHP code?’
The code executed by runPHP is not in the global scope. It is executed as if it were inside a function block and so you’ll need to declare your globals accordingly.
Note: The plugin doesn’t work with few badly written WordPress themes. This is most likely caused by a missing wp_head() call in the theme’s header template (often called header.php). If that is the case, fixing it is simply a matter of inserting.


