Guide / WordPress

WordPress critical error after an update: how to get your site back

“There has been a critical error on this website.” means a plugin, your theme or a PHP change has caused a fatal PHP error, and WordPress stopped the page instead of showing it half broken. An update is almost always behind it. The fix comes in three stages: use the recovery mode email, read the debug log if the email never arrived, and deactivate the faulty plugin over FTP as a last resort.

01 / Guides

What the WordPress critical error means

Since version 5.2, WordPress has had fatal error protection. When PHP stops with a fatal error, WordPress shows the critical error notice instead of a white screen and emails the administrator address. Your content is not deleted. The database is almost always untouched; only the code that builds the page crashes.

Typical triggers are a plugin update that clashes with another plugin or your PHP version, a theme update, a newly installed plugin, a hand-edited functions.php, or a PHP upgrade by your host. If none of these explains it and unknown files or users appear, read our guide website hacked: what to do now as well.

02 / Guides

Step 1: use the recovery mode email

  1. 01

    Check the admin email inbox

    WordPress sends the email to the address under Settings, General. The subject says your site is experiencing a technical issue, and the message usually names the plugin or theme that caused the error. Check the spam folder too.

  2. 02

    Open the recovery mode link

    The email contains a link to wp-login.php with action=enter_recovery_mode. It only works for a limited time, one day by default. Log in through it.

  3. 03

    Deactivate the culprit

    In recovery mode the faulty plugin is only paused for you. Deactivate it properly under Plugins, or visitors will keep seeing the error.

  4. 04

    Exit recovery mode and check

    Click Exit Recovery Mode in the toolbar and open the site in a private window. Then look for an updated version of the plugin or a replacement.

03 / Guides

WordPress critical error but no email?

This is one of the most common cases. Either the admin address is out of date, or the site cannot deliver email at all, because it sends through the web server without SPF and DKIM and the message lands in spam or is rejected. Our guide emails going to spam explains how to set up sending properly.

For the future, the RECOVERY_MODE_EMAIL constant in wp-config.php lets you send these emails to a different address. For the error you have right now, carry on with steps 2 and 3. The error log in your hosting control panel often shows the cause as well.

04 / Guides

Step 2: turn on the debug log and read the error

  1. 01

    Open wp-config.php

    Connect over SFTP, for example with FileZilla, or use your host's file manager. wp-config.php sits in the root folder of the WordPress installation. Download a copy first.

  2. 02

    Switch on debugging

    Find the line define( 'WP_DEBUG', false ); and replace it with three lines: define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false ); They belong above the line that says That's all, stop editing! Do not define WP_DEBUG twice.

  3. 03

    Trigger the error

    Load the website and, if affected, wp-admin again. WordPress now writes the error to wp-content/debug.log.

  4. 04

    Read the log

    Look for PHP Fatal error. It is followed by a path such as /wp-content/plugins/plugin-name/ or /wp-content/themes/theme-name/. The folder name tells you the culprit.

  5. 05

    Switch it off again

    Set WP_DEBUG back to false and delete debug.log. Otherwise the file is publicly reachable and reveals paths and details of your installation.

05 / Guides

Common fatal errors in the debug log

Message in the logWhat it usually meansFix
Call to undefined functionA plugin calls a function that no longer exists, often because an add-on is missing or PHP is newerUpdate or deactivate the plugin, update dependent plugins together
Allowed memory size of … bytes exhaustedPHP has run out of memoryAdd define( 'WP_MEMORY_LIMIT', '256M' ); to wp-config.php or raise the limit at your host
Cannot redeclareTwo plugins, or a plugin and the theme, define the same functionDeactivate one of them, usually the most recently installed
syntax error, unexpectedA typo in a hand-edited file, often functions.phpRestore the file from a backup or the original theme
Uncaught TypeError or ArgumentCountErrorOld code that no longer runs on PHP 8Update the plugin or theme, otherwise replace it

06 / Guides

Step 3: deactivate a plugin over FTP

If you cannot get into wp-admin, deactivate plugins directly through the files. Nothing is lost; settings stay in the database.

  1. 01

    Open the plugins folder

    Over SFTP or the file manager, go to wp-content/plugins.

  2. 02

    Rename the suspect plugin

    Rename the folder of the plugin named in the log or the email, for example from plugin-name to plugin-name-off. WordPress can no longer find it and deactivates it.

  3. 03

    If you do not know the culprit

    Rename the whole plugins folder to plugins-off. If the site works again, rename it back and reactivate the plugins one by one in wp-admin until the error returns.

  4. 04

    If the theme is the cause

    Rename the active theme's folder in wp-content/themes. WordPress then falls back to an installed default theme such as Twenty Twenty-Five, so always keep one default theme installed.

  5. 05

    Tidy up

    Install a current, compatible version of the plugin or theme, check the site and delete the renamed old folder.

07 / Guides

WordPress critical error after a PHP update

When your host moves PHP forward, for example from PHP 7.4 to PHP 8, older plugins and themes sometimes stop working. PHP 8 removed functions such as create_function() and each() and checks data types more strictly. The debug log then usually shows a TypeError or Call to undefined function.

As an emergency measure you can switch back to the previous PHP version in your hosting panel, if your host still offers it. Treat that as a bridge only: old PHP versions no longer receive security updates. Update or replace the plugin, then switch back to the current version. A current PHP version usually makes the site faster too; see our guide to a slow WordPress site.

08 / Guides

Critical error after installing a plugin, or with Elementor

If the error appears right after you install a new plugin, the answer is simple: deactivate that plugin over FTP and find an alternative. With Elementor, the critical error often appears when Elementor and Elementor Pro are on different versions, for example because only one of them auto-updated. Bring both up to date, if necessary by deactivating Elementor Pro over FTP, opening wp-admin and updating both.

A related symptom after an interrupted update is the message that the site is briefly unavailable for scheduled maintenance. In that case there is a file called .maintenance in the root folder, and you can delete it.

09 / Guides

How to avoid the next critical error

  • A backup stored outside your hosting account before every major update
  • Test larger updates on a staging copy first, especially for shops
  • Update plugins that depend on each other together, such as Elementor and Elementor Pro, or WooCommerce and its extensions
  • Set automatic updates deliberately: security releases yes, big version jumps under control
  • Keep one default theme installed and an admin email address that someone reads
  • Replace plugins that have not been updated for more than a year

If the site is so old that every update feels like a gamble, the lasting fix is to leave WordPress: a hand-coded website in your own code, with no plugins and no update roulette. We do that as part of our web development work, and a website migration brings your content and URLs along.

FAQ

Common questions

01What does “There has been a critical error on this website” mean?

A plugin, your theme or a PHP change caused a fatal PHP error and WordPress stopped the page. Your content is not deleted. An update is usually behind it.

02I never got the recovery mode email. What now?

Check the spam folder and whether the admin address under Settings, General is still correct. Without the email, turn on the debug log in wp-config.php or check the error log at your host, then deactivate the faulty plugin over FTP.

03I can't access wp-admin. How do I deactivate a plugin?

Over SFTP or your host's file manager: rename the plugin's folder in wp-content/plugins. WordPress deactivates it automatically and keeps its settings.

04Can I undo an update?

Yes. The safest way is a backup from before the update. Alternatively, install the older plugin version by hand or with a rollback plugin, but only as a bridge until a fixed version is released.

05Do I lose data with a critical error?

Almost never. The error affects code, not the database. Posts, orders and settings are still there once the site runs again.

06Can a hack cause the critical error?

Yes, if malicious code has damaged files. If no update explains the error and unknown files, users or redirects appear, check the site for an attack.

Contact

Get your site running again today

Send us the domain and what changed last. We come back with a fixed quote.

Get help ↗