Website fixes · Guide
WordPress Broken After a PHP Update? How to Fix It
By Paul Walsh Updated 5 min read
If your WordPress site shows a critical error, warnings or a white screen after your host updated PHP, it's usually a plugin or theme that wasn't written for the new PHP version, rather than WordPress itself. Check your email for WordPress's recovery mode link, switch off the plugin or theme at fault, then update or replace it. Asking your host to switch back to the old PHP version can buy time, but it isn't a fix.
Which PHP version should WordPress be on?
WordPress recommends PHP 8.3 or greater. It still works with PHP 7.4 and newer, but WordPress itself warns that those older versions have reached end of life and may expose your site to security problems.
So if your host has moved you to PHP 8.3 or newer, they've done the right thing. The job is to make your plugins and theme work with it.
Check your PHP version
If you can get into the admin, go to Tools, Site Health:
- The Info tab shows your PHP version in the Server section.
- The Status tab tells you if your PHP version is outdated or no longer gets security updates.
If you can't get into the admin, your hosting control panel shows the PHP version, or your host can tell you.
Step 1: check your email for recovery mode
When a plugin or theme causes a fatal error, WordPress shows "There has been a critical error on this website" and emails the site's admin email address. The email's subject ends "Your Site is Experiencing a Technical Issue", and it names the plugin or theme that caused the error.
The email contains a link to recovery mode. It lets you log in while the faulty plugin or theme is paused, so you can deactivate it, update it or replace it. When you've finished, click Exit Recovery Mode in the admin bar. For more on the error itself, see why WordPress shows a critical error.
Step 2: switch the plugin off by renaming its folder
If the email didn't arrive and you can't get into the admin, you can switch a plugin off from your hosting file manager or over FTP. Go to wp-content/plugins/, find the plugin's folder and rename it, for example from contact-form to contact-form-off.
WordPress won't load a plugin whose files it can't find, so the site should come back straight away. The next time you open the Plugins screen, WordPress deactivates it and says "Plugin file does not exist".
If you don't know which plugin it is, rename the whole plugins folder to switch them all off and check the site loads. Open the Plugins screen so WordPress deactivates them, rename the folder back, then reactivate plugins one at a time until the error returns.
If the theme is at fault, rename its folder in wp-content/themes/ the same way. When you next open Appearance, Themes, WordPress switches to a default theme if one is installed.
If you get a plain white screen rather than the critical error message, the same steps apply: see how to fix the WordPress white screen.
Step 3: turn on the debug log, safely
If you can't tell what's wrong, WordPress can write errors to a log file instead of showing them. Add these lines to wp-config.php, above the line that says "That's all, stop editing!":
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );
Errors are then saved to wp-content/debug.log without being shown to visitors. Each one names the file it came from, which tells you which plugin or theme is at fault.
Do this for as short a time as possible. WordPress's own documentation says debugging tools shouldn't be used on live sites. As a precaution, bear in mind that on some hosting the log can end up publicly readable, so turn debugging off and delete the log once you've found the problem. Alternatively, WordPress lets you set WP_DEBUG_LOG to a custom file path instead of true, so you can keep the log outside your website's public folder.
Step 4: update or replace the plugin
Once you know which plugin or theme it is:
- Update it. Plugins that are still maintained are usually updated for new PHP versions, so an update often fixes it completely.
- Replace it if it's abandoned. A plugin that hasn't been updated in years won't be fixed by its author. Find a maintained alternative that does the same job, test it on a staging copy, and remove the old one.
- Get it patched if there's no alternative and the plugin is essential. That's developer work, and worth weighing against replacing it.
Premium plugins usually only update while their licence is active, so check the licence if a premium plugin is stuck on an old version.
Should you ask your host to switch PHP back?
As a stopgap, yes, if the site is down and you need it working today. Most hosts let you change the PHP version in the control panel, or will do it for you.
But don't stay there. PHP only gets security fixes for a limited time. PHP 8.1 and older no longer get any. PHP 8.2's security support ends on 31 December 2026, and PHP 8.3's on 31 December 2027. Switching back buys you days or weeks to fix the plugin properly, not a permanent solution, and some hosts won't offer old versions at all.
Stop it happening next time
If your host announces a PHP upgrade in advance, test the site on the new version on a staging copy first, and update or replace anything that breaks before the switch. If your site broke after a plugin update rather than a PHP change, see WordPress update broke your site?.
If you'd rather someone else sorted it, getting a WordPress site working on current PHP is a job I do as part of WordPress fixes, with the price agreed before I start.
About Paul Walsh
Developer based in Blackburn with 25+ years in electronics and tech. I've run online businesses of my own, and now build and fix websites for small businesses across the UK.