How to Fix the “There Has Been a Critical Error on Your Website” Error

How to Fix the “There Has Been a Critical Error on Your Website” Error

Understanding the Critical Error Message in WordPress

If you’ve encountered the ominous message “There has been a critical error on your website,” you’re not alone. This generic and often frustrating WordPress error signals a fatal issue that has caused your site to crash. Typically, it’s triggered by PHP code conflicts, faulty plugins, broken themes, or memory exhaustion. While the message itself offers little detail, the underlying issue can often be diagnosed and resolved with a few troubleshooting steps.

WordPress began showing this more user-friendly error message in version 5.2 and up, replacing the classic “white screen of death.” When this happens, WordPress usually sends an email to the admin email address with more information, including a link to access recovery mode. But even if you didn’t receive that email, there are several ways to fix the issue manually.

Step 1: Enable Debug Mode to Reveal the Cause

The first step is to dig deeper into the root cause. You can enable WP_DEBUG to display the actual error message.

How to Turn On Debug Mode

1. Access your site via FTP or your web hosting file manager.
2. Locate the wp-config.php file in the root directory.
3. Add or modify the following lines:

“`php
define(‘WP_DEBUG’, true);
define(‘WP_DEBUG_LOG’, true);
define(‘WP_DEBUG_DISPLAY’, false);
Save the file and reload your site.

Now, check the wp-content/debug.log file for detailed error information. This log file will often pinpoint the specific plugin, theme, or PHP script causing the issue.

Step 2: Disable All Plugins

More often than not, the culprit is a misbehaving plugin. To isolate the issue, disable all plugins.

How to Disable Plugins Without Accessing the Admin Dashboard

Go to your site’s files via FTP.

Navigate to wp-content and rename the plugins folder to something like plugins_backup.

Reload your site.

If the site starts working, then the issue is indeed plugin-related. To find the problematic one, revert the folder name to plugins and then rename each plugin’s folder one by one until the error returns.

Step 3: Switch to a Default Theme

Sometimes the theme itself is the source of the crash. You can test this by switching to a default WordPress theme like Twenty Twenty-One or Twenty Twenty-Four.

Navigate to wp-content/themes.

Rename your active theme’s folder.

WordPress will automatically revert to a default theme if available.

If your site starts working after this, the issue likely lies within the theme’s functions or custom code.

Step 4: Check for PHP Version Compatibility

Incompatible PHP versions can also trigger the critical error. WordPress and its plugins often rely on specific PHP versions to function correctly.

Log into your hosting control panel.

Find the PHP configuration settings.

Make sure you’re running a PHP version that’s compatible with your WordPress version — preferably PHP 8.0 or higher.

Upgrading or downgrading PHP can often resolve compatibility-related crashes.

Step 5: Increase PHP Memory Limit

If your site is running out of memory, it might crash with the critical error message.

How to Increase PHP Memory Limit

Open wp-config.php.

Add the following line just before /* That's all, stop editing! */:

define(‘WP_MEMORY_LIMIT’, ‘256M’);
Save and refresh your site.

This helps if the issue was caused by resource exhaustion.

Step 6: Restore from a Backup

If you’ve recently made changes that triggered the error and can’t isolate the issue, restoring a backup may be the quickest fix.

Most hosting providers offer one-click restore points, or you can use plugins like UpdraftPlus or Jetpack Backup if previously configured.

Step 7: Contact Hosting Support

If you’ve tried the above steps and the issue persists, it might be time to contact your hosting provider. Hosting support teams often have deeper access to server logs and configurations that can identify the problem quickly.

Keeping Your Site Safe from Future Crashes

Once your site is up and running again, it’s essential to implement preventative measures:

Always test plugin and theme updates on a staging environment first.

Use reliable backup solutions and schedule them regularly.

Limit the number of plugins installed, keeping only what you need.

Regularly monitor site health via WordPress tools and third-party scanners.

Additionally, keeping your WordPress core, themes, and plugins updated is one of the most important steps for maintaining site stability and security. A single outdated plugin can lead to errors like this, or worse, open vulnerabilities for hackers.

When Caution Becomes Confidence

Facing the “There has been a critical error on your website” message can be intimidating, especially when it locks you out of your WordPress dashboard. But with a methodical approach, most issues can be diagnosed and resolved quickly. Whether it’s disabling plugins, switching themes, or tweaking PHP settings, understanding the possible causes empowers you to recover faster and prevent future breakdowns.

If this guide helped you, consider bookmarking it or sharing it with fellow WordPress users. You never know when that message might pop up again — and this time, you’ll be ready.

Last updated on