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

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

Reading “There has been a critical error on this website” is scary, but you need not worry since most of the time this only shows that there is an error in PHP within WordPress, and hence, the loading of this portion of your site is halted.

The best thing is that you need not start afresh in solving the problem since you can fix this “There has been a critical error on this website” WordPress error. This article gives you a step-by-step procedure of solving this problem even if you have lost access to your WordPress dashboard.

Key Points

  • Use the WordPress recovery mode to find out the reason behind this critical error.
  • Disable all plugins and switch the theme to find out the source of this error.
  • Enable debugging in WordPress in order to find out the actual error message in debug.log.
  • Make sure that your PHP version and memory limit are compatible.
  • It is recommended that you make a backup in order to avoid critical errors in the future.

What is Critical Error on WordPress?

“The recovery mode of this website is active. Please refer to your site admin email inbox for more instructions.”

The above general statement shows that WordPress is now in its recovery process. The moment you get such warnings, then it shows that there are critical errors present in WordPress, and hence some functionalities of your site are no longer working.

What Triggers the “Critical Error” in WordPress?

The WordPress critical error notification usually appears due to a PHP fatal error. The following are some of the most common triggers:

  • Malfunctioning or incompatible WordPress plugin
  • Outdated or incompatible theme
  • Version clash in PHP
  • Lack of PHP memory
  • Damaged or corrupted WordPress files
  • PHP code that is erroneous
  • Plugin or theme clashes after updates
  • Errors on the server side

WordPress has developed Recovery Mode to assist site administrators to detect any fatal errors resulting from plugins, themes, and PHP code.

Also, it will be prudent to create a backup of your site before making any changes. In case you are unable to fix WordPress errors yourself, then you may read the article on fixing WordPress errors published by HarmonWeb.

Solving Critical Errors in WordPress

1. Check the WordPress Recovery Mode Email

In case a critical error occurs in the WordPress website, the system sends an email to the site admin about the error and gives a link to the recovery mode page.

The administrator should look for the email in his/her email inbox and even check for any messages in the spam or junk email section.

Through the use of the recovery mode link in the email, the user will be able to access the WordPress account where he/she will identify the faulty plugin or theme.

2. Deactivate Your WordPress Plugins

The first thing you need to look into when there was an error in your website is whether you have a recently installed or updated plugin.

If you can log into the dashboard, navigate to Plugins > Installed Plugins and deactivate all of your plugins, especially the ones that were installed or updated just before the error occurred.

If you cannot access WordPress administrator, use File Manager or FTP of your hosting:

  1. Go to the directory where WordPress is installed.
  2. Then go to /wp-content/
  3. Then find the plugins directory.
  4. And rename it to something like plugins-old.
  5. Open up your website again.

This way, you will deactivate all plugins. If your website works fine now, then rename the folder to plugins and activate the plugins again.

This technique is especially helpful when searching for ways to resolve a critical WordPress error when one does not have access to the dashboard.

3. Use Default WordPress Theme Instead

In case your issue does not resolve through plugin deactivation, you should check if the currently used theme might cause such behavior.

Via FTP or hosting File Manager access, go to:

/wp-content/themes/

Locate the currently used theme and rename the theme directory, which will force WordPress to use default theme.

If the website starts working properly, the theme or code within the theme is most likely at fault.

Such issues may arise due to updates, particularly when the theme uses old PHP code that conflicts with some other plugin. The HarmonWeb guide for what to do if WordPress freezes after updating themes includes this case too.

4. WordPress Debugging On

Should the problem persist, you should switch WordPress debugging on to gain more information on the problem.

In the wp-config.php file, there is a WP_DEBUG constant, which is available for you.

Such a debugging can be configured like that:

define( ‘WP_DEBUG’, true );

define( ‘WP_DEBUG_LOG’, true );

define( ‘WP_DEBUG_DISPLAY’, false );

Save the file and reproduce the error. Check the following file:

/wp-content/debug.log

This file is highly recommended by WordPress for analysis of critical errors. It will indicate for you which plugin, which theme, which PHP function or file causes the fatal error.

Setting WP_DEBUG_DISPLAY to false will prevent sensitive error information from displaying to the visitor.

5. Determine PHP Version and Memory Usage

A mismatched PHP version might make some of the older plugins or themes fail to work. Similarly, a website hitting the PHP memory limit might result in fatal errors.

Find out from the hosting control panel the PHP version used by your website. Should the issue arise right after upgrading the PHP version, you might want to either roll back to the compatible PHP version or contact the hosting provider first before doing anything else.

It would be good also to check how much memory your PHP uses. Increasing the memory may fix the issue temporarily, however, it would still be best to find out what consumes too many resources.

For more tips on server related WordPress issues, please refer to the article by HarmonWeb fixing 500 Internal Server Error in WordPress.

6. Restore a Recent Backup

If this critical error has occurred after installing a plugin, updating the theme or WordPress, or changing any coding, then restoring a recent backup might be the quickest way out.

But if you have an inkling of any hacking into your site, then do not go ahead with a blind restoration; rather find out the reason first.

Prompt WordPress security backups are necessary as they will allow you to recover in case something goes wrong during your investigation process.

7. Check Your Hosting Environment

It may not be the case that there is anything wrong with WordPress itself. It could be due to server resources constraints, PHP settings or any other issues at the hosting level.

In case you have turned off all your plugins, tested your theme, checked your debug log and PHP settings, then contact your host and have them check the PHP and error logs of the server.

Our WordPress hosting at HarmonWeb is specially made for WordPress sites and allows you to investigate any problems that may be associated with the hosting level.

How Can WordPress Critical Errors Be Avoided?

The following is how you can prevent encountering this error:

  • Never update without backing up your site (HarmonWeb does this for you)
  • Always keep WordPress, themes, and plugins up to date.
  • Test major upgrades on important websites.
  • Don’t modify core WordPress files.
  • Check that your PHP settings work with WordPress.
  • Delete the unused plugins.
  • Monitor your web hosting performance with the growth of your website.

In addition, refrain from installing any pirated or nulled versions of WordPress themes and plugins. Besides issues related to compatibility, there is also a high risk of malware being added.

Conclusion

The error “There has been a critical error on this website” on WordPress typically shows a fatal PHP issue instead of a dead website.

Try Recovery Mode and see what is the reason – plugins, themes, incompatibility with PHP version, etc. If you still fail to find out the reason, stop making random guesses. Your backups and error logs from the server will help a lot.

Is There Still a Critical Error Being Seen?

If you’ve gone through all the above and your site is still not accessible, there may be something wrong on the side of your PHP settings or even the server. HarmonWeb is a reliable host for WordPress that can help you solve the issue at the level of your server.

If you have trouble troubleshooting your WordPress due to the current hosting platform, consider switching to a WordPress-specific host.

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply