How to update PHP in WordPress safely

by Jason 10 December, 2022

PHP update news

Maybe your host has emailed to say the PHP version behind your website is out of date, or a plugin update won’t install until you’re running something newer. Either way, learning how to update PHP in WordPress is mostly about preparation. On most hosting, the switch itself is a single setting in your control panel and takes a moment. What makes it safe is the work around that setting: noting the version you’re on now, having a backup you know you can restore, trying the new version on a copy of the site first, and testing the pages that bring in enquiries and sales once the change is live.

This guide goes through that process in order. It’s written to work whoever hosts your site, because the setting goes by different names from one host to the next, while the steps that protect you stay the same everywhere.

Why update PHP at all?

PHP is the programming language WordPress, your theme and your plugins are written in, and your host runs a particular version of it on the server. Each PHP version gets two years of active support, followed by two years of security fixes only. After that it reaches end of life and receives no further fixes, even if a security problem is found.

WordPress.org currently recommends PHP 8.3 or greater. WordPress will still run on PHP 7.4 and above in older environments, but WordPress.org notes that those versions have reached end of life and may expose a site to security vulnerabilities. There’s a practical side too. Plugin and theme developers move their code forward over time, so a site left on an old version will sooner or later find that some updates need a newer PHP version than the server has, which leaves you stuck between outdated plugins and an outdated server.

How to check your current PHP version

There are two easy places to look. In your WordPress dashboard, go to Tools > Site Health, open the Info tab and expand the Server section, where the PHP version is listed. Alternatively, log in to your hosting control panel and find the PHP setting, which will show the version currently selected for your site.

Write the version down before you change anything, including the full number, such as 7.4 or 8.1. It feels like a small step, but it’s what makes rolling back quick if something goes wrong later, because undoing the change usually means selecting that same version again.

If you manage several sites on one hosting account, check each one. Some control panels let you set PHP per domain, so sites on the same account aren’t always running the same version.

Before you update: backup, staging and compatibility

Take a full backup

A full backup covers both the files and the database. The files hold your theme, plugins and media uploads, while the database holds your pages, posts, settings, orders and form entries. Many hosts take automatic backups, and plenty of sites run a backup plugin as well, but before a change like this it’s worth taking a fresh one on demand so it reflects the site as it is today.

Just as important is knowing how you’d restore it. A backup you’ve never restored, or one stored somewhere you can’t easily reach, gives less protection than it seems to. Check where it’s kept, that it includes the database, and that you or your host can put it back if needed.

Test on a staging copy first

A staging site is a private copy of your website where you can try changes without visitors seeing them. Many hosts offer one-click staging from the control panel, and some backup plugins can create one too. If yours does, switch the staging copy to the new PHP version first and click through the site properly before touching the live version.

This matters most when you’re jumping several versions at once, say from 7.4 to 8.3, because the bigger the jump, the more chance there is that something in an older plugin, theme or piece of custom code won’t behave. If staging isn’t available on your hosting, a backup and a clear rollback plan become even more important, and it’s sensible to make the change at a time when few people are using the site.

Check plugin and theme compatibility

Before you switch, update WordPress, your plugins and your theme to their latest versions, ideally on staging first. Developers often add support for newer PHP versions in their updates, so running current versions removes a lot of potential problems before you start.

Then look for anything that hasn’t been updated in a long time or has been abandoned by its developer. Plugin listings on WordPress.org show when a plugin was last updated, and premium plugins and themes usually state their requirements on the developer’s site. Custom code is the other thing to think about: if a developer built bespoke features or edited your theme’s files at some point, that code won’t have been updated automatically and is worth checking before the change.

How to update PHP in WordPress through your hosting panel

The PHP version isn’t changed inside WordPress itself. It’s a setting on your hosting, so you’ll make the change in your host’s control panel. Where that setting lives, and what it’s called, varies from host to host. In cPanel you’ll often find it under something like “Select PHP Version” or “MultiPHP Manager”, while hosts with their own dashboard might call it “PHP version”, “PHP selector” or “PHP settings”, sometimes tucked inside a section for the individual site or domain. If you can’t find it, your host’s help pages or support team will be able to point you to it quickly.

The general process for a WordPress PHP update looks like this:

  1. Log in to your hosting control panel and open the PHP version setting for the site you’re updating.
  2. Confirm the current version matches the one you noted earlier.
  3. Select the new version from the list and save or apply the change.
  4. Wait a minute or two, as some hosts take a short while to apply it.
  5. Clear any caching on the site and in your browser, then load the site in a private browser window.

If you’re running a WooCommerce store or a site that takes bookings, choose a low-traffic time for the switch, so any problem affects as few customers as possible while you check things over.

After updating: check it works and what can break

Start by confirming the change has taken effect. Go back to the same screen you used to check the version earlier, or the setting in your control panel, and make sure the new version is showing.

Then test the site the way a customer would use it. The homepage loading is a good sign, but it tells you very little about the parts of the site that make money, so work through those deliberately. Submit your contact form and check the enquiry arrives. If you sell online, add a product to the basket and go through checkout as far as you safely can. Try any booking system, quote form, login area or search. Then log in to the WordPress dashboard and check that editing a page and saving it still works.

When something does break after a PHP change, it tends to show up in one of a few ways:

  • A white screen with no content at all.
  • A message saying “There has been a critical error on this website.”
  • A specific feature that stops working, such as a form that won’t submit or a checkout that won’t complete, while the rest of the site looks fine.

The cause is usually an older or abandoned plugin or theme, or custom code written for an earlier PHP version. If WordPress catches a fatal error, it sends a recovery-mode email to the site’s admin address, explaining which plugin or theme caused the problem and giving you a link to log in and deactivate it. Check that inbox, including spam, if anything goes wrong. Your hosting control panel will usually have an error log too, which records the file and line where things failed, and that’s the first thing a developer will want to see.

Your rollback plan

If the site breaks and you can’t see an obvious fix, rolling back is normally straightforward. Go back to the same PHP setting in your hosting panel, select the version you noted before you started, and save. Clear caches and check the site again. In most cases that puts things back as they were within a few minutes.

If switching back doesn’t fix it, for example because a plugin update or a database change happened alongside the PHP change, that’s when the full backup you took earlier comes in. Restore it, confirm the site is working, and then look at what needs fixing before trying again. Rolling back is a sensible pause rather than a dead end, as it gives you time to update or replace the plugin causing trouble, or have the code fixed, before making the switch again.

Which PHP version should you choose?

What is the latest PHP version recommended for WordPress?

WordPress.org recommends PHP 8.3 or greater. As at October 2026, the PHP branches still supported are 8.2, 8.3, 8.4 and 8.5. PHP 8.2 receives security fixes only until 31 December 2026, so choosing it now means repeating this process fairly soon. PHP 8.3 has security support until 31 December 2027, PHP 8.4 until 31 December 2028, and PHP 8.5, released on 20 November 2025, until 31 December 2029.

For most sites, 8.3 or 8.4 is a sensible target, provided your plugins and theme support it. Your host may not offer every version yet, so you’ll be choosing from what’s available in your panel.

Is PHP 8.4 stable for WordPress?

PHP 8.4 is a currently supported branch, with active support until 31 December 2026 and security fixes until 31 December 2028. Whether it’s the right choice for your site depends far more on your plugins, theme and any custom code than on WordPress itself. A site running well-maintained plugins may move to 8.4 without any trouble, while one relying on an older plugin may need that plugin updated or replaced first. That’s exactly what a test on staging will tell you, and it’s why we’d always try the target version there before changing the live site.

PHP 7.4 end of life: what it means if you’re still on it

PHP 7.4 reached end of life on 28 November 2022, which means it hasn’t received any security fixes since then. WordPress will still run on it, as 7.4 remains the minimum WordPress supports in older environments, but WordPress.org notes that versions at end of life may expose a site to security vulnerabilities.

If your site is still on 7.4, the move to 8.3 or above is a bigger jump than most, so the preparation above carries more weight. Update your plugins and theme first, look carefully at anything that hasn’t been updated in years and at any custom code, and test the new version on staging before you switch the live site. Your site isn’t going to stop working overnight, but the longer it stays on 7.4, the more plugins and themes are likely to require something newer.

When to hand it to a developer

For many sites, especially those running current, well-maintained plugins, this is a job you can do yourself with the steps above. The harder part is knowing in advance whether your site is one of those. If you’re jumping several versions, rely on custom code or older plugins, or run a store where a broken checkout means lost orders, it can make sense to hand it over.

Where a plugin or theme isn’t compatible with the newer version, a WordPress developer can update or replace the code so you can move forward rather than staying on an old version. If you’d prefer PHP, WordPress and your plugins kept current as part of ongoing work, a development retainer covers that. And if the change needs to happen when your site is least busy, we can carry it out using our out of hours WordPress support.

We’re a Norwich WordPress agency with over a decade of WordPress specialism, and we’re happy to talk it through. Give us a call on 01603 555590 or get in touch through any of the links above.