Updating the PHP version in WordPress without breaking the site
PHP 8.2 gets no security updates after 2026. How to move WordPress to PHP 8.3 or 8.4: backup, test on a copy, a test list and the way back.
Contents
You update the PHP version of a WordPress website in your host's customer panel, not in WordPress itself. Before that come a backup and the updates for plugins, theme and WordPress, afterwards a test of the most important pages and forms. If something breaks, you select the old version again in the same menu.
Right now this affects a lot of websites: according to php.net, PHP 8.2 gets no more security updates after 31 December 2026, and PHP 8.1 has had none since the end of 2025 (as of 30 November 2026). According to wordpress.org statistics, more than half of all WordPress sites ran on PHP 8.2 or older on 30 November 2026. If your site still runs one of these versions, switch before the end of the year. The routine below is the one I use for PHP switches in my support work: first on a copy, then live, and with an error log that shows which plugin is causing trouble before visitors notice.
Which PHP version your website uses now
WordPress shows the version under Tools, Site Health, Info in the “Server” section. If it is outdated, Site Health recommends or requires a PHP update there, see the Site Health documentation. Your host's customer panel shows the same value, and that is also where you change it; for the German hosts see the guides from IONOS, STRATO, All-Inkl or Hetzner (all in German).
On your own server, the command php -v only reports the command-line version. The website can use a different one through PHP-FPM, and cron jobs or WP-CLI sometimes run with their own version too. What counts for the website is the value in Site Health.
Which version to switch to
Which PHP branches are still supported is listed on php.net under Supported Versions. Each branch gets two years of bug fixes, then two more years of security fixes only. As of 30 November 2026 it looks like this:
| PHP version | Security updates until |
|---|---|
| 8.2 | 31 December 2026 |
| 8.3 | 31 December 2027 |
| 8.4 | 31 December 2028 |
| 8.5 | 31 December 2029 |
| 8.6 (since 19 November 2026) | 31 December 2030 |
WordPress recommends PHP 8.3 or newer in its requirements. Since WordPress 7.0 from May 2026, PHP 7.4 is the minimum, as the core team announced in January. According to the compatibility table, WordPress 7.1 supports versions 7.4 to 8.5; PHP 8.6 is not listed there yet (as of 30 November 2026). For shops, WooCommerce recommends PHP 8.3 or newer, tested up to PHP 8.4.
My recommendation: PHP 8.4 if the test on the copy runs clean, otherwise 8.3. Both are in the range WordPress and WooCommerce recommend, and 8.4 gets security updates until the end of 2028. I only move to a new branch once WordPress lists it in its table and the website's key plugins run on it. If you go to 8.3 now, plan the next switch for 2027 right away.
What can break when you switch
How risky the switch is depends on where you start. The big break lies between PHP 7 and PHP 8; after that the steps get much smaller.
| Switch | What can happen |
|---|---|
| From PHP 7.4 to 8.0 or newer | The biggest jump. PHP 8.0 removed old functions such as create_function() and each() and turned several warnings into errors that stop the script (php.net). This is where old plugins and themes are most likely to fail with a critical error. |
| From 8.0 or 8.1 to 8.2 | Dynamic properties are deprecated (php.net). That produces notices in the log; the website keeps running. |
| From 8.3 to 8.4 | Parameters that are only nullable through a default value of null are deprecated (php.net). These are notices too, not crashes. |
| From 8.4 to 8.5 | Few changes that break existing code; the list is in the migration notes. |
“Deprecated” means: this still works but will go away in a later version. Such notices do not take a website down; they only fill the error log and show which plugin will cause trouble at the next jump. It gets serious with “Fatal error”: PHP stops, and WordPress shows the message “There has been a critical error on this website”.
WordPress's own code is rarely the problem. It is plugins and themes that have not had an update in years, and custom code in functions.php or in self-written plugins that nobody has touched since the website went live.
Preparation: backup, updates, plugin check
- Back up files and database, and make it a backup you can actually restore. How to do that, and why an untested backup is worth little, is covered in the guide to WordPress updates.
- Update WordPress, the theme and all plugins. The WordPress guide to updating PHP recommends this too, because newer plugin versions are usually already adapted to newer PHP.
- Look at each plugin. Its page on wordpress.org lists “Tested up to”, “Last updated” and the minimum PHP version. A plugin without an update for more than a year, or one that was removed from the directory, is better replaced before the switch. For premium plugins and themes, the vendor's changelog helps.
- Have custom code checked: child theme, own plugins, code snippets. This is where a developer saves the most time, because they look specifically for the known breaks listed in the php.net migration notes.
Switch on a copy first
Many hosts offer a test copy of the website (staging) that you can create with one click. Set the new PHP version there first and click through the website before you touch the live site. That is how I handle every update in my WordPress support, and for shops a test order on the copy is part of it, with the payment provider in test mode.
On the copy, switch on the WordPress error log. To do that, add these three lines to wp-config.php above the line “That's all, stop editing!”:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
WordPress then writes errors and notices to the file wp-content/debug.log without showing them to visitors. It should not stay switched on for good on the live site, as the WordPress debugging handbook also advises. Let it run there for a day after the switch at most, then remove the three lines and the debug.log file, because the file can be publicly accessible.
Switching at your host
Once the copy is clean, switch the live website. Where the setting lives is shown in the hosts' guides above; the item is usually called “PHP version” or “PHP settings” and applies per domain or website. Pick a time when you are reachable for the next few hours, so a Tuesday morning rather than a Friday evening. If the website uses a caching plugin, clear the cache afterwards so you really see freshly generated pages.
After the switch: what to test
| What to check | How you know it works |
|---|---|
| Home page and two or three important subpages | Layout complete, no error message in the text or at the bottom |
| Login and admin area | The dashboard loads, Site Health shows the new PHP version |
| Contact form | A test message arrives by email |
| Shop | A test order runs through to the confirmation email |
| Editor or page builder | A page can be opened, changed and saved |
| Error log | After a day, no “Fatal error” in the host's log or in debug.log |
After the switch, go to Dashboard, Updates once more. Updates that WordPress held back because of the old PHP version now appear and can be installed.
If something breaks anyway
If the website shows a critical error, the fastest way back is the setting at your host: select the old version, save, and the website runs again. You will rarely need the backup for this, because the PHP version does not change the content in the database. With a critical error, WordPress also sends an email to the admin address with a link to recovery mode, where the faulty plugin is paused. There is one exception to switching back: the German host STRATO writes in its notes on PHP Extended Support (in German) that once you have switched and logged out of the customer login, you cannot return to the outdated version. With STRATO, only log out once the website runs on the new version.
Then look for the culprit. In the error log, “PHP Fatal error” is followed by a file path, and the folder under wp-content/plugins/ or wp-content/themes/ tells you which plugin or theme it is. How to read the log and switch off a plugin without access to the admin area is explained in the guide to the critical error in WordPress. If the plugin has an update, install it on the copy and try the switch there again. If it does not, it needs a replacement or a code fix.
Do not stay on the old version for good after stepping back. If it already had no security updates, stepping back is only a pause of a few days.
What staying on the old version costs
The website keeps running on an old PHP version; it just gets no more security fixes from the PHP project. What that can mean is shown by the PHP2Shell vulnerability from October 2026. On top of that come two costs people tend to notice late.
Hosts charge for old versions. The German host IONOS charges for its PHP Extended Support (in German) €7.81 a month for PHP 8.1 and €15.62 for PHP 7.4 or 8.0, VAT included (as of 30 November 2026). For PHP 8.2, IONOS announces the same after a free transition period in its help centre. At STRATO, Extended Support for PHP 8.2 is free until the end of January 2027; from 3 February 2027 it costs a monthly fee whose amount the notes page does not state. Mittwald charges €5 per PHP version and project per month plus VAT for PHP 8.1 and older. With several websites, this adds up.
The second bill comes through the plugins. If a plugin's new version needs more PHP than the server has, WordPress does not offer the update and only reports that it does not work with your PHP version (WordPress code reference). The website then stays on old plugin versions, even if the vendor closed security holes there long ago.
Handing the switch over
For a small website with a few well-maintained plugins, you can do the switch yourself with the routine above. For a shop, a website with custom code or many plugins, it pays to hand it over, because a mistake there costs enquiries or orders right away. In my WordPress support the PHP version is part of ongoing maintenance: I switch the copy first, check the log and only go live once it is clean. Sometimes the switch is part of an emergency. For the hacked website of a landscaping company in September 2026, the PHP update was part of the clean-up the next day, together with two-factor login. What ongoing maintenance costs on the market is covered in What does WordPress maintenance cost? Write to me via the contact form or call +49 89 3288 6771.
Frequently asked questions
How do I update the PHP version in WordPress?
In your host's customer panel, not in WordPress. First make a backup and update WordPress, theme and plugins; ideally switch a test copy first. Afterwards check the home page, forms and, for shops, a test order. If something breaks, select the old version again in the same menu.
Can I change the PHP version in WordPress itself?
No. WordPress only displays the version, under Tools, Site Health, Info. Which PHP version runs is decided by the server. With a hosting package you switch it in the host's customer panel; on your own server the administrator does it.
Which PHP version does WordPress need?
WordPress recommends PHP 8.3 or newer. Since WordPress 7.0, PHP 7.4 is the minimum, and according to its compatibility table WordPress 7.1 supports versions 7.4 to 8.5 (as of 30 November 2026). Versions below 8.2, however, no longer get security updates from the PHP project.
How long will PHP 8.2 be supported?
According to php.net, PHP 8.2 gets security updates until 31 December 2026 and none after that. PHP 8.3 is supported until the end of 2027, PHP 8.4 until the end of 2028. Some hosts keep offering old versions afterwards for a monthly fee.
What happens if I do not update PHP?
The website keeps running for now. But it gets no more security fixes for PHP, many hosts charge a monthly fee for old versions, and WordPress no longer offers plugin updates that require a newer PHP version.
Can I go back to the old PHP version after switching?
With most hosts, yes, in the same menu. At STRATO this is no longer possible after logging out of the customer login if the old version ran in Extended Support. That is why you test on a copy first.