WordPress is an excellent platform for creating websites and managing content. However, like any other software, it’s not immune to errors and bugs. One of the most common errors you might encounter is “There Has Been a Critical Error on This Website.” This error can be frustrating, especially if you don’t know what caused it and how to fix it. In this article, we’ll explain what this error is, what causes it, and how to fix it.
What is "There Has Been a Critical Error on This Website" error?
The “There Has Been a Critical Error on This Website” error is a message that appears on your WordPress site when something goes wrong with a plugin, theme, or the WordPress core files. This error usually occurs when there’s a fatal error in the code that prevents WordPress from running correctly. When this happens, WordPress stops functioning, and you can’t access your site.
What causes “There Has Been a Critical Error on This Website” error?
There are several potential causes for this error message. Some of the most common include:
1. A Plugin or Theme Conflict
WordPress websites rely on plugins and themes to add functionality and style. However, sometimes these components can conflict with one another, leading to errors and site downtime. If you recently installed or updated a plugin or theme, this could be the cause of the critical error.
2. A PHP Version Issue
WordPress requires a specific PHP version to function correctly. If your website is running on an outdated or unsupported PHP version, this can cause critical errors.
3. Memory Limitations
If your website has a lot of content or receives heavy traffic, it may be using too much memory. This can lead to critical errors, particularly if your web hosting provider has strict limitations on memory usage.
4. A Corrupted WordPress File
Sometimes, a single corrupted file can cause errors across your entire website. This is particularly likely if you recently made changes to your WordPress installation or uploaded new files.
How to fix "There Has Been a Critical Error on This Website" error?
Now that you understand some of the common causes of this error message, let’s look at the steps you can take to fix it. We’ll outline four different solutions, starting with the simplest and moving to more complex options.
1. Disable All Plugins and Switch to a Default Theme
If the critical error occurred after you installed or updated a plugin or theme, the easiest solution may be to deactivate all plugins and switch to a default WordPress theme.
To do this, log in to your WordPress dashboard and go to Appearance > Themes. Click on the “WordPress Twenty Twenty-One” theme (or another default theme if you prefer), and then click “Activate.”
Next, go to Plugins > Installed Plugins. Select all of your installed plugins, and then choose “Deactivate” from the “Bulk Actions” dropdown menu. Click “Apply.”
However, if you can’t access the admin panel, use the File Manager or an FTP client like FileZilla and go to public_html -> wp-content -> themes. Find your active theme’s folder and rename it into youractivetheme-disabled.
Once you’ve done that, reload the site. If it loads as expected, then there’s a conflicting theme present, and you may have to roll back to the theme’s previous version or get an entirely new theme instead.
On the other hand, if the error persists, you should check if there’s an issue with your plugins.
The process is similar to checking your theme. If you have access to the WordPress admin panel, disable all plugins.
If you can’t access the admin panel, use the File Manager or an FTP client and go to public_html -> wp-content -> plugins. Rename all plugin directories into yourplugin-disabled except the Elementor plugin folder if you have it installed.
If you’re using hPanel, there’s an easier way to do this. Go to the WordPress -> Plugins section and simply disable all plugins.
Refresh your site. If it loads normally, that indicates a conflicting plugin.
To find out exactly which plugin caused the error, you have to reactivate them one by one, reloading the web page every time.
If you’ve renamed your plugins’ folders, go to public_html -> wp-content -> plugins. Revert all plugin folders into their original directory names one by one.
2. Increase Your PHP Memory Limit
If your website is experiencing memory issues, you may be able to fix the error by increasing your PHP memory limit.
To do this, you’ll need to edit your website’s wp-config.php file. This file is located in the root directory of your WordPress installation.
Open the wp-config.php file in a text editor and add the following code at the bottom:
define( ‘WP_MEMORY_LIMIT’, ‘256M’ );
You can adjust the memory limit to your needs, but we recommend starting with 256M. Save the file and re-upload it to your server.
Now, check your website to see if the error has been resolved. If not, move on to the next solution.
3. Reinstall WordPress Core Files
If a corrupted WordPress file is causing the error, you may need to reinstall WordPress core files.
To do this, download the latest version of WordPress from the official website. Extract
Conclusion
There’s no need to panic if you encounter the “There has been a critical error on your website” message.
Simply check your email address and find an email from WordPress to locate the issue and quickly fix it.
Even if you don’t receive the email, there are five ways available to resolve the problem:
- Check the site’s error logs
- Use the WordPress debug mode
- Solve potential theme or plugin conflicts
- Restore the site using backup files
- Upgrade the site’s PHP version
We also recommend creating backups regularly. Therefore, you’ll be able to restore your site quickly if you get a WordPress error message such as this.