Dieses Plugin ist nicht mit den jüngsten 3 Hauptversionen von WordPress getestet worden. Es wird möglicherweise nicht mehr gewartet oder unterstützt und kann Kompatibilitätsprobleme haben, wenn es mit neueren Versionen von WordPress verwendet wird.

PHP Code Widget


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.


  • The widgets screen showing a PHP code widget in use.
  • The output of the widget on the site.


There’s some kind of error on line 27!

That error means that your PHP code is incorrect or otherwise broken.

But my code is fine!

No, it’s not. Really.

This widget has no real errors in it, it’s about the simplest widget one can possibly make. Any errors coming out of the „execphp.php“ file are errors in code you put into one of the widgets. The reason that it shows the error being in the execphp.php file is because that is where your widget’s code is actually being run.

So, if it says that you have an error on line 27, I assure you, the problem is yours. Please don’t email me about that error.

I have code that works normally in a template but doesn’t work when in the widget?

Code in a template runs in the global context. Code in the widget will run in a function context. Make sure that you declare any global variables as global before attempting to use them.


Unfrieking Unfreikingbelievable !!!

Simply Awesome !!!


No, instead we waste our time with useless Gutenberg !!!

Thanks for the plugin, it is a time saver for me. I can put the code in a widget, and display the widget in the content area via a shortcode… does the job well.

this is truely one of the very best WordPress widget-things

php-code-widget: It is intuitive and easily managed. i am overwhelmed by this great plugin: this php-code-widget plugin is truely outstanding!!!

i have to confess: this is truely one of the very best WordPress widget plugins.

Super easy to use and super-super powerful. You can do alot with this plugin. I have tried other solutions but this is as to close perfect as we have found, It offers everything we wanted so far so, and if we need more there are paid extensions at reasonable cost.
I ve testet other ones; here some features that have convinced me – i am satisfied..

The installation of the php-code-widget: it is easy – the first steps were done in a few minutes: you do not have to worry about it nor trouble to do such repetitive tasks.
Just pick categories which suit your site and it will work.

And last but not least: Support is overwhelming: – the develoer rocks!!!

conclusio; php-code-widget – this plugin is for many many users – and for every one who wants to run an php-code-widget.

A trillion thanks to the developer for developing and release this plugin for free!
keep up this super-work!!! Thousands of wordpress-fans from all over the globe were happy with this plugin…

Cool widget

Exactly what I was loking for!

I was trying to move a login php to my sidebar by coding it, when I found this plugin:
It ’s simple and efficient. Great job!


Programmer is not serious about this product. Refused to update the plugin even though WordPress.org still gives a warning it has not been tested with the current version of WordPress. Unprofessional.

Lies alle 57 Rezensionen

Mitwirkende & Entwickler

„PHP Code Widget“ ist Open-Source-Software. Folgende Menschen haben an diesem Plugin mitgewirkt:


„PHP Code Widget“ wurde in 6 Sprachen übersetzt. Danke an die Übersetzerinnen und Übersetzer für ihre Mitwirkung.

Übersetze „PHP Code Widget“ in deine Sprache.

Interessiert an der Entwicklung?

Durchstöbere den Code, sieh dir das SVN Repository an oder abonniere das Entwicklungsprotokoll per RSS.



  • 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/


  • Translation fixes for WP 3.7
  • Remove donation link


  • Fixed broken wpautop filter. Checkbox on widget works now.


  • 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.