Guide

“There has been a critical error on this website” after an update: how to recover

A critical error after an update is a PHP fatal error in one plugin or theme. How to get back into the site, find which one it was, and roll it back safely.

Updated

The short answer

“There has been a critical error on this website” means a PHP fatal error. After an update, the plugin, theme or WooCommerce version you just installed is the first suspect. To recover:

  1. open the recovery mode email WordPress sent to the site's admin address, and log in through its link;
  2. if there is no email, switch on the debug log and read which file the error came from;
  3. deactivate that plugin or theme — from wp-admin in recovery mode, or by renaming its folder;
  4. roll back to the previous version, or restore your backup, until a fixed release is out.

Then place a test order: a fatal error that took down one page may have broken others.

What the message means

Since version 5.2, WordPress catches PHP fatal errors and shows a short message instead of a blank white page. Visitors see that the site has a critical error. A logged-in administrator sees a hint to check the admin email inbox. Nothing is lost from the database — the code that runs the page stopped halfway.

After an update the usual reasons are few: the new version calls a function that another plugin or an older WooCommerce doesn't have, it needs a newer PHP version than your server runs, it runs out of memory, or the update was interrupted and left files half-copied.

Get back in with the recovery mode email

When a fatal error happens, WordPress emails the address under Settings → General (or the one in the RECOVERY_MODE_EMAIL constant, if set). The email names the plugin or theme that failed, quotes the error with its file and line, and carries a link to log in in recovery mode.

  • Recovery mode pauses the faulty extension for your session only. Shoppers still get the error until you deactivate or fix it.
  • The link expires after a while, and WordPress doesn't send a new email for every error.
  • Inside, go to Plugins, deactivate the paused plugin, and exit recovery mode. The site should be back for everyone.

No email? The admin address may be out of date, or the site's mail may not be leaving the server at all — the same problem that stops order emails. Read the error from the log instead.

Read the error in the debug log

Open wp-config.php over SFTP or your host's file manager and, above the line that says “That's all, stop editing”, add:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Load the broken page once and open wp-content/debug.log. The fatal error looks like PHP Fatal error: Uncaught Error: Call to undefined function … in /wp-content/plugins/plugin-name/…. The folder after plugins/ or themes/ tells you whose code it is. WooCommerce also keeps a fatal-errors log under WooCommerce → Status → Logs, once you can reach wp-admin. More on reading these lines in WooCommerce PHP errors and the error log.

Switch WP_DEBUG back off when you are done, and don't leave the log readable from the web for long: it can contain paths and data you wouldn't publish.

Deactivate the culprit without wp-admin

  • Rename its folder. In wp-content/plugins/, rename plugin-name to plugin-name-off. WordPress can no longer find it and deactivates it. For a theme, rename its folder in wp-content/themes/; WordPress falls back to a default theme if one is installed.
  • Or use WP-CLI, if your host offers SSH:
    wp plugin deactivate plugin-name --skip-plugins --skip-themes
  • Don't deactivate WooCommerce to get the site back unless you must: the store stops selling, and extensions that depend on it may throw new errors of their own.

Roll back, then update properly

  • Install the previous version. For plugins from wordpress.org, older versions are listed on the plugin's Advanced page. With WP-CLI: wp plugin install plugin-name --version=1.2.3 --force. Premium plugins usually offer older versions in your account with the vendor.
  • Mind the database. WooCommerce and some large plugins update the database when they update. Putting the old files back doesn't undo that; restoring a backup taken just before the update does.
  • Check PHP. If the error mentions a syntax error or a type the server doesn't know, the new version may need a newer PHP than you run. Your host can switch it — test on staging first.
  • Report it. Send the plugin's author the exact error line and your WordPress, WooCommerce and PHP versions.

A routine that keeps the next update from doing this — backups, staging, one plugin at a time, a test order straight away — is in safe WooCommerce updates.

When only part of the store is broken

A fatal error that only fires on one page — the checkout, the cart, a variable product, the account area — leaves the home page looking fine. You won't get a call from a customer; you'll notice orders slowing down. After any update, open a product, add it to the cart and place a test order as a logged-out shopper, not just the home page and wp-admin.

Catching it with StorePilot

  • PHP fatal errors and uncaught exceptions are reported from every plugin, whether or not you chose to watch its warnings, as well as from the theme and WordPress core — grouped into issues with the page they happened on.
  • Site changes are marked. The plugin reports a plugin updated, installed, removed, activated or deactivated, the theme updated or switched, and WordPress updated — each with the version it went to — so an error can be read against the update before it. Updates applied by your host or copied over SFTP are noticed too.
  • Alerts don't depend on your site's email. New errors, error spikes and uptime incidents reach you by email, Slack, Telegram or webhook, sent by StorePilot rather than by your server.
  • Uptime monitoring checks the addresses you add every five minutes. A whole-site critical error answers with a server error status, which counts as down.

Install the WordPress plugin, see how error tracking works, or read about release and update markers in the docs.

FAQ

Questions about this guide

What causes “There has been a critical error on this website”?

A PHP fatal error: code in a plugin, the theme or WordPress itself stopped running. After an update it is usually the updated extension calling something that no longer exists, needing a newer PHP version, or running out of memory. WordPress catches the error and shows this page instead of a blank screen.

I didn't get the recovery mode email. What now?

It goes to the administration email under Settings → General, which may be an old address — and if the site's email is broken, it never leaves the server. Turn on the debug log in wp-config.php to read the error, then deactivate the plugin it names by renaming its folder over SFTP or your host's file manager.

How do I roll back the plugin that caused it?

Restore your backup, or install the previous version: for plugins on wordpress.org, older versions are on the plugin's Advanced page, and WP-CLI can install one with --version. For WooCommerce itself and other plugins that update the database, restoring the files alone may not be enough — restore the backup or wait for a fix release.

Does the critical error page affect my shoppers?

Yes. If the fatal error happens on every request, every visitor sees it and no orders can be placed. If it only happens on some pages — the checkout, a product type, the account area — the rest of the store works and the fault can go unnoticed for days.

Hear about a fatal error before your customers do

Install the plugin, and PHP fatal errors reach you with the page they hit — and the update that came just before.

Start for free

Every feature on the Free plan, for 100 visitors a month. No card required.

Choose a plan

Plans from €29 a month, priced by your monthly visitors and the websites you connect.