"There has been a critical error on this website" after a PHP update
The site is down because one plugin or theme contains code that the new PHP version refuses to run. Get the site back first (revert PHP, two minutes), then find the culprit with the error log, then upgrade again with the culprit fixed or removed.
Step 1: get the site back
In your host's control panel, set PHP back to the previous version. On cPanel it is "Select PHP Version" or "MultiPHP Manager"; on Plesk, "PHP Settings"; managed hosts have a PHP selector in the site's tools. The site returns within a minute.
If you cannot change PHP, or the previous version is no longer offered, go to step 3 directly.
Step 2: read the actual error
The "critical error" screen hides the message. Three places to find it:
- The recovery-mode email. WordPress sends one to the admin address with the plugin name and the error. Subject: "Your Site is Experiencing a Technical Issue".
wp-content/debug.log, ifWP_DEBUG_LOGis on.- The host's PHP error log, usually
error_login the site root or a "Logs" page in the control panel.
The line you want starts with PHP Fatal error: and contains /wp-content/plugins/<name>/ or /wp-content/themes/<name>/. That is the culprit.
The common messages after a PHP upgrade, and what they mean:
| Message contains | Cause |
|---|---|
Uncaught TypeError … must be of type |
Old code passing the wrong kind of value to a built-in function; fatal since PHP 8.0 |
Call to undefined function each() / create_function() / money_format() |
Function removed in PHP 8.0 |
Uncaught ValueError |
An argument PHP 8 now validates (for example a bad format string) |
Cannot redeclare |
Usually an unrelated plugin conflict surfaced by the restart |
Allowed memory size exhausted |
Not the PHP version: raise the memory limit |
Step 3: disable the culprit
If the admin loads: Plugins → deactivate it. If the admin is down too: rename its folder over SFTP (wp-content/plugins/<name> → <name>-off). WordPress deactivates a plugin whose folder disappears.
Recovery mode (the link in that email) does the same thing from the browser.
Step 4: fix or replace
- Update the plugin. Most PHP 8 fatals in popular plugins were fixed in 2021-2022.
- If it is up to date and still fails, check its support forum on WordPress.org for the error text.
- If the last update is older than two years, replace it. A plugin that crashes on PHP 8 in 2026 will not be fixed.
Step 5: upgrade again, this time knowing what will break
Before switching PHP again, scan the installed plugins and themes for code that the target version removes. Upgravo does this from the WordPress admin: pick the target version, run the scan, and it lists per plugin the removed functions, removed parameters and deprecated code, with file and line. It runs on your own server and sends nothing out.
Install it from WordPress.org: Upgravo – PHP Compatibility Check.
What a scan cannot catch: errors that depend on runtime data (a TypeError caused by an empty option). For those, test the site on staging with the new PHP version before switching the live site.
Sources
- WordPress: Debugging in WordPress
- WordPress: fatal error recovery mode
- Support threads: WordPress.org, "Problem with php 8.2", WPML, Toolset, 2024-2026
More guides
- "Deprecated: Creation of dynamic property" in WordPress – what it means and how to fix it
- "Implicitly marking parameter as nullable is deprecated" – PHP 8.4 and WordPress plugins
- "Uncaught TypeError: … must be of type …" – why PHP 8 turns old warnings into fatal errors
- PHP Compatibility Checker is abandoned – what to use instead
- WordPress debug.log full of "Deprecated" notices – should you worry?
- My host forced a PHP upgrade and broke my WordPress site
- How to check if your WordPress plugins are compatible with PHP 8.3 or 8.4 before upgrading
- PHP 7.4 is end of life: what breaks in WordPress when you move to PHP 8