New feature

Master Your Email Delivery with the Mail Delivery CenterNew: Mail Delivery Center for smarter email delivery Read more >

"There has been a critical error on this website": how to fix it in 10 minutes

Your WordPress site shows one line, "There has been a critical error on this website", and nothing else. It looks serious, but the cause is almost always one plugin, the theme, a PHP version change or a memory limit. Here is how to find which, and get your site back, step by step.

Summarize with
"There has been a critical error on this website": how to fix it in 10 minutes

You open your site and instead of your home page there's a single sentence: "There has been a critical error on this website." Sometimes wp-admin shows it too, so you can't even log in.

It looks alarming, but it's one of the most fixable WordPress problems. It means PHP hit a fatal error and stopped, and in nearly every case the culprit is one plugin, your theme, a PHP version change or a memory limit. Your content is still safe in the database. Here's how to find the cause and get back online.

Key takeaways

  1. The critical error message means PHP hit a fatal error, almost always in a plugin, the theme, or after a PHP change.
  2. Check the site admin's email first: WordPress sends a recovery mode link that names the plugin or theme at fault.
  3. If there's no email, turn on WP_DEBUG_LOG and read wp-content/debug.log for the file that failed.
  4. Disable a plugin by renaming its folder, or all of them with WP-CLI, without needing wp-admin.
  5. If you can't find the cause quickly, restore the last backup from before the error, then fix it calmly on staging.

First: what changed? Think about the last thing that happened before the error: a plugin or theme update, a new plugin, a PHP version change, edited code. That's usually the cause, and it tells you where to look first.

Step 1: check for the recovery mode email

When WordPress hits a fatal error, it emails the site's admin address with the subject "Your Site is Experiencing a Technical Issue". The email names the plugin or theme that failed and includes a special recovery mode link.

Open the link and log in. WordPress pauses only the broken plugin or theme for you, so you can get into wp-admin, then update, replace or deactivate it. Check your spam folder if you don't see the email. The link expires after a while, but WordPress sends a new one if the error happens again.

Step 2: read the error

No email? Make WordPress write the error to a log. In cPanel, open File Manager, edit wp-config.php in your site's folder, and add these lines above /* That's all, stop editing! */:

// Log errors to wp-content/debug.log without showing them to visitors
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Reload the broken page, then open wp-content/debug.log. Look for the last line starting with PHP Fatal error. It ends with a file path, and that path tells you who is at fault:

  • wp-content/plugins/plugin-name/...: that plugin;
  • wp-content/themes/theme-name/...: your theme;
  • Allowed memory size ... exhausted: a memory limit (see step 5).

Remove the three lines once you're done, so the log doesn't keep growing. On WebGee you can also check the PHP error log; our docs explain where to find it.

Step 3: disable the broken plugin

You don't need wp-admin for this. In File Manager, go to wp-content/plugins/ and rename the plugin's folder, for example from slider-pro to slider-pro.off. WordPress can't find it, so it deactivates it. Reload your site.

If you don't know which plugin it is, rename the whole plugins folder to plugins.off. If the site comes back, rename it back, then rename plugins one at a time until the error returns. With SSH, WP-CLI is quicker:

# List plugins without loading them (works even when the site is down)
wp plugin list --skip-plugins --skip-themes

# Deactivate one plugin
wp plugin deactivate slider-pro --skip-plugins --skip-themes

# Or deactivate all of them, then reactivate one by one
wp plugin deactivate --all --skip-plugins --skip-themes

Step 4: if it's the theme

Rename your active theme's folder in wp-content/themes/. WordPress falls back to a default theme, if one is installed, and the site loads, looking different but working. Then update the theme, or restore a working version, and switch back. Keep at least one default theme installed for exactly this reason.

Step 5: other common causes

A PHP version change

If the error started right after a PHP upgrade, switch back first: in cPanel, Select PHP Version; in WordPress Cloud, Advanced › Developer tools. Then update whatever the log blamed and try the newer PHP version again on staging.

Out of memory

For "Allowed memory size exhausted", raise WordPress's limit by adding define( 'WP_MEMORY_LIMIT', '256M' ); to wp-config.php, and check the PHP memory_limit under Select PHP Version › Options. If one plugin needs huge amounts of memory on every page, though, the real fix is that plugin.

An interrupted update

If an update stopped halfway, you may see a maintenance message or missing files. Delete the .maintenance file in the site's folder if it's there, then reinstall the plugin or WordPress core files (wp core download --force --skip-content).

Step 6: when in doubt, restore

If the site makes you money and you can't find the cause in a few minutes, restore the last backup from before the error and investigate afterwards. On WebGee cPanel hosting, open JetBackup, choose a restore point from before the problem started, and restore the files; restore the database too only if the change touched it, so you don't lose recent orders or comments. On WordPress Cloud, restore the site from its backups to a point in time.

Then reproduce the problem on a staging copy, fix it there, and push it live when it works.

Critical error checklist

  • Note what changed just before the error
  • Look for the "Your Site is Experiencing a Technical Issue" email and its recovery link
  • Turn on WP_DEBUG_LOG and read the last fatal error in wp-content/debug.log
  • Rename the plugin or theme folder the log points to
  • Switch PHP back if the error followed a PHP change
  • Raise memory only if the log says memory was exhausted
  • Restore a backup if the site needs to be back now
  • Turn debugging off again and test the fix on staging

Don't want to do this alone?

Critical errors always seem to arrive at the worst time. On WebGee, our engineers on live chat 24/7 can read the logs with you and help you get back online, and JetBackup restores and staging copies are there for the moments you need them.

WordPress hosting with engineers on callBackups, staging, LiteSpeed speed and 24/7 live chat with engineers who fix WordPress every day. Free migration.
See WordPress hosting

Frequently asked questions

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

A PHP fatal error. The usual causes are a plugin or theme update, a plugin that doesn't support your PHP version, running out of PHP memory, or a corrupted or incomplete update.

I didn't get the recovery mode email. Where is it?

It goes to the admin email address under Settings › General. Check spam, and check whether that address still works. If your site can't send email reliably, set up SMTP so you get it next time.

Will I lose content fixing this?

No. Turning on debugging, renaming plugin folders and switching themes don't touch your posts, pages or orders, which are in the database. Restoring an older backup can, so restore files only if you're unsure, or export recent orders first.

Can I fix it without access to wp-admin?

Yes. Everything in this guide works through cPanel's File Manager or SSH, which is exactly what you need when wp-admin itself shows the error.

The error appeared after I changed PHP version. What now?

Switch back to the previous version in cPanel's Select PHP Version, or in WordPress Cloud under Advanced › Developer tools. Then update the plugin or theme that failed, and try the new version again on staging.

  • WordPress critical error
  • WordPress troubleshooting
  • WP_DEBUG
  • Recovery mode
  • JetBackup
About the authorSr. Support Engineer at WebGee
Add WebGee as a preferred source on Google
"There has been a critical error on this website": how to fix it in 10 minutes | WebGee