Adds a secure and simple widget in which you can use PHP and JavaScript code. Also you can use unfiltered HTML or just Text. Admin Use Only.
As of April 2026, Safe PHP Code Widget is a WordPress php plugin with 70 active installations and a 0/5 rating0. It has been downloaded 2.3K+ times in total. Requires WordPress 2.8+ and PHP false+. Available on WordPress.org since 2019. Last updated 7 years ago — may have compatibility concerns. Top alternative: WPCode – Insert Headers and Footers +….
The usual Text widget allows you to insert arbitrary Text and/or HTML code. This allows that too, but also parses any PHP or JavaScript code in the text widget and executes it.
This plugin is based on “PHP Code Widget”, but now available for use by site administrators ONLY, which makes it more secure.
All PHP code must be enclosed in the standard php opening and closing tags ( <?php and ?> ) for it to be recognized and executed. Also JavaScript code must be enclosed in the <script> and </script> tags, as usual.
| WordPress | 2.8+ requiredTested up to 5.0.25 |
| PHP | false+ required |
Plugin data sourced from WordPress.org. Analysis and metrics by PluginSift.