Disclosure: I build FatalGuard, a free plugin for this problem. The steps below work without it.
You open your site and see this:
There has been a critical error on this website.
That page hides a PHP fatal error. Most of the time a plugin or theme caused it. Here is how to get your site back, from the easiest route to the most manual one.
First: do not panic, do not delete
Nothing is lost. Your posts and settings are in the database. A broken plugin only stops PHP from running. Switch it off and the site returns. Do not delete anything yet.
Method 1: the recovery mode email
Since WordPress 5.2, a fatal error sends an email to the site admin address. The subject says your site has a technical issue. The email names the plugin or theme that failed and has a recovery mode link.
- Open the email. Check spam if you do not see it.
- Click the link and log in.
- WordPress puts you in recovery mode. The broken plugin or theme is paused for you only. Visitors may still see the error.
- Go to Plugins and deactivate the plugin named in the email. Or switch theme if it is a theme.
- Click Exit Recovery Mode.
The email goes to the address in Settings → General. If that address is old, you will not get it. The recovery link is valid for 1 day, and WordPress sends at most one such email per day. If you deleted the first one, you may have to wait or use Method 2. WordPress documents this in its fatal error recovery mode post.
Method 2: rename the plugin folder over SFTP
No email? Use SFTP, FTP, or the file manager in your host panel.
- Go to
wp-content/plugins/. - Find the plugin named in the error. If you do not know, see Method 4.
- Rename its folder. For example
acme-shopbecomesacme-shop-off. - Reload your site.
WordPress cannot find the plugin under its old name. It deactivates it. Log in, go to Plugins, and you will see a notice that the plugin is gone. Rename the folder back to the old name and the plugin returns, deactivated.
Not sure which plugin? Rename the whole plugins folder to plugins-off. All plugins turn off. Log in and open Plugins once. WordPress then deactivates them all. Only after that, rename the folder back and activate them one at a time. If you rename it back before opening Plugins, the crash returns. The broken one fails when you activate it.
For a theme, rename the active theme folder in wp-content/themes/. WordPress falls back to a default Twenty-something theme, if one is installed. If none is installed, there is no fallback.
Method 3: WP-CLI
With SSH and WP-CLI you can do it in seconds. Run these in the site root:
wp plugin list wp plugin deactivate acme-shop If WP-CLI itself crashes because of the fatal error, skip plugins for that call:
wp --skip-plugins --skip-themes plugin deactivate acme-shop To change theme:
wp theme list wp theme activate THEME-SLUG Method 4: read the real error
If you do not know the cause, read it. Add these lines to wp-config.php, above the line That's all, stop editing!:
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false ); @ini_set( 'display_errors', 0 ); Reload the broken page once. Open wp-content/debug.log. The last lines look like this:
[19-Nov-2026 09:14:02 UTC] PHP Fatal error: Uncaught Error: Call to undefined function acme_get_price() in /var/www/html/wp-content/plugins/acme-shop/includes/cart.php:88 Read it in three parts:
- Message:
Call to undefined function. - File and line:
cart.php:88. - Folder:
plugins/acme-shop/. That is your culprit.
Now use Method 2 or 3 on that plugin. When the site is back, turn WP_DEBUG off. The Debugging in WordPress page covers the constants.
If a core file or a theme is the cause
- Theme: switch theme as above.
- Core: a failed update can leave files half written. Download WordPress again from wordpress.org and copy over
wp-adminandwp-includes. Do not touchwp-contentorwp-config.php. - Memory: an "Allowed memory size exhausted" message means a script hit the memory limit. Raise
WP_MEMORY_LIMITinwp-config.phpif your host allows it, otherwise in the host panel. Find which plugin uses so much. - PHP version: a new PHP version can break an old plugin. Most host panels let you switch PHP version while you update.
After the site is back
- Update the plugin, or find a replacement. Check its support threads.
- Take a backup before you update again.
- Test updates on a staging copy when you can.
- Check the admin email in Settings → General so recovery emails reach you.
Where FatalGuard helps
The steps above need the right email, or a login to your files. FatalGuard is a free plugin that adds a second route, if you set it up before the crash.
It catches the fatal error and shows the message, file and line. With Telegram connected, it sends you an alert. Telegram alerts are free. Email alerts are in the Pro version. The alert holds a recovery link. Open it on your phone and tap once to deactivate only the crashing plugin, even when wp-admin is down and you cannot log in. Nothing is deleted. You re-enable the plugin once it is fixed.
Some limits you should know:
- Security plugins such as Wordfence or Jetpack are excluded on purpose. Use Recovery Mode or Method 2 for them.
- It is for a crash caused by a plugin. For a theme or WordPress core, use Recovery Mode above.
- Telegram must be connected before the crash.
- The link uses a small file in
wp-content/mu-plugins. FatalGuard writes it, but that folder must be writable on your host. - The link is signed with your site's keys, works once, and is valid for 4 hours. After that, the link page can renew it for up to 7 days.
Quick checklist
- Check your email for the recovery link.
- No email: rename the plugin folder by SFTP, or use WP-CLI.
- Not sure which plugin: enable
WP_DEBUG_LOGand readdebug.log. - Once the site is up, update or replace the plugin.
- Turn debug mode off.
Which plugin gave you the worst crash? Tell us in the comments.