In this article, we will cover how to Fix the "There has been a critical error on this website" error on a WordPress Website.
This error blocks access to your website visitors and sometimes even won't allow you to access the admin panel. However, luckily this error can be resolved.
Here we are going to see how to troubleshoot this error and get the WordPress website fixed.
1) Check Website Error Logs
Log in to your SiteCountry Control Panel
Click on Site Summary / Statistics / Logs under System Info & Files section
Click on the Error Log link for the website causing the error
In this case, the critical error is caused due to bad code in functions.php on line number 69. By removing this wrong code the error can be resolved.
2) Use WordPress Debug Mode
Alternatively, you can also spot the cause of the critical error by using WordPress Debug mode. To activate it you need to edit the wp-config.php file and set the value for the below line to true and Save the File
define( 'WP_DEBUG', false );
Just enable the Debug mode and visit Website URL to see the error
3) Change the PHP Version
This critical error can also happen due to an Unsupported PHP version. WordPress requires PHP 7.4 or higher.
If you are using an older version then change it to a supported PHP version to fix this error. You can do this in your SiteCountry Control Panel under Select PHP Version
4) Modify PHP Settings
A major cause of the critical error due to PHP Memory limit being exhausted.
In this case, you fix this error by increasing the PHP memory_limit value in PHP Settings
And in the wp-config.php file, add the below line and Save the File
define( 'WP_MEMORY_LIMIT', '256M' );
5) Disable Plugins or Themes Causing Error
Say your Website was working fine and suddenly your website is showing a critical error then this may be caused to due to last installed plugin or theme.
In this case, to resolve this you need to backtrack and do mentioned things one by one
a) Go to Dashboard > Updates page and check whether all your plugins and themes are up to date. If not then update it and check whether the error has gone.
b) Deactivate the plugin last installed one by one and check whether is it resolved. If the error is resolved by disabling a specific plugin then the error may be with the plugin. Contact the plugin provider to get a solution for the same. But even after disabling all the plugins error is not gone then the error may be with the theme.
c) Switch the theme to the default theme and see whether the error is resolved. If the error is gone then the issue may be with the theme. Contact the theme provider to get a solution for the same.
6) Re-install WordPress Core
Even after switching back to the default theme and deactivating all the plugins the critical error is shown then re-install the WordPress core.
Go to Dashboard > Updates page and Click on Re-install version x.x.x button
Once WordPress core is re-installed check whether the critical error is gone.
7) Restore Backups
Even after trying out all the above steps if the critical error is not gone final option is to restore the website from the backups.
To restore a backup go to Jetbackups select a backup file and restore the last working version.
So, There is no need to panic if you encounter the "There has been a critical error on your website" message.
Simply check your admin email address for an email from WordPress to identify the cause of the issue and refer to this article to quickly fix it.
And if you need any help with resolving WordPress critical errors, please feel free to contact our customer support team.