PHP Code Widget
Plugin: PHP Code Widget
Version: 2.1
Last updated: 307 days ago.
Downloaded: 109,157 times.
Overview
The normal Text widget allows you to insert arbitrary Text and/or HTML code. This allows that too, but also parses any inserted PHP code and executes it. This makes it easier to migrate to a widget-based theme.
Download Now
Requirements
WordPress 2.8 or higher.
Features
- Like a Text widget, but works with PHP code.
- PHP Code must be in tags to function.
Installation Instructions
- Upload the files to the `/wp-content/plugins/php-code-widget/` directory
- Activate the plugin through the ‘Plugins’ menu in WordPress
Licensing
This plugin is licensed under the GPL Version 2 only.
Method to get support
You are free to email me, however I am also a moderator at the WordPress.org support forums, so you’ll find me there as well.

I was looking for something like this. I was so noob when I try to put php int text/html widget box and that doesnt works. Thanks for this.
I am a WP newbie, so I just followed the instructions and uploaded the execphp.php file and activated it thru the Plugins screen. So far, so good.
When I make a new post thru
1. VISUAL mode, is just printed on the screen (as text)
2. HTML mode, it becomes
Neither way is getting parsed, what am I doing wrong?
Thanks
This plugin doesn’t execute code in posts. It creates a sidebar widget which will run PHP code.
Oh okay, thanks for the quick reply, Otto!
Thank you for yr plugin. I had it installed fine on one site. I cloned that site, but on the cloned site none of the widgets are copied over. I copied ALL the files and SQLed the whole database. The ONLY file I changed was wp-config.php, pointing to the new database. Everything else works fine. I don’t know if the “problem” is with your widget, or with wordpress cloning widgets. I took special care with wp-options, ID=195. Since EVERYTHING is cloned except pointing to the new database, I’m at a loss to understand why 1 installation would show the widgets, and the other not.
The new installation had all the plugins correctly installed, also.
anyway thank you again, for yr nice widget, as wp itself is very php, it’s kind of strange that it is not built in into the source code.
Moving blogs around is finicky in WordPress in general. If the URL is different between the two sites, search through for where that URL might be in the database. Some of the rows of the options table incorporate it in as a hash or plaintext in the key names.