WordPress and the PHP vulnerability (PHP2Shell): what to do

Updating WordPress does not fix PHP2Shell. Your WordPress site needs PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35, which you change in your hosting account, not in WordPress. Sites on PHP 8.1 or older have to move to a newer version.

WordPress.org confirmed on October 21, 2026 that the flaws affect any server running PHP and that no WordPress update is required or planned: the fix is a PHP update.

Read-only: one standard page request, like a browser visit. We never send attack traffic.

Find your PHP version in WordPress

  1. In the WordPress dashboard go to Tools, then Site Health.
  2. Open the Info tab and expand Server.
  3. Read PHP version. Compare it with the fixed versions above. If it shows 8.1 or older, there is no fix for it.

No access to wp-admin? Check your PHP version from outside with our free checker. More on which versions WordPress supports: WordPress PHP version.

Change it at your host

After switching, load the home page, log in to wp-admin, and test your forms and checkout. If something breaks, switch back and update the plugin or theme that failed first.

If something breaks on the newer PHP

Sites that sat on PHP 7.4, 8.0 or 8.1 for years often have a plugin or theme that won't run on 8.3. The usual fixes are updating it, replacing an abandoned plugin, or a small code change. This is the part most owners hand off.

Have it done for you

Turn on continuous monitoring to watch for the signs of a break-in and every new PHP flaw, with the exact update steps for your host when one applies.

Start monitoring

Questions

Is WordPress affected by the PHP vulnerability?

Yes, because WordPress is written in PHP and runs on whatever PHP your server has. WordPress.org said on October 21, 2026 that the flaws are not specific to WordPress, affect any server running PHP, and that no WordPress update is required or planned. The fix is updating PHP.

Is my WordPress host fixing it for me?

Maybe. WordPress.org notes that hosts may already be updating PHP and adding firewall (WAF) rules, but it still tells site owners to check with their host. Check your PHP version in Site Health or with our checker, and ask the host if it's older than the fixed release.

Will updating WordPress protect me from PHP2Shell?

No. PHP2Shell is in PHP, which WordPress runs on. Updating WordPress, plugins or themes doesn't change PHP. Keep doing those updates anyway, but the PHP2Shell fix happens in your hosting account.

Will Wordfence or another security plugin block it?

A security plugin runs inside WordPress, after PHP has already handled the request, so it can't be relied on for a flaw in PHP itself. Update PHP.

Is this the wp2shell bug from July?

No. wp2shell was a WordPress core flaw fixed in WordPress 7.0.2 in July 2026. PHP2Shell is a different, newer problem in PHP.

Which PHP version should WordPress use?

PHP 8.3 or 8.4 with the October 21, 2026 fix. Both are supported for years and work with current WordPress. Check that your plugins and theme are up to date before switching.

Full details: PHP2Shell fixed versions and how to patch.