Table of Contents
- Introduction
- What does the phrase “There Has Been a Critical Error on Your Website” actually mean?
- The causes of crucial errors on the WordPress website.
- Resolving the crucial errors in the WordPress Website
- Using the CPanel
- Conclusion
WordPress is the most popular content management system. While it is far from ideal, it is generally simple to use. WordPress errors might be critical, but most of them are simple to fix. When a message “There has been a critical error on your website” pop up, it is advisable to contact the admin panel to fix the error or follow some simple procedures alone to resolve the problem. WordPress has a feature that detects when a plugin or theme causes a fatal error and sends an email notification to the admin email account. In the email, users will find out more about what is causing the errors.
What does the phrase “There Has Been a Critical Error on Your Website” actually mean?
Some WordPress failures will prevent the user from accessing the dashboard and alert with a message, “There has been a critical error on your website.” Please look for instructions in your website administrator’s email inbox. “
This notification indicates that the website has a fatal PHP error. It happens when a PHP script crashes and is unable to complete its task.
The causes of crucial errors on the WordPress website.
The causes of “there has been a critical error” are memory limits exceeded, errors in the code, plugin or theme problems, and so on.
The error “There has been a critical error on your website” seems to be similar to the White Screen of Death error. The White Screen of Death bug makes the entire website, including the back-end, load as a blank white page.
However, with an error, you will receive an email from WordPress, and when you enter your site, you will see a notification indicating that your site is now experiencing a critical error. I believe that receiving an email or notice from WordPress regarding the mistake is far more beneficial than seeing a completely blank page.
Resolving the crucial errors in the WordPress Website
- Examine the website’s Error Logs
The PHP error log may only be checked if enabled on the web hosting account. Unfortunately, in most scenarios, error logging on a website’s directory is deactivated by default.
However, before altering any code or the web hosting setup, check the PHP data to see if PHP logging is enabled on the hosting account.
The first approach is to examine the error_ log file, which holds PHP error information.
In the File Manager of a File Transfer Protocol (FTP) client on your hosting account, navigate to public_html-> error log.
The file keeps track of four PHP errors: warning, notice, parse, and fatal.
If you discover a parse or fatal error, it is advisable to fix it. The error log file will only be available if PHP error reporting is enabled.
2. The WordPress troubleshooting
WordPress has a debugging system that detects code issues in the core software, themes, and plugins.
To activate the WordPress to debug mode, navigate the wp-config.php file in the public_html directory.
The “false” values indicate that WordPress debug mode is disabled.
To activate, substitute “false” with “true” on all lines. PHP variables play the following roles;
WP DEBUG — enhances WordPress’s debugging mode define( ‘WP_DEBUG’, true );
WP DEBUG DISPLAY – displays debug messages in the HTML of the pages. define ( ‘WP_DEBUG_DISPLAY’, true);
WP DEBUG LOG – records error information in the debug.log file define( ‘WP_DEBUG_LOG’, true );
SCRIPT DEBUG – instead of using the minified versions of the core CSS and JavaScript files, it uses the “dev” versions.
If those lines aren’t already in the wp-config.php file, add them to the script first, and then add the value “true” to each line.
Reload your website after activating debug mode. The details should be visible above the error message.
Resolve the problem as directed, and you will see your website operating again.
When you’ve already fixed the problem, deactivate the debug mode by adjusting the value to “false.”
3. Check out and resolve any theme or plugin conflicts.
The following method will assist you in locating conflicts in your theme and plugins.
Begin by double-checking your theme. Change the active theme to a default one, such as Twenty Twenty, if you have access to the WordPress admin area.
If you are unable to enter the admin panel, use the File Manager or an FTP client to navigate to public_html-> wp-content -> themes.
Find the folder containing your active theme and give another name to deactivate the current theme. Reload the page after you’ve done that. If it loads as expected, there is a conflicting theme present, and you may need to revert to an earlier version of the theme or get a new one instead. If the errors persist, check
whether the plugins are stable. The procedure is identical to that of testing your theme. If you have access to the WordPress administrator panel, deactivate all plugins and then reactivate them one by one to determine which plugin is causing the issue.
If you are unable to access the admin panel, use the File Manager to navigate to public HTML->wp-content->plugins and rename the plugins folder to deactivate all the plugins. If the site is loading properly, change the name of the plugins folder back to its original name and begin testing all the plugins one by one by activating them.
Navigate to public HTML->wp-content->plugins if you edited the plugins folders. Rename each plugin folder back to its original name one by one.
4. Using a backup, restore the site
You must restore the website files from a backup using this procedure. It is one of the reasons why it is critical to have a backup of a WordPress site.
Using the CPanel
Go to Files -> Backups and select Files backups to restore the backup files using the control panel or Cpanel of your hosting server.
Choose the necessary backup version and then press Show Files. At the bottom, a new section will emerge, displaying the backup files directory. Select the backup data to restore from the Database backups section. Press the Restore button after the appropriate backup data have been selected.
5. Make sure the PHP version is upgraded
PHP 7.4 or higher is necessary for WordPress. Examine the PHP version on your web host. If the version is lower than 7.4, upgrade to solve the error.
Navigate to the Advanced -> PHP Configuration area of Cpanel. On the PHP Version tab, you should see the current PHP version. Select PHP 7.4 or PHP 8.0 and click save if running on PHP 7.3 or lower.
Conclusion
There’s no need to worry if you see the notification “There has been a critical error on your website.” Check your email address for an email from WordPress to locate and swiftly resolve the issue. Even if you do not receive the email, there are five options for fixing the problem;
- Examine the website’s error logs,
- Make use of WordPress’s debug mode,
- Eliminate any potential theme or plugin conflicts,
- Use backup files to restore the site,
- Modify the PHP version of the site.
In case of any difficulty, approach customer support and inquire or ask any question that may be relevant. Additionally, if the error has been resolved quickly and effectively, don’t exist without leaving feedback or comment.
Read More: How to Setup Ecommerce Tracking in WordPress