How to Update the PHP Version in WordPress Safely (2026)

Open Tools > Site Health > Info > Server and read the PHP version line. If it says anything below 8.2, move to PHP 8.3 or newer now: test it on a staging copy first, then switch it in your host panel.

This is how to update PHP version in WordPress safely, without gambling with the live site. The PHP project announced a critical security release on 21 Oct 2026, and WordPress.org (opens in a new tab) urges site owners to update PHP immediately.

Key takeaways

  • Versions of PHP before 8.2 no longer receive security updates from the PHP project, so those sites come first.
  • PHP 8.6 is due on 19 Nov 2026 and is not released yet. Do not put it on a production site.
  • Match your WordPress version to the compatibility table, then check each plugin’s "tested up to" and requirements fields.
  • Change PHP on the staging copy first, turn on WPDEBUGLOG, and click through forms, login, checkout and the admin.

Read your PHP version in Site Health before you change anything

The exact version is under Tools > Site Health > Info > Server, on the line labeled PHP version. The Status tab may show a warning such as "PHP Update Required", but only the Info tab tells you which version you actually run. Write it down, because every later decision depends on it.

WordPress says that versions of PHP prior to 8.2 no longer receive security updates from the PHP project (opens in a new tab). Sites already on a supported version mainly need to confirm that the host has applied the patches. Your host may already be putting web application firewall (WAF) rules in place, but check anyway.

If Site Health is blocked or the admin is unreachable, there are two fallbacks. The host panel usually shows the PHP version per domain, and the host’s support team can tell you if it doesn’t. With shell access, WP-CLI gives you the answer in one line:

Bash
wp eval 'echo PHP_VERSION;'

Warning: If you manage your own server and run a version before 8.2, WordPress quotes the UK National Cyber Security Centre: "Where immediate remediation is not feasible, organisations should consider taking the system offline until it can be fully mitigated." On shared hosting, the host controls that decision.

One more question decides your path: can you change PHP yourself, or only the host? WordPress.org (opens in a new tab) notes that many hosts let you do it yourself. If yours does not, send the support ticket today and run the staging test while you wait for the answer.

Pick a target PHP version that WordPress and your plugins both support

Choose PHP 8.3 or higher, and 8.4 for most sites. WordPress currently recommends 8.3 or higher, and the PHP project’s supported versions page (opens in a new tab) shows the support dates for each branch. As of 16 Nov 2026 it lists these:

PHP branchInitial releaseSecurity fixes until
8.28 Dec 202231 Dec 2026
8.323 Nov 202331 Dec 2027
8.421 Nov 202431 Dec 2028
8.520 Nov 202531 Dec 2029

PHP 8.2 is on the list but runs out of security fixes in six weeks, so treat it as a stopover at best. I would pick 8.4 over 8.5 for most sites, because plugin authors have had a full year with it and it covers you until 31 Dec 2028. PHP 8.6.0 is still a release candidate on php.net, due 19 Nov 2026, and WordPress lists no compatibility for it yet.

Next, check that your WordPress version supports the target. The WordPress core compatibility table (opens in a new tab), last updated 4 Nov 2026, gives the ceiling:

WordPress versionHighest PHP version listed
7.1, 7.0, 6.98.5
6.8, 6.78.4
6.6, 6.5, 6.48.3

If you run WordPress 6.6 or older, update WordPress first. A site stuck on 6.4 cannot reach 8.4 on the table’s terms.

Then check every plugin and theme. Open each one’s WordPress.org page and read the "tested up to" and requirements fields, the last update date and the changelog. WordPress itself runs on newer PHP, but it cannot promise that your themes and plugins do (opens in a new tab).

This is where updates go wrong. In our work, the most common expensive mistake is choosing a plugin without considering its compatibility with other plugins and the hosting environment, and the PHP version is part of that environment. Our approach is an extensive testing audit and fixes, and the same applies here: find the failures before visitors do. If you add a security plugin, we recommend Wordfence, and it gets the same version check as everything else.

Back up, build a staging copy and test the new PHP version there

Take a full backup of files and database, restore it somewhere to prove it works, and change PHP on that copy only. A backup you have never restored is a guess. Restoring it into a staging site verifies the backup and gives you the test bed in one move.

With WP-CLI, the database export is one command:

Bash
wp db export pre-php-update.sql

Copy wp-content along with it. Inspect the site first, too. A backup of an already compromised site restores the compromise, and Eve’s 2015 write-up (opens in a new tab) [1] describes a PHP eval injection found in a live WordPress install. If you see odd files or unexplained admin users, clean the site before you do anything else.

Build the staging site with your host’s staging tool if there is one. Otherwise copy the files and database to a subdomain, update the URLs in the copy and block indexing. Set the new PHP version on staging only, then add debug logging to wp-config.php:

PHP
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Errors now go to wp-content/debug.log instead of the screen. Click through the same list every time:

  1. The front page and one post of each type.
  2. Every contact, search and signup form.
  3. Login, checkout and account pages, if you have them.
  4. The admin screens: Plugins, Settings, and each plugin’s own page.
  5. Your most plugin-heavy pages, such as page builder layouts.

Then read the log. Deprecation notices are only warnings. Fatal errors name the plugin or theme file that failed, which tells you what to update, replace or drop.

Update the PHP version in WordPress from cPanel, Plesk or hPanel

Once staging is clean, apply the same version to the live site in your host panel. Menu names change by host and panel version, and I did not run these click paths for this article, so treat the table as a map and check your host’s documentation.

PanelWhere to lookNotes
cPanelSoftware > MultiPHP ManagerTick the domain, pick the version, click Apply. This is the usual path for update PHP cPanel searches.
PleskWebsites & Domains > PHP SettingsChoose the PHP version for the domain and save.
hPanelAdvanced > PHP ConfigurationPick the version and save.
No PHP optionHost support ticketAsk for the exact version you tested.

If you cannot find your host, WordPress.org suggests (opens in a new tab) emailing the host and asking what steps are needed. Name the exact version, for example "PHP 8.4", so the reply doesn’t come back as "the latest".

Switch at a quiet hour. Afterwards, reload Site Health to confirm the new version on the Info tab, then repeat the click-through on the live site.

Roll back in the host panel if a plugin breaks

If the live site fails after the switch, set the PHP version back in the same panel. That restores the old runtime within a minute or two and takes the pressure off. Do not debug a broken checkout while customers are watching.

Then find the culprit in wp-content/debug.log. To get the site loading without waiting for a fix, deactivate the plugin named in the fatal error:

Bash
wp plugin deactivate plugin-slug

Without WP-CLI, rename the plugin’s folder over SFTP. From there you can update it, replace it with a maintained alternative, or ask its developer whether it supports your PHP version. WordPress.org’s own advice for abandoned plugins is to look for a similar maintained one (opens in a new tab).

When the site itself is damaged, ask the host to restore the previous PHP version, then restore your backup, which is the order WordPress.org gives (opens in a new tab). Restoring the backup alone leaves you on the wrong runtime.

Next step: open Site Health today and note your PHP version. If it is below 8.2, ask your host whether you can change it yourself, and start the backup and staging copy the same day. If it is 8.2, schedule the move to 8.3 or 8.4 before 31 Dec 2026.

Frequently Asked Questions

How to change the PHP version in WordPress?

WordPress does not set the PHP version; your host does. Back up the site, test the new version on staging, then pick the version in your host panel, such as MultiPHP Manager in cPanel. Confirm the result under Tools > Site Health > Info > Server.

How to update PHP for WordPress?

Check your current version in Site Health, choose a supported target (8.3 or higher), and confirm your WordPress version and plugins support it. Back up, test on a copy, then switch it live. Do the checks in that order.

How to update PHP for a WordPress site if my host does not show a PHP option?

Send your host’s support a ticket naming the exact version you tested, for example PHP 8.4. WordPress.org also provides a template email you can adapt. If the host cannot offer a version of 8.3 or higher, plan a move to a host that can.

How to update the PHP version in WordPress with cPanel?

In cPanel, open Software > MultiPHP Manager, select your domain, choose the PHP version and click Apply. Menu names vary by host, so check their docs. Reload Site Health afterwards to confirm the new version.

Is PHP 8.6 compatible with WordPress?

Not yet. PHP 8.6 is due 19 Nov 2026, and the WordPress core compatibility table, last updated 4 Nov 2026, lists versions only up to 8.5. Wait for WordPress to list it, then test on staging.

Which PHP versions still get security fixes?

As of 16 Nov 2026, php.net lists 8.2 (until 31 Dec 2026), 8.3 (until 31 Dec 2027), 8.4 (until 31 Dec 2028) and 8.5 (until 31 Dec 2029). Anything older is end of life and gets no fixes from the PHP project.

References

  1. "Wordpress php eval attacks", Eve, 2015. doi:10.59348/4wvv5-fe614 (opens in a new tab)