Enables the previous "classic" editor and the old-style Edit Post screen with TinyMCE, Meta Boxes, etc. Supports all…
About PHP Code Widget
This plugin allows you to insert PHP code into the Text widget, making it easier to migrate to a widget-based theme. However, it is not recommended for long-term use as it can pose a security risk. Only users with the unfiltered_html role will be able to insert unfiltered HTML, including PHP code.Screenshots


Frequently asked questions
What does the Text widget allow you to do?
The Text widget allows you to insert arbitrary Text and/or HTML code.
Does the Text widget execute PHP code?
Yes, the Text widget parses and executes any PHP code included in it.
Is it recommended to use the Text widget for long-term usage?
No, it is not recommended to use the Text widget long term as it allows execution of arbitrary PHP code.
Who can insert unfiltered HTML using the Text widget?
Only users with the unfiltered_html role will be allowed to insert unfiltered HTML, including PHP code.
Can users without admin or editor permissions execute PHP code using the Text widget?
No, even if they have widget editing permissions, users without admin or editor permissions cannot execute PHP code using the Text widget.
Changelog
2.4
- After much demand, made it stop throwing a warning in PHP 8. Please consider ceasing usage of this widget on modern sites. Switch to block based themes, or use purpose specific plugins to solve your needs instead of storing PHP code in the database.
2.3
- Changed the call to WP_Widget to use the PHP 5 __construct() method. Ref: https://make.wordpress.org/core/2015/07/02/deprecating-php4-style-constructors-in-wordpress-4-3/
2.2
- Translation fixes for WP 3.7
- Remove donation link
2.1
- Fixed broken wpautop filter. Checkbox on widget works now.
2.0
- Changed widget to use new Class methods for creating widget. This simplifies the widget and should eliminate any problems with it losing code or disappearing from sidebars and so forth.