Are you encountering a “There has been a critical error on this website. Please check your site admin email inbox for instructions.” error on your website?
If yes, then first, don’t worry! Your site data is safe; backups will be taken automatically by the hosting provider (contact them if necessary).
While errors occur when there is a change in site settings, caches are not properly implemented, or there is a PHP problem.
Thankfully, resolving this serious issue typically just requires uninstalling a problematic plugin or implementing a little PHP code.
This article explains the problem message and offers simple solutions.
So, let’s get started!
What is the cause of the “There Has Been a Critical Error on Your Website” error?
The “There Has Been a Critical Error on Your Website” error in WordPress often replaces the older White Screen of Death issue.
It appears with a message instructing users to check their site admin email inbox for further guidance.
The primary cause of this critical error is typically related to PHP issues. This can include exceeding the memory limit, coding errors, problems with plugins or themes, or even database corruption.
Here are other WordPress errors to consider include:
- ERR_CONNECTION_TIMED_OUT: Indicates a slow or overloaded web server.
- ERR_CACHE_MISS: Often linked to website cache or PHP tools like plugins.
- 500 Internal Server Error: A severe issue often stemming from server file corruption.
- Error Establishing a Database Connection: Usually due to database corruption or server problems.
- HTTP 503 Service Unavailable: Points to a problem with the server.
- HTTP 502 Bad Gateway: Another server issue typically caused by excessive visitor traffic.
Common critical issues
Common critical issues in WordPress might be difficult to identify since the error message contains insufficient information. However, potential concerns to examine include:
- PHP Memory Limits: Low server memory limits, especially in shared hosting environments, can lead to critical errors when resource-intensive plugins are used.
- Outdated or Incompatible PHP Versions: Using outdated or incompatible PHP versions can expose the website to security vulnerabilities and potential downtime, particularly as support for older PHP versions is phased out over time.
- WordPress Core Files: Corrupted core files may result from server-side errors during database updates or directory permission configurations.
- Theme and Plugin Problems: Critical errors often stem from broken theme files or malfunctioning plugins, particularly during automatic updates or due to compatibility issues.
- Syntax Errors: Incorrect lines in PHP scripts can trigger critical errors due to missing symbols, spelling errors, grammatical mistakes, or other coding issues.
- Malware Infections: Malicious code infiltration can profoundly impact database integrity, rendering the WordPress site inoperable. Vulnerable plugins and themes are common entry points for malware.
Fix the “There Has Been a Critical Error on Your Website” Error
To solve a critical problem with WordPress, you need to find out what’s causing it. WordPress usually sends an email with points about which file and line of code caused the issue, but if you didn’t get it, that’s okay.
There are five ways to find and fix serious errors on your WordPress site.
1. Look in your admin email inbox for error messages
WordPress error messages sometimes tell you to check your admin email inbox for more details about the error or its cause. You might also find a URL to access a recovery mode version of your site.
If you don’t see an email about the error right away, check your spam folder. Sometimes, you might not get an email at all, so you’ll need to fix the issue without it.
2. Check Error Logs
Another way is to look at the error_log file, where PHP error details are stored. Access it using the File Manager in your hosting account or via a File Transfer Protocol (FTP) client.
- Go to home/[username]/.logs/error_log_[domain].
This file captures four types of PHP errors: warning, notice, parse, and fatal.
Each log entry begins with the type of error detected. If you encounter a parse or fatal error, you’ll need to resolve it.
3. Turn on the Debug Menu in WordPress
If your WordPress website isn’t working correctly, enabling debug mode can help you identify the problem. Debug mode shows error messages written in a programming language called PHP. These messages can point you to the source of the issue.
Manual Way to enable debug mode:
- Manually editing a file: This method requires some technical knowledge. You’ll need to connect to your website using a tool called FTP and edit a file named “wp-config.php”. Specific instructions are below:
- Connect to your website with FTP or cPanel.
- Find the file named “wp-config.php” in the main website folder. This file contains important settings for your website.
- Open the file with a text editor. A text editor is a simple program for viewing and editing text files.
- Paste this code at the very end of the file, before the last line:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', true );
- Save the changes and close the file.
Finding the Error Source
With debug mode enabled, error messages will be saved to a file named “debug.log” inside the “wp-content” folder on your website. You can access this file using FTP to view the error messages.
The error messages might mention specific themes or plugins, which could be causing the problem. Even if you don’t understand the messages completely, it’s helpful to save them in case you need to ask for help from a developer.
Remember to Turn Off Debugging
Once you’ve identified and fixed the issue, it’s important to turn off debug mode. Error messages can be confusing for visitors to your website.
You can either disable debugging through your hosting provider’s tools (if you used that method) or by removing the code you added to the “wp-config.php” file.
4. Revert to a Default Theme:
Sometimes, a critical error may stem from conflicts within your current theme. Testing this involves temporarily removing it and switching to a default theme, which typically resolves the issue immediately.
Before proceeding, ensure you go back to your site to have a way to restore your theme files if needed. Reinstalling the theme could result in the loss of custom styling.
If your dashboard is accessible, do these actions:
- Navigate to Appearance > Themes.
- Select your current theme and click Delete in the pop-up window’s lower-right corner.
If the Delete option isn’t available, try downloading and activating a different theme. Opting for a default theme like Twenty Twenty-One is advisable.
Your site should now switch to Twenty Twenty. If it loads properly, the issue likely stemmed from a theme conflict. To restore your theme files, reinstall the theme or revert the folder to its original name.
Read more: A Step-by-Step Guide to Update Themes in WordPress
5. Disable All Plugins
Often, a plugin is responsible for critical errors. If you have numerous plugins installed, pinpointing the problematic one might seem overwhelming. Also, check out our blog on plugin conflicts to find a solution.
To identify the culprit:
- Disable all plugins from the dashboard by going to Plugins > Installed Plugins, selecting all, and clicking Bulk Actions > Deactivate.
If the error resolves, reactivate plugins one by one until the issue recurs, revealing the problematic plugin.
Alternatively, you can delete plugins entirely, though you’ll need to re-install them manually or restore a backup.
To reactivate plugins, return to Installed Plugins and click Activate on each one individually.
Bonus Tip: If you’re encountering memory issues, adjusting the PHP memory limits can provide relief. While the standard limit of 128 MB suffices for many situations, there are exceptions.
If you’ve hit the maximum limit and are still facing issues, consider upgrading your hosting plan.
To update your PHP version, follow this guide:
Read More: How To Update Your PHP Version In WordPress
Conclusion
Resolving the “There has been a critical error on this website” issue in WordPress necessitates extensive debugging and careful consideration of probable reasons. Following the procedures given in this article will allow you to efficiently detect and solve the underlying issues, restoring website functionality and guaranteeing a seamless user experience.
Remember to back up your site before making any big changes, and if you need help, don’t hesitate to contact your hosting provider or the WordPress support forums.
FAQs on There has been a critical error on this website
Can changing PHP’s memory limitations or version fix the critical error?
Increasing PHP memory limits can assist in handling memory-related issues that could result in catastrophic failures. If the problem remains despite increasing RAM restrictions, you may need to update PHP or request an upgrade from your hosting provider.
What should I do if I am unable to access my WordPress dashboard due to a serious problem?
If you are unable to access your dashboard, you may still resolve the problem by analyzing error logs, activating debug mode, or restoring a default theme via FTP. These procedures can assist in identifying and fixing the root cause of the critical problem.
Is it safe to deactivate or uninstall plugins and themes in order to resolve the severe error?
Deactivating or uninstalling plugins and themes can aid in isolating the faulty component generating the critical error. However, continue with caution and make sure you have backups in place to restore your site if necessary. Additionally, avoid removing key WordPress files, since this might lead to further issues.