New The Perfectly theme: 95+ mobile PageSpeed, affiliate blocks built in. See the theme →

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

5 min read
How to fix the WordPress critical error
On this page
  1. What the critical error actually means
  2. Step 1: Check your inbox for the recovery mode link
  3. Step 2: Turn on the debug log
  4. Step 3: Read the last lines of the log
  5. Step 4: Disable the plugin or theme without the dashboard
  6. Step 5: Check the PHP version and memory limit
  7. Step 6: Repair a broken update
  8. When to restore a backup instead
  9. How to stop it happening again
  10. Frequently asked questions

Quick answer: this message means PHP hit a fatal error, almost always in a plugin or theme. Use the recovery link WordPress emails you, or rename the broken plugin folder over FTP or your host’s file manager, and the site comes back.

What the critical error actually means

Since WordPress 5.2, a fatal PHP error no longer shows a blank white page. WordPress catches it and prints “There has been a critical error on this website” instead. The message is deliberately vague so visitors do not see file paths, but the real error is always recorded somewhere you can read it.

In practice the cause is nearly always one of these:

  • A plugin or theme update that conflicts with another plugin or with your PHP version
  • A PHP version change at your host (for example 7.4 to 8.x) that old code cannot handle
  • PHP running out of memory on a heavy page
  • A half-finished update that left files missing or corrupted
  • A code snippet pasted into functions.php with a typo

WordPress emails the site admin address with the subject “Your Site is Experiencing a Technical Issue”. The email names the plugin or theme that crashed and contains a recovery mode link. Open it, log in, and WordPress loads with the broken extension paused so you can deactivate, update or delete it.

No email? Check spam, and remember it goes to the address under Settings → General, which may be an old one. If it never arrives, carry on with the next steps.

Step 2: Turn on the debug log

Open wp-config.php in your host’s file manager (on Hostinger: hPanel → Files → File Manager → public_html) and add these lines above the line that says “That’s all, stop editing”:

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

The third line matters: it keeps errors out of the public page and writes them to a file instead.

Step 3: Read the last lines of the log

Reload the broken page once, then open wp-content/debug.log. Scroll to the bottom and look for a line starting with PHP Fatal error. It ends with a file path, and the folder name in that path tells you who is responsible:

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

In this example the culprit is the plugin in the some-plugin folder. If the path contains /themes/, it is your theme.

Step 4: Disable the plugin or theme without the dashboard

  1. In the file manager, go to wp-content/plugins
  2. Rename the folder named in the log, for example some-plugin to some-plugin-off
  3. Reload your site. WordPress deactivates a plugin it can no longer find
  4. Log in, then update or replace the plugin before renaming the folder back

If the log does not point at one plugin, rename the whole plugins folder to plugins-off. If the site returns, rename it back and re-enable plugins one at a time until the error reappears.

For a theme, rename its folder inside wp-content/themes. WordPress falls back to a default theme such as Twenty Twenty-Five if one is installed.

Step 5: Check the PHP version and memory limit

If the error appeared right after your host changed PHP, switch back to the previous version in your hosting panel, confirm the site loads, then update the outdated plugin or theme before moving forward again.

If the log says Allowed memory size of ... bytes exhausted, raise the limit in wp-config.php:

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

Your host’s own PHP limit still caps this value, so if nothing changes, raise it in the hosting panel as well.

Step 6: Repair a broken update

When the path in the log points at wp-admin or wp-includes, core files are damaged. Download a fresh copy of WordPress from wordpress.org and upload the wp-admin and wp-includes folders over the existing ones. Leave wp-content and wp-config.php alone: that is where your content and settings live.

When to restore a backup instead

If the site earns money and you cannot find the cause in fifteen minutes, restoring last night’s backup is the faster fix. Restore first, then reproduce the problem on a staging copy where downtime costs nothing.

After the fix: set WP_DEBUG back to false and delete debug.log. The log can be read by anyone who guesses its address, and it grows forever.

How to stop it happening again

  • Update plugins one at a time, not with “select all”, so you know which one broke
  • Take a backup before every update session
  • Test PHP upgrades on a staging copy first
  • Remove plugins you no longer use, since abandoned code is what breaks on new PHP versions

Frequently asked questions

Why did I not get the critical error email?

The email goes to the admin address in Settings → General and is sent once per error, so it may be in spam or going to an old mailbox. Many hosts also block PHP mail. You can fix the site without it by renaming the plugin folder.

Does the critical error delete my content?

No. Posts, pages and settings live in the database and uploads folder, which a PHP error does not touch. Once the broken code is disabled, everything is still there.

Can I fix it without FTP?

Yes. Every mainstream host has a browser file manager that lets you rename folders and edit wp-config.php, which is all these steps need.

The error only shows in wp-admin. Is it the same problem?

Yes, same cause. Some plugins only load code in the dashboard, so the front end survives. The debug log and folder-rename steps work the same way.

Leave a Reply

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