Upgravo › Guides

"There has been a critical error on this website" after a PHP update

Last reviewed 8 November 2026 · by Nicolás Alejandro Salinas

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 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

  1. Update the plugin. Most PHP 8 fatals in popular plugins were fixed in 2021-2022.
  2. If it is up to date and still fails, check its support forum on WordPress.org for the error text.
  3. 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

More guides