How to Fix the WordPress Critical Error Message

“There has been a critical error on this website” means a PHP fatal error stopped WordPress from building the page, and the cause is almost always a plugin, the theme, or a PHP version change on the server. You can usually fix it in under an hour: get back in through recovery mode or by switching plugins off from the file system, read the error log to find the exact file, then update, replace or roll back that one component.

I manage a large portfolio of business websites, and this message is one of the most common panic emails I get. It looks catastrophic because the whole site stops loading, but your posts, pages and settings are still sitting in the database. Here is the order I work through it.

What does the critical error message actually mean?

WordPress runs on PHP. When a plugin, theme or custom snippet calls a function that does not exist, runs out of memory, or uses code the server’s PHP version no longer accepts, PHP throws a fatal error and stops. Since WordPress 5.2, instead of a blank white screen, WordPress catches that error, shows visitors the generic critical error message, and offers administrators a way in through recovery mode.

The usual triggers I find:

  • A plugin or theme update that does not work with your version of WordPress or PHP.
  • The host upgrading PHP, which breaks older plugins that were never updated.
  • Code pasted into functions.php or a snippets plugin with a typo or a missing bracket.
  • Two plugins that load the same library or declare the same function.
  • Less often, a hacked site where the injected code is malformed.
Four steps to fix the WordPress critical error: recovery email, turn plugins off by file, read the error log, fix the cause

How do I get back into the dashboard?

Check the inbox of the site’s administrator email first. When WordPress detects a fatal error on a normal page load, it emails that address a special login link. Logging in through it starts recovery mode: the plugin or theme causing the error is paused for your session only, the dashboard tells you which one it is, and you can deactivate it without visitors seeing anything change. When you are done, click “Exit Recovery Mode”.

That email often never arrives. If the error happens before your email plugin loads, WordPress sends it straight from the web server, and those messages are easy to lose to spam filters. If nothing shows up after a few minutes, go in through the files instead:

  1. Connect with SFTP or your host’s file manager and open the wp-content folder.
  2. Rename the plugins folder to something like plugins-off. WordPress can no longer find any plugins, so the front end loads without them.
  3. Log in and open the Plugins screen once. WordPress reports that the plugins were deactivated because their files are missing.
  4. Rename the folder back to plugins, then reactivate plugins one at a time until the error returns. The last one you activated is the cause.
  5. If the site still fails with every plugin off, rename the active theme’s folder in wp-content/themes. WordPress switches to a default theme if one is installed.

How do I find the exact error?

Switching plugins on and off works, but the error log names the culprit directly. There are two places to look. Your host’s PHP error log is the first: many control panels have an error log viewer, and some hosts write an error_log file in the site’s root folder. The second is WordPress’s own debug log. Add these lines to wp-config.php, above the line that says “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, then open wp-content/debug.log. Look for a line starting with “PHP Fatal error”. It names the file and the line number, and the folder in that path tells you which plugin or theme it belongs to.

Turn this off when you are done. The WordPress documentation says debugging tools should not stay on for a live site, and a debug.log in wp-content can often be opened in a browser by anyone who knows the address. If you need logging on for longer, set WP_DEBUG_LOG to a file path outside the public web folder instead of true.

Table matching WordPress fatal errors in the error log to the right fix, from plugin updates and PHP upgrades to custom code and possible hacks

What should I do once I know which plugin caused it?

Deactivating the plugin brings the site back, but if it runs your forms, bookings or checkout, you have swapped one problem for another. What to do next depends on what the log says:

  • If it broke right after an update, check the plugin’s changelog and support forum. Bad releases are often patched quickly. Until then, restore the previous version of the plugin from your backup.
  • If the error mentions an undefined or removed function after a PHP upgrade, the plugin is not compatible with your PHP version. Update it if an update exists, and replace it if it has been abandoned. Rolling PHP back is a short-term patch, because old PHP versions stop getting security fixes.
  • If it points to functions.php or a snippets plugin, undo the last edit. Keep custom code out of the theme so a theme update does not wipe it out.
  • If the file is in a folder you do not recognize, or the code looks scrambled, stop and treat it as a possible hack. I wrote a separate guide on how to check whether your WordPress site has been hacked.

How do I stop it from happening again?

Most of the critical errors I deal with come from the same habit: updating everything at once on the live site with no recent backup and no way to test. A few changes make a big difference:

  1. Take a backup before updates, and make sure you know how to restore it. A backup you have never restored is a guess.
  2. Test plugin updates and PHP upgrades on a staging copy first. If your host does not offer staging, a local copy of the site does the same job.
  3. Update plugins in small batches, so you know which one broke the site.
  4. Delete plugins you are not using, and replace ones that have not been updated in a long time.
  5. Make sure the site’s administrator email goes to someone who reads it, so the recovery email reaches a person.

If the site makes you money and nobody on your team is comfortable in SFTP and log files, this is the kind of fix I handle through my WordPress speed, security and technical SEO service. Send me the URL and roughly when it broke, and the logs usually show what failed.

If you would rather not handle this yourself every month, that is what my WordPress care plans cover: updates tested on staging, daily offsite backups and monitoring, with a developer who knows your site.

Frequently asked questions

Will the critical error delete my content?

No. The error stops PHP from building the page, but your posts, pages and settings stay in the database. Once the faulty plugin or theme is fixed, the site comes back as it was.

Why didn’t I get the recovery mode email?

WordPress sends it to the administrator email address set in Settings, General. If the error happens before your email plugin loads, the message goes straight from the server and is often filtered as spam or blocked. Check spam, and if it is not there, use the plugin folder method instead.

Can a PHP update cause a critical error?

Yes. Newer PHP versions remove old functions and are stricter about code that older versions tolerated, so an outdated plugin or theme can fail right after the host upgrades PHP. The error log will name the plugin, and the fix is to update or replace it.

first_logo_lukitdev-removebg-preview

Lucas Alvarado — Senior marketing technology and web operations consultant. HubSpot, Salesforce, Pardot, and high-traffic WordPress for B2B revenue teams. Based in Miami, working with companies across the US.

Copyright© 2026 Lukitdev, All rights reserved.