How to fix the WordPress "There has been a critical error" message

A step-by-step guide to fixing the WordPress critical error, from the recovery email to debug logs, plugin conflicts and PHP versions, without losing data.

The WordPress message "There has been a critical error on this website" means PHP hit a fatal error and stopped. Almost always the cause is a plugin, a theme, or a PHP version mismatch. The content of your site is still there. Your database is fine. Something in the code just crashed before the page could finish loading.

The fastest fix is usually this: check your email for the recovery link WordPress sends, log in through it, and deactivate the plugin or theme it names. If there is no email, turn on debug logging, read the one line that names the broken file, and disable that plugin by renaming its folder.

Below is the exact order I follow when a client sends me a screenshot of this error. It works for most sites in under 30 minutes.

What the critical error actually means

Since WordPress 5.2, WordPress catches fatal PHP errors and shows a friendly message instead of a blank white page. Before that, you would just see nothing, which is the famous white screen. If your site shows a blank page instead of the message, the causes are the same and my guide to the WordPress white screen of death covers that variant.

A fatal error is different from a warning. A warning lets the page carry on. A fatal error stops PHP completely. Common triggers:

  • A plugin update that calls a function that no longer exists
  • A theme that is not compatible with your PHP version
  • Two plugins that declare the same function or class
  • Running out of memory during a heavy request
  • A typo added to functions.php through the theme editor
  • A half-finished update that left files missing

Step 1: Check for the recovery mode email

When the error happens, WordPress tries to email the site admin address with the subject "Your Site is Experiencing a Technical Issue". That email names the plugin or theme that caused the crash and includes a special recovery mode link.

Click the link and you log in to a version of the dashboard where the broken plugin is paused just for you. Go to Plugins, find the one marked as the cause, and deactivate it. Your site should come back for everyone.

If the email never arrived, check spam, then check which address is set as the admin email. Many sites I work on have an old developer's address there, or the server cannot send mail at all. In that case, move to step 2.

Step 2: Turn on debug logging

You need to see the real error. Connect to your site using your host's file manager or SFTP and open wp-config.php in the site root. Find the line that says /* That's all, stop editing! */ and add these lines above it:

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

If WP_DEBUG is already defined as false, change it rather than adding a second copy. Reload the broken page once. WordPress now writes errors to wp-content/debug.log.

Open that file and scroll to the bottom. You are looking for a line that starts with PHP Fatal error. It will read something like this:

PHP Fatal error: Uncaught Error: Call to undefined function some_function() in /wp-content/plugins/example-plugin/includes/file.php:42

The path tells you the culprit. Here it is the plugin in the example-plugin folder. If the path is inside /themes/, it is your theme. If it is inside /wp-includes/ or /wp-admin/, look further up the stack trace for the first plugin or theme mentioned.

Keep WP_DEBUG_DISPLAY set to false on a live site so visitors never see raw errors and file paths. The official debugging in WordPress page lists every option.

Step 3: Disable the broken plugin or theme

Once you know the culprit, you can disable it without the dashboard.

  1. In your file manager, go to wp-content/plugins/.
  2. Rename the plugin's folder, for example from example-plugin to example-plugin-off.
  3. Reload your site. WordPress sees the plugin as missing and deactivates it.
  4. Log in to the dashboard and confirm the site works.

For a theme, rename the active theme's folder inside wp-content/themes/. WordPress falls back to a default theme like Twenty Twenty-Five if one is installed. If no default theme exists, upload one first, or the site will stay broken.

If the log is empty or confusing, rename the whole plugins folder to plugins-off. If the site loads, a plugin is the problem. Rename the folder back, then rename plugins one at a time until the error returns. Tedious, but it always finds the cause.

Step 4: Check your PHP version and memory limit

A lot of critical errors appear right after a host upgrades PHP. Older plugins and themes written for PHP 7 can break on PHP 8.x, because some functions were removed and some sloppy code that used to produce warnings now throws fatal errors.

In your hosting panel, find the PHP version setting. If the error started right after a PHP change, switching back for a day can get you online while you update the plugin or replace it. Do not stay on an old PHP version long term. It stops getting security fixes, and the real answer is to update or replace the code that cannot handle a current version.

If the log says Allowed memory size of ... bytes exhausted, the site ran out of memory. You can raise the WordPress limit in wp-config.php:

define( 'WP_MEMORY_LIMIT', '256M' );

This only works up to the limit your host allows. If memory keeps running out, something is wasting it, often a page builder doing too much on one page or a badly written import plugin. More memory hides the problem. Finding the heavy plugin solves it.

Step 5: Restore or repair core files

Sometimes an update is interrupted halfway. The log then points at missing files in wp-includes or wp-admin. The fix is to replace the core files:

  1. Download the same WordPress version from wordpress.org.
  2. Unzip it and delete the wp-content folder and wp-config-sample.php from the download so you do not overwrite your content.
  3. Upload the rest over your existing files.
  4. Delete the .maintenance file in the site root if it exists, since a stuck update leaves it behind.

If you have a recent backup from before the error, restoring it is often quicker. Just make sure you know what changed between the backup and now, so you do not lose new orders or form entries.

Quick reference: error clues and their fixes

What the log or situation saysLikely causeFirst fix
Path inside /plugins/name/That pluginRename the plugin folder
Path inside /themes/name/Active theme or child themeSwitch theme or undo the last edit
Error appeared after a PHP upgradeOld code on new PHPUpdate the plugin, or roll back PHP briefly
Allowed memory size exhaustedMemory limit hitRaise WP_MEMORY_LIMIT, then find the heavy plugin
Error in functions.phpBad code snippetRemove the last added snippet via SFTP
Missing file in wp-includesInterrupted updateRe-upload core files

How to stop it happening again

After fixing dozens of these, I see the same patterns. Most critical errors come from updating everything at once on a live site with no backup. A few habits remove most of the risk:

  • Take a full backup before every round of updates, and test that you can restore it.
  • Update on a staging copy first if your site makes money.
  • Update plugins in small batches so you know which one broke things.
  • Never edit functions.php from the dashboard theme editor. Use a code snippets plugin or SFTP.
  • Remove plugins you no longer use. Each one is code that can break.
  • Keep the admin email current so the recovery email reaches someone.

I go into the full routine in my WordPress maintenance checklist.

When to get a developer involved

You can fix most critical errors yourself with the steps above. Call for help when the log points at custom code nobody understands, when the error is inside WooCommerce checkout and you are losing orders, or when disabling a plugin is not an option because the site depends on it. In those cases the job is to fix the code, not just switch it off.

Also get help if the site was working fine and the error appeared with no updates at all. That can mean files were changed by someone else. If you see unfamiliar files or admin users, read my guide on how to clean a hacked WordPress site before anything else.

The short version

  1. Look for the recovery mode email and use its link.
  2. If there is no email, enable WP_DEBUG_LOG and read wp-content/debug.log.
  3. Rename the folder of the plugin or theme named in the error.
  4. Check PHP version and memory if the cause is not obvious.
  5. Re-upload core files if the log points at missing WordPress files.
  6. Turn debug logging off again once you are done.

If your site is still down, or you would rather not touch wp-config.php yourself, I fix these errors every week through my website bug fixing service. Send me the error and I will tell you what is going on.

Available for new projects

Need a hand with this?

Tell me what you need: a new site, a fix, a SaaS or an app. You'll get a clear plan and price within a day.

Start a project WhatsApp me