Like the Text widget, but also allows working PHP code to be inserted.
As of April 2026, PHP Code Widget is a WordPress php plugin with 90K+ active installations and a 4.7/5 rating from 61 reviews. It has been downloaded 994K+ times in total. Requires WordPress 2.8+ and PHP false+. Available on WordPress.org since 2008. Last updated 4 years ago — may have compatibility concerns. Downloads are down 18% this week. Top alternative: WPCode – Insert Headers and Footers +….
The normal Text widget allows you to insert arbitrary Text and/or HTML code. This allows that too, but also parses any PHP code in the text widget and executes it.
This can make it easier to migrate to a widget-based theme. However, this plugin should not be used long term, as anybody with access to edit the widgets on your site will be able to execute arbitrary PHP code.
All PHP code must be enclosed in the standard php opening and closing tags ( <?php and ?> ) for it to be recognized and executed.
Only users with the unfiltered_html role will be allowed to insert unfiltered HTML. This includes PHP code, so users without admin or editor permissions will not be able to use this to execute code, even if they have widget editing permissions.
Excellent, awesome // incredible plug in!!
keep it going please
No highlighting for snippets.Support also doesn’t exists. You can find much better plugins to insert php code snippets
A very useful widget. Especially in emergency situations when there is no time to write your own solution for your task.
I was trying to find the updated plugin for PHP and at last I found this, because they update there plugin regularly. So I must say to enjoy this plugin.
| WordPress | 2.8+ requiredTested up to 5.9.13 |
| PHP | false+ required |
Plugin data sourced from WordPress.org. Analysis and metrics by PluginSift.