How to Fix “There Has Been a Critical Error on This Website” in WordPress

Cracked WordPress medallion repaired with gold kintsugi seams

“There has been a critical error on this website” means PHP hit a fatal error and WordPress stopped loading the page. In most cases a plugin, a theme or a custom code snippet caused it, often straight after an update or a PHP version change. Your posts and pages are still safe in the database.

The quickest fix is the recovery mode link that WordPress emails to the site admin. If you can’t find that email, turn on the debug log to see which file failed, then disable that plugin or theme over FTP or your host’s file manager.

  • Check the admin inbox first. The “Your Site is Experiencing a Technical Issue” email names the plugin or theme and includes a one-day recovery link.
  • Read the error before you change things. The debug log tells you the exact file and line, so you only touch what broke.
  • Work from the smallest change to the largest: plugins, then the theme, memory and PHP version, then WordPress core files. Restoring a backup comes last because it can roll back recent content.

What the Critical Error Message Means

Since WordPress 5.2, a fatal PHP error no longer leaves you with a blank white screen. WordPress catches the error, shows a short message and tries to work out which plugin or theme caused it. Visitors on the front end see this version, with a “Learn more about troubleshooting WordPress” link underneath:

There has been a critical error on this website message on the front end of a WordPress site
What visitors see when a fatal PHP error stops the page from loading.

When the error happens inside the dashboard or on the login page, the message adds “Please check your site admin email inbox for instructions.” That’s the version you’ll usually see as the site owner:

WordPress critical error message on wp-admin asking the admin to check the site admin email inbox
The dashboard version of the message points you to the recovery email. Captured on the How-To WP lab site.

One detail that’s easy to miss: WordPress only sends the recovery email when the error happens on a protected page such as /wp-admin/ or wp-login.php. When I broke a plugin on my test site, loading the home page showed the error but sent nothing. The email arrived only after I opened /wp-admin/. So if your inbox is empty, visit your login page once and check again.

Common Causes of the Critical Error

  • A plugin or theme update that contains a bug or needs a newer PHP version than your server runs.
  • A code snippet pasted into functions.php or a snippets plugin with a typo or a missing function.
  • A PHP version change by you or your host. Old code that used functions removed in PHP 8 stops working.
  • PHP running out of memory on a heavy page, import or page builder screen.
  • Missing or damaged WordPress core files after an interrupted update or a malware infection.

Before You Start: Quick Checks

  • Write down what changed just before the error: an update, a new plugin, a code snippet or a hosting change. That’s usually the culprit.
  • Search your inbox and spam folder for “Your Site is Experiencing a Technical Issue”. It goes to the address under Settings > General > Administration Email Address.
  • Have your hosting login, FTP details or file manager access ready in case the dashboard stays locked.
  • If your host offers one-click backups, take a fresh backup or snapshot now, before you change files.

How to Fix the Critical Error in WordPress

Work through these steps in order and test the site after each one. In my experience, most sites are back after Step 1, 3 or 4.

Step 1: Use the Recovery Mode Link

Open the email from WordPress. It tells you which plugin or theme failed, which page triggered the error and gives you a special recovery link.

WordPress Your Site is Experiencing a Technical Issue email naming the plugin that caused the error and the recovery mode link
The recovery email names the plugin that failed (here a demo plugin) and includes the recovery mode link.

Click the link. WordPress shows “Recovery Mode Initialized” on the login page. Log in with your normal admin account.

Recovery Mode Initialized notice on the WordPress login page
The recovery link opens the login page in recovery mode.

Go to Plugins. The plugin that broke the site is listed under Paused with the error message underneath. Recovery mode pauses it only for you, so the site is still broken for visitors until you act.

Paused plugin in WordPress recovery mode with the message This plugin failed to load properly
In recovery mode, the failing plugin is paused and marked “This plugin failed to load properly”.

Click Deactivate under the paused plugin. If a theme caused the error, go to Appearance > Themes and activate a different theme instead.

Plugin deactivated notice in WordPress recovery mode
After deactivating the paused plugin, the site loads again for everyone.

Click Exit Recovery Mode in the top admin bar, then open your site in a private window to confirm it loads. Next, update the plugin, contact its developer with the error message, or replace it with an alternative.

The recovery link expires after one day, and WordPress normally sends at most one recovery email a day. If you’ve lost the first email, use the debug log in Step 2 instead of waiting for another. To send these emails somewhere other than the admin address, add define( 'RECOVERY_MODE_EMAIL', '[email protected]' ); to wp-config.php.

Step 2: Find the Exact Error in the Debug Log

If the recovery email never arrived, the error log tells you what to fix. Many hosts already log PHP errors. In cPanel, open File Manager and look for an error_log file in your site’s folder or a logs folder.

PHP error_log file in a cPanel hosting file manager
Many hosts write PHP errors to an error_log file you can open in the file manager.

If there’s no host log, turn on the WordPress debug log. Open wp-config.php in your site’s root folder with your host’s file manager or an FTP client such as FileZilla.

Editing the wp-config.php file in a hosting file manager
Open wp-config.php from your site’s root folder.

Find the line define( 'WP_DEBUG', false );. Replace it with these lines, above /* That's all, stop editing! */:

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

This writes errors to wp-content/debug.log without showing them to visitors. Save the file, reload the page that shows the critical error, then open wp-content/debug.log. The last “PHP Fatal error” line is the one you need.

WordPress debug.log file showing PHP errors
The newest fatal error is at the bottom of debug.log.

Look at the file path in the error. If it contains /wp-content/plugins/plugin-name/, that plugin is the problem. If it contains /wp-content/themes/theme-name/, it’s the theme. This table matches the most common messages to the step that fixes them:

Message in the logWhat it meansGo to
Uncaught Error: Call to undefined function …Code calls a function that is missing, often after a partial update or a PHP upgradeStep 3, 4 or 6
Allowed memory size of … bytes exhaustedPHP ran out of memoryStep 5
PHP Parse error: syntax error, unexpected …A typo in edited code, usually a snippet in functions.phpUndo the edit, or Step 4
Failed opening required … /wp-includes/…A WordPress core file is missingStep 7
Class "…" not foundA plugin depends on another plugin or library that is missing or inactiveStep 3

Two cautions. The WordPress debugging documentation recommends these tools for troubleshooting, not for permanent use on a live site. And debug.log sits inside a public folder: on my test site, visiting /wp-content/debug.log in a browser downloaded the whole file, including server paths. Turn debugging off and delete the log as soon as you’re done (see the section after the steps). You can also keep the log outside the public folder by giving a full path instead of true, for example define( 'WP_DEBUG_LOG', '/home/username/logs/wp-debug.log' );. The folder must already exist and be writable.

Step 3: Deactivate Your Plugins

If you can reach the dashboard, go to Plugins, tick the box at the top of the list, choose Deactivate from Bulk actions and click Apply.

Bulk actions menu on the WordPress Plugins screen used to deactivate all plugins
Deactivate every plugin at once from Bulk actions.

If the dashboard is locked, connect with FTP or your host’s file manager and open wp-content.

wp-content folder with plugins and themes folders in an FTP client
The plugins and themes folders live inside wp-content.

Rename the plugins folder to plugins_old. WordPress can no longer find any plugin, so none of them load. If the log already named one plugin, rename only that plugin’s folder instead.

Renaming the WordPress plugins folder over FTP to deactivate all plugins
Renaming the folder stops the plugins from loading without deleting them.

If the site loads, log in and open Plugins once. WordPress shows a notice that each plugin was deactivated because its file doesn’t exist. Only then rename the folder back to plugins. If you rename it back before opening the Plugins screen, WordPress still treats every plugin as active and the error returns.

Now reactivate plugins one at a time, reloading the site after each one, until the error comes back. The last plugin you activated is the cause. Deactivated plugins keep their settings, and deactivated plugins don’t slow down WordPress while they’re off.

With SSH access, WP-CLI does the same in one command: wp plugin deactivate --all --skip-plugins --skip-themes, or wp plugin deactivate plugin-slug --skip-plugins --skip-themes for a single plugin. The skip flags stop WP-CLI from loading the code that’s crashing.

Step 4: Switch to a Default Theme

If deactivating plugins didn’t help, or the log points to /wp-content/themes/, test with a default WordPress theme. In the dashboard, go to Appearance > Themes, open Twenty Twenty-Five and click Activate.

Twenty Twenty-Five theme details in WordPress with the Activate button
Twenty Twenty-Five is the current default theme, a reliable test because WordPress maintains it.

Without dashboard access, open wp-content/themes over FTP and rename your active theme’s folder, for example astra to astra-off. WordPress then falls back to a default Twenty-series theme, if one is installed. If none is in the themes folder, download Twenty Twenty-Five from WordPress.org and upload it first. With WP-CLI, run wp theme activate twentytwentyfive --skip-plugins --skip-themes.

If the site works on the default theme, the problem is in your theme or child theme, often a recent edit to functions.php. Undo the edit or update the theme before switching back.

Step 5: Increase the PHP Memory Limit

Use this step when the log says “Allowed memory size of … bytes exhausted”. Unless your server already allows more, WordPress asks for 40 MB on a normal site and 64 MB on a multisite network, which heavy plugins and page builders can exceed. Add this line to wp-config.php, above the “stop editing” line:

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

WordPress can’t go above the PHP memory_limit your host sets. If the error remains, raise that limit in your hosting panel or ask your host to. If one plugin keeps exhausting memory, replacing it is a better long-term fix than raising the limit again. My guide to the memory exhausted error covers this in more detail.

Step 6: Check Your PHP Version

A PHP upgrade is a common trigger. Code that worked on PHP 7.4 can fail on PHP 8 because some old functions, such as create_function() and each(), were removed. The reverse also happens: a plugin update may require a newer PHP version than your server runs.

In cPanel, open Select PHP Version (or MultiPHP Manager) to see your current version.

Select PHP Version option in cPanel
cPanel shows and changes the PHP version for your site.

If the error started straight after a PHP upgrade, switch back to the previous version so the site works again. Then update the plugin or theme named in the log and move up to a newer PHP version. WordPress currently recommends PHP 8.3 or greater. Follow my step-by-step guide to updating PHP in WordPress safely when you make the move.

Choosing a PHP version and clicking Apply in cPanel
Choose the version from the dropdown and click Apply.

Step 7: Re-install the WordPress Core Files

If the log points to files in wp-admin or wp-includes, or an update was interrupted, replace the core files. This doesn’t touch your posts, plugins, themes or uploads.

If you can open the dashboard, go to Dashboard > Updates and click Re-install version.

Re-install version button on the WordPress Updates screen
The Re-install button replaces the WordPress core files with a clean copy.

Otherwise, download the same WordPress version from WordPress.org, unzip it and upload everything except the wp-content folder over your old files. The download doesn’t include wp-config.php, so your settings stay in place. With WP-CLI, wp core verify-checksums lists modified core files, and wp core download --version=$(wp core version) --force --skip-content replaces them with a clean copy of the same version.

Step 8: Restore a Backup

If nothing above works, restore the latest backup from before the error. Many hosts keep daily backups. In SiteGround, for example, they are under Security > Backups.

Backups section in the SiteGround Site Tools hosting dashboard
Many hosting dashboards keep daily backups you can restore.

A restore rolls back everything since the backup was made, including new posts, comments and WooCommerce orders. Note anything that changed since then before you restore, and try the steps above first.

Step 9: Check for Malware

Malware is a less common cause, but suspect it when you see core files you didn’t change, unknown admin users, strange redirects or PHP files in your uploads folder. Ask your host to scan the account, or use a security plugin such as Wordfence once you can log in. My guide to finding and removing a web shell explains what to look for.

Turn Off Debugging When You’re Done

When the site works again, edit wp-config.php and set WP_DEBUG back to false, or remove the three lines you added. Then delete wp-content/debug.log so nobody can read your server paths and error details.

How to Prevent Critical Errors

  • Update plugins and themes one at a time, and check the site after each update.
  • Test big updates and PHP changes on a staging site before you apply them to the live site.
  • Keep automatic daily backups, stored off the server, and take one before every major update.
  • Add custom code with a code snippets plugin instead of editing functions.php. Many snippet plugins check new code for errors before they activate it.
  • Use an admin email address you check, so you see recovery emails quickly.
  • Remove plugins you no longer use. Every active plugin is one more thing that can break during an update.

When to Get Help

If the site is still down, contact your host first. They can read server logs you may not have access to and roll back server changes. The WordPress.org support forums are another good option: include the exact fatal error line from your log, what changed before the error and the steps you’ve already tried.

If you’d rather have someone fix it for you, my WordPress repair service handles critical errors. Send the error message and what changed recently so I can assess the repair before work begins.

Frequently Asked Questions

Why didn’t I get the recovery mode email?

WordPress only sends it when the error happens on the dashboard or login page, so visit /wp-admin/ once. Also check spam and confirm the admin email under Settings > General. WordPress normally sends only one recovery email a day. Some servers can’t send email at all. In that case, use the debug log in Step 2 to find the cause.

Will I lose my posts or pages?

No. The error stops PHP from building the page, but your content stays in the database. You only risk losing recent changes if you restore an older backup.

Is this the same as the white screen of death?

It’s the same kind of problem. Before WordPress 5.2, a fatal PHP error usually showed a blank white page. Now WordPress catches it, shows the critical error message and offers recovery mode.

Can I turn off the critical error message?

You can disable fatal error protection with the WP_DISABLE_FATAL_ERROR_HANDLER constant, but you’ll lose recovery mode and visitors will see a blank page or raw PHP errors instead. Fix the cause rather than hiding the message.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to our Monthly Newsletter

Get monthly updates of WordPress tips, tricks, and tutorials in your email.

Thanks. You have successfully subscribed.