DEV Community

NextGen Fusion
NextGen Fusion

Posted on Originally published at nextgenfusion.in

How to Update PHP Version in WordPress Without Breaking It

To update the PHP version in WordPress safely, first check which PHP version your site runs and which version your WordPress core, theme and plugins support, then make the switch on a staging copy, test the pages that earn you money, and only then change the live site from your hosting panel. WordPress currently recommends PHP 8.3 or greater, and PHP 8.2 stops receiving security fixes on 31 December 2026, so many sites need this change in the next few weeks.

The PHP switch itself is one dropdown in most hosting panels and takes seconds. The risk sits in old plugins and custom theme code that break on a newer version. Below is the routine I follow on client sites, with the official WordPress and PHP pages behind each date and version.

Why the PHP version matters for a WordPress site

PHP is the language WordPress runs on, and your host decides which version your site uses. Every PHP release branch has a fixed life. According to the official PHP supported versions page, each branch gets two years of active support (bug and security fixes), then two more years of fixes for critical security issues only. After those four years, the branch reaches end of life and gets no fixes at all.

The WordPress requirements page recommends PHP 8.3 or greater, MariaDB 10.11 or greater or MySQL 8.0 or greater, and HTTPS support. It also says WordPress still works on PHP 7.4 and later in legacy environments, but warns that those older versions have reached end of life and may expose your site to security vulnerabilities. In plain terms: an old PHP version does not stop your site loading, but it leaves known holes unpatched.

Which PHP versions are supported right now?

These are the dates from php.net as of November 2026. If your site shows a version that is not in this table, such as 8.1, 8.0 or anything in the 7.x range, it is already past end of life.

PHP branch Active support until Security fixes until What it means for you
8.2 31 Dec 2024 31 Dec 2026 Plan the move now; no fixes from 2027
8.3 31 Dec 2025 31 Dec 2027 Meets the WordPress recommendation; security fixes only
8.4 31 Dec 2026 31 Dec 2028 A sensible target if your plugins support it
8.5 31 Dec 2027 31 Dec 2029 Newest; check plugin support carefully first

Step 1: Find the PHP version your site runs today

In your WordPress dashboard, go to Tools > Site Health > Info and open the Server section. It lists the PHP version along with other server details.

You can also see the version in your hosting control panel, usually in a section named something like PHP configuration or PHP version manager. Note down the exact current version before you change anything, so you know what to roll back to.

Step 2: Check that your WordPress core supports the new version

WordPress publishes a PHP compatibility table for each WordPress release. A few rows that matter in practice:

  • WordPress 6.9, 7.0 and 7.1 are listed as compatible with PHP 8.5, 8.4, 8.3, 8.2, 8.1, 8.0 and 7.4.

  • WordPress 6.7 and 6.8 go up to PHP 8.4, and WordPress 6.6 goes up to PHP 8.3.

  • WordPress 6.3 and older are not listed as compatible with PHP 8.3 or newer.

  • WordPress 7.0 dropped support for PHP 7.2 and 7.3.

So if your site is still on an old WordPress release, update WordPress core first (on staging), then change PHP. Doing both in one jump on the live site makes it hard to tell which change broke what.

Step 3: Check your theme, plugins and custom code

The same WordPress handbook page makes a point worth repeating: WordPress is rarely used without a theme or plugins. Core being compatible tells you nothing about a plugin that has not been updated in three years, or a custom theme written for PHP 7.

  • Update everything first. Update all plugins and the theme to their latest versions on staging before touching PHP. Recent releases are the most likely to include compatibility fixes.

  • Look for abandoned plugins. On each plugin's page in the WordPress plugin directory, check when it was last updated and which WordPress version it was tested up to. A plugin with no updates for years is the most likely thing to fail.

  • Ask about paid plugins. Premium plugins and page builders publish their own requirements. Check the vendor's documentation or changelog for the PHP version you are moving to.

  • Review custom code. Code in a child theme's functions.php or a custom plugin is where older PHP habits hide. A developer should read it against PHP's migration guides for each version you skip.

Step 4: Test the new PHP version on a staging copy

Make a full staging copy of the site and switch only the staging copy to the new PHP version. If you have not set one up before, our guide to setting up a WordPress staging site covers the options and how to stop staging sending real emails or taking payments.

Then click through the site the way a customer would. On a business or shop site, test at least these:

  • The home page, a service or product page, and a blog post.

  • Every contact and enquiry form, including the confirmation message.

  • Add to cart, cart, checkout and the order confirmation page, using test payment mode.

  • Logging in, the dashboard, and editing and saving a page.

  • Any booking, membership, search or filter feature your business relies on.

Turn on WordPress debug logging on staging while you test, and read the log afterwards. Warnings and deprecation notices there point you to the plugin or file that needs attention before you go live, even if the page looked fine.

Step 5: Switch PHP on the live site and keep a way back

Once staging passes, take a fresh backup of the live files and database. Pick a quiet hour for your traffic, change the PHP version in the hosting panel, and clear any server or plugin cache so visitors get pages built on the new version.

Run the same short test list on the live site straight away. If something breaks, switch the PHP version back to the one you noted in Step 1. Changing back takes seconds and buys you time to fix the plugin on staging without losing orders or enquiries.

What to do if the site breaks after a PHP update

White screen or "There has been a critical error"

This usually means a plugin or theme uses code the new PHP version no longer accepts. Switch PHP back first so the site is up, then find the culprit on staging by reading the error log or deactivating plugins one at a time.

One feature stopped working

If the site loads but a form, slider or checkout step fails, the plugin behind that feature is the first suspect. Check for an update, contact the plugin author, or replace it with a maintained alternative.

A plugin has no compatible version

Do not stay on an end-of-life PHP version for one plugin. Replace the plugin, or have a developer patch or rebuild that feature. An outdated PHP version and an abandoned plugin are both risks, and our website security checklist covers why unpatched software is one of the first things to fix.

Frequently asked questions

Which PHP version should my WordPress site use?

WordPress recommends PHP 8.3 or greater. For most sites on a current WordPress release, PHP 8.3 or 8.4 is a practical choice, as long as your theme and plugins support it. Check the plugin requirements before choosing 8.5.

Will updating PHP make my site faster?

It can help, but it is not a guaranteed fix for a slow site. Slow WordPress sites usually have bigger causes such as heavy themes, too many plugins or no caching. Our guide on fixing a slow WordPress site covers those first.

Can updating PHP delete my content?

No. Changing the PHP version does not touch your database or uploads. The risk is that pages or features stop working until incompatible code is fixed, which is why you test on staging and keep the old version ready to switch back.

What happens if I stay on PHP 8.2 after December 2026?

According to php.net, PHP 8.2 security support ends on 31 December 2026. Your site will keep loading, but any security issue found in PHP 8.2 after that date will not be fixed by the PHP project.

Updating the PHP version in WordPress is a short job when you do it in order: note the current version, confirm core, theme and plugin support, test on staging, then switch the live site with the old version ready as a fallback. If your site is on PHP 8.2 or older, plan the move before 31 December 2026.


Originally published on the NextGen Fusion blog. I'm Ritesh Kumar Giri, founder of NextGen Fusion, a web and software development studio.

Top comments (0)