PHP Code Widget

Like the Text widget, but also allows working PHP code to be inserted.

Author:Otto (profile at wordpress.org)
WordPress version required:2.8
WordPress version tested:5.9.2
Plugin version:2.4
Added to WordPress repository:20-03-2008
Last updated:30-03-2022
Warning! This plugin has not 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.
Rating, %:94
Rated by:61
Plugin URI:http://ottopress.com/wordpress-plugins/php-co...
Total downloads:972 734
Active installs:100 000+
plugin download
Click to start download

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.


Screenshots
FAQ
ChangeLog