BLACK FRIDAY
Save 59% on PageForge Annual $191/year $485/year
Claim 59% Off →
PHP Code Widget icon
Possibly abandoned Tested up to 5.9.18 #581 most installed plugin #1 in execphp

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.

Active installs70K+50K+ tier
Downloads · 30d1K▼ -9% vs prev. 30d
Rating4.7/561 reviews
Health score47/100Fair
All-time downloads1MSince Mar 2008
Support resolved—No recent threads
RequiresWP 2.8PHP any
Overall rank#581of 69,475 plugins
Our verdict

Use with caution

PHP Code Widget works, but test it on a staging site before relying on it in 2026. It runs on 70K+ sites, is rated 4.7/5 and was last updated 4 years ago, and scores 47/100 on our health check.

  • Proven at scale on 70K+ active sites
  • Loved by users — 4.7/5 from 61 reviews
  • No update in 4 years
  • Only tested up to WordPress 5.9 (latest is 7.1)

Daily downloads

153146Jun 28Aug 11Sep 25
Yesterday55
Daily average (1y)27
Peak day73Oct 6, 2025
Last 12 months9.9K

Download spikes usually follow a new release — each site that auto-updates counts as a download.

Rankings

Where PHP Code Widget stands today
Overall popularity #581 of 69,475 WordPress.org plugins Top 0.84%
50K+ installs tier 115 of 324
Next tier: 100K+ installs
Execphp #1 of 1 plugins → Php #4 of 143 plugins → Widget #10 of 2,304 plugins →

WordPress.org search rankings

Live position in the plugin search, top 100
KeywordPositionCompeting pluginsCategory
execphp #1 1 Best execphp plugins →
php >100 10,000 Best php plugins →
widget >100 10,000 Best widget plugins →

Version adoption

Share of active sites per release.

  • 2.479.3%
  • 2.317.4%
  • Other3.4%

Rating breakdown

★★★★★★★★★★ 4.7 from 61 reviews

  • 5★85.2%
  • 4★8.2%
  • 3★1.6%
  • 2★0.00%
  • 1★4.9%

About PHP Code Widget

From the official readme · v2.4

Description

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.

Frequently asked questions

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.

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.

Full changelog on WordPress.org →

Screenshots

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

For developers

Is this your plugin? Show off the numbers.

Add a live badge to your site, docs or GitHub README. It updates on its own — no account needed.

Active installs badge Rating badge Health score badge

FAQ

PHP Code Widget: quick answers

Straight answers, pulled from live WordPress.org data.

Live data from WordPress.org · checked Sep 26, 2026

Is PHP Code Widget free?

Yes. PHP Code Widget is free to download and use from the official WordPress.org plugin directory.

Is PHP Code Widget safe to use in 2026?

PHP Code Widget works, but test it on a staging site before relying on it in 2026. It runs on 70K+ sites, is rated 4.7/5 and was last updated 4 years ago, and scores 47/100 on our health check.

How many websites use PHP Code Widget?

PHP Code Widget is active on 70K+ WordPress websites and has been downloaded 1,000,136 times since it launched in March 2008. It was downloaded 1,020 times in the last 30 days.

Does PHP Code Widget work with WordPress 7.1?

PHP Code Widget is officially tested up to WordPress 5.9.18, while the latest release is 7.1.2. It may still work, but try it on a staging site first.

When was PHP Code Widget last updated?

The latest version, 2.4, was released on March 30, 2022 (4 years ago).

Who makes PHP Code Widget?

PHP Code Widget is developed and maintained by Samuel Wood (Otto).

Powered by PageForge

Want thousands of pages that rank like these? Build them in an afternoon.

This directory runs on the same engine as PageForge. Turn any spreadsheet, CSV or API into thousands of fast, SEO-ready WordPress pages — with schema, internal links and AI-written copy baked in.

  • CSV, Google Sheets & API data sources
  • AI content, schema & internal links per page
  • Works with Elementor, Gutenberg, Yoast & Rank Math
  • Free on WordPress.org — no credit card
Sarah is here to help!
Hi there! 👋 Need help finding what you're looking for?
Sarah
Sarah
Online & Ready to Help
Hi there! 👋 Need help finding what you're looking for?

We'll use this to continue our conversation

Just now ✓ Verified

Join 500+ SEO Pros Scaling Their Strategy

Get exclusive programmatic SEO tactics, AI content workflows, and the latest PageForge updates delivered straight to your inbox. Stay ahead of the algorithm.

We care about your data in our privacy policy.