How to Fix “There Has Been A Critical Error on Your Website”?

If your site is built on WordPress, you might encounter an error message “There Has been a Critical Error on This Website ” sometimes.

There is nothing to worry about, all you need to do is check out your email that is linked with your website admin and follow the instructions or click on the link for the WordPress debugging guide provided.

This particular error has multiple solutions available through which you can easily get access to your WordPress site and fix it in no time. Therefore, in this post, we will discuss all the aspects of the “there has been a critical error on this website” error and some best solutions to fix it immediately.



What is a “Critical Error in WordPress”?

This Critical error in WordPress means that there have been some serious issues in loading your PHP script and, it is unable to run and complete its process which is also considered a PHP fatal error.

Earlier this particular error was seen as a white screen of death or “PHP fatal error” message on the screen.

But after the WordPress update 5.2, both these errors are included in a single error message “There has been a critical error on this website. Please check your site admin email inbox for instructions”.

To help the users and notify them about the error, WordPress has a special feature that automatically detects any fatal error either caused by installed Plugins or themes and immediately sends an email notification to the admin’s email address.

The email notification will consist of detailed information about the cause of the error and it will look somewhat like this:

there has been a critical error on this website error details in email
“There has been a critical error on this website” error details in the email

The email also consists of a special “recovery mode” link through which you can safely log in to your dashboard and investigate further.

In case you didn’t find any email regarding this, please check your email spam folder. However, if you didn’t receive any message in your email by any chance, but saw an error message on the screen as shown below:

There has been a critical error on your website error message
Displaying “there has been a critical error on this website” on the webpage

then you have to find out the cause and fix it as soon as possible.


What causes Critical Error in WordPress?

Generally, critical errors in WordPress occur when you have installed a corrupt plugin or used code/scripts with bugs, which prevents WordPress from functioning properly.

Here is the list of causes that can trigger Critical errors in WordPress.

  • There is an issue with your PHP
  • Memory limit exceeded
  • Error in your code,
  • Malfunction Plugin or theme files
  • Your database has been corrupted.
  • Copied and pasted code snippets to your website from untrusted source
  • Custom-coded plugins can conflict with other WordPress plugins.

Whatever the reason is, the error notification sent by WordPress to your email address will specify the reason behind this in detail and it will be easier for you to troubleshoot.

Now let us check out How you can fix Critical Errors in WordPress and get back access to your website.


How to Fix Critical Errors in WordPress?

To fix any WordPress error on your website the first thing you need to do is to investigate the cause that is triggering the issue.

Although WordPress will send you a notification email regarding the details of the error, in case you don’t receive any, which generally happens due to poor configuration of sending emails using SMTP on your website, then you must follow these simple solutions as given below:

A. Fixing Critical Error in WordPress using WordPress’s Debugging email

B. Fixing Critical Error in WordPress using Alternate methods:


A. Fixing Critical Error in WordPress using WordPress’s Debugging email

As we have already mentioned, WordPress will send you a notification email mentioning all the details about the cause and solution of the Critical Error in WordPress.

Step 1: The first thing you need to do is access your email inbox and look for your Website’s WordPress admin email.

If you are not able to recall which email address you have provided in your WordPress site’s admin email. It is normally the same email ID you provided while installing WordPress.

If your website is hosted on WPOven, WordPress is installed automatically when you add the site to the server, and your admin email address will be the same as that you have created WPOven’s hosting account with.

Step 2: So, when you find the email from the WordPress admin and open it, you will see detailed information about what caused the critical error on your website. Along with a unique link that will help you access your WordPress site’s dashboard in recovery mode to figure out the issue and resolve it.

In addition to that, when scrolling down to the email, you will find more details about the error i.e. the specific file or line of code that triggered it.

For your reference check out the images given below, which show Critical Error in WordPress is caused by the corrupt plugin, and detailed information is provided in the email, i.e. corrupt plugin name and the line of code triggering the error.

Critical Error in WordPress caused by the corrupt plugin
Critical Error in WordPress

Step 3: After that, you need to click on the WordPress recovery mode link, which will take you to your WordPress admin login page.

Step 4: Just Log in to your WordPress admin dashboard with valid credentials and you will see a notification telling you about the critical error, what causing it, and the link to fix it.

Step 5: In case, the error is caused by a corrupt or faulty plugin, the notification will be shown like the picture shown below and if you click on the link, it will direct you to the faulty plugin.

Critical Error in WordPress
one or more plugins failed to load properly

Step 6: Now you can either deactivate or completely uninstall the plugin.

Deactivating Faulty Plugin
Plugin install WordPress

B. Fixing Critical Errors in WordPress using Alternate methods

In case, you didn’t receive any email from WordPress, here are some of the alternate methods you can try to fix critical errors in WordPress.

1. Check out your Error logs

When you do not receive any WordPress notification email, the first thing you need to do is to check your WordPress Error log file. This file is responsible for storing all the mishaps or PHP error information.

For more details on Error logs and how you can set them up, please refer to our dedicated blog on “How to Set up and Use WordPress Error Log?” in the simplest yet most informational format ever.

To access your Error logs, Use the File Manager of a File Transfer Protocol (FTP) client on your hosting account and go to home/[username]/.logs/error_log_[domain].

Or if you have hosted your website on WPOven, they are available in the logs/ folder for the site.
To access the logs folder, use the SFTP account associated with the site, on login you will see two folders’ logs/ and public_html/.

You will find the logs inside the logs/ folder named error.log and access.log. You may download them using the same SFTP account to your local PC for further review. You may also use ssh to log in and check these logs.

Generally, error logs consist of four types of PHP errors, Parse error, fatal error, Warnings, and critical errors. If you find any critical/fatal errors, you have to fix them immediately.

2. Activate Debug Mode in WordPress

If you are unable to find your error log file, the alternate method you can try is to activate or enable debugging in WordPress.

The WordPress CMS comes with an inbuilt special feature called debugging which helps to find out the PHP error codes in the core software, theme files, or in plugins.

To enable WordPress to debug mode manually you need to add some constants to your Wp-config.php file.

To configure your wp-config.php file, you need to connect to your server using the File Transfer Protocol (FTP) client. Most probably you will find the wp-config.php file in your root folder or your website and when you can locate the file, open it and make some edits.

wp-config file location
wp-config file location

The wp-config.php file mostly contains all your website’s configuration settings, such as settings by web hosting provider, database information, and other vital information. Now to enable the WP debugging, you need to look out for this line of code:

('WP_DEBUG',false);

Now, when you can find the above code line, the next thing you need to do is copy the code below over the

// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );

// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );

// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

// Use dev versions of core JS and CSS files (only needed if you are modifying these core files) define( 'SCRIPT_DEBUG', true );
/* Now you are done, save and Exit

Where,

  • WP_DEBUG means to enable the debugging mode on WordPress.
  • WP_DEBUG_LOG lets store all the error details in a log file.
  • WP_DEBUG_DISPLAY shows error messages on the page in HTML
  • SCRIPT_DEBUG helps to run the dev version of CSS and javascript files rather than the minified version.

Note: It is not highly recommended to change the WP_DEBUG_DISPLAY to true or else the errors will start displaying on your live website.


After pasting the above code in your wp-config.php file, you must save the changes and exit the text editor. Now you have successfully activated the Debugging mode.

However, if you like to enable just the basic WordPress debugging mode, you can add the code below:

define( 'WP_DEBUG', true ); // To enable WP_DEBUG mode on

Now once you can debug your website, you can disable the debug mode by either setting the constants to false or by simply removing the snippet from the wp-config.php file.


Read: 🚩 To learn how you can enable/activate WordPress debugging, please check out our complete guide on “WordPress Debugging: How To Enable WP_DEBUG?


3. Revert/Restore Your WordPress Site

When your website is being hurdled up with WordPress errors and you aren’t able to find the possible causes and their solution, the best thing you can do is to restore your website from the backup.

Yes, you heard it right, it is why we always push everyone to keep the latest backup of their websites all the time.

Even if you face the same issue, it will be easy for you to track the steps that you are following that might trigger the error.

Well, how you restore your website completely depends upon the method you use to back up your website. If you use any WordPress backup plugin, you must refer to their knowledge base or documentation for further steps.

Or if your web host manages your website backup, please contact your web hosting provider. At WPOven, all the websites you host will be backed up automatically daily powered by Amazon S3 and when you like to restore it, you can either:
1) Drop a support ticket and our support team will be happy to restore the backup for you. OR

2) You can Download the desired backup and restore it by logging in through SFTP.


Note: Try to restore your live site on a staging platform first and see if your website is working properly or not and avoid the vulnerability of vanishing your hard work.


4. Solve Any Theme Conflict

Sometimes, the “there has been a critical error on this website” error can be triggered due to some conflict in your active theme file. The best way to deal with it is to simply revert to your default theme and see if the issue has been resolved or not.

However, in case you are unable to access the admin panel or WordPress dashboard, use an FTP client such as File Zilla to access your website files on the server and navigate to public_html folder > wp-content>themes.

Search your active theme folder and either rename it as “youractivetheme-disabled” or completely delete it.

If your website can load completely without any issues, then it means there was an issue with your previous theme. Now to restore your previous theme, you can simply either install it again or rename the folder back to its original name.

5. Deactivate Installed WordPress Plugins

If you are still having a critical error on your website, check if there is any issue with your installed plugin. If you can access the admin panel or WordPress dashboard you need to disable all the installed WordPress plugins on your website first by navigating through Plugins > Installed Plugins and marking the checkbox at the top of the list to select them all. Then click Bulk Actions > Deactivate.

Disable all WordPress plugins
Disabling all WordPress plugins

However, in case, you are unable to get access through the admin panel of the WordPress dashboard, use an FTP client such as File Zilla to access your website files on the server and navigate to public_html folder > wp-content>plugins.

Likewise, you did in the case of themes, rename all the plugin folders into yourplugin_disabled but left the element (if you have installed) plugin directory as it is. And check if your website is functioning properly or not.

If your website loads perfectly, then it means the plugin was the main culprit for triggering this error. Now to find out the exact plugin that is causing the issue, you have to install each plugin one by one and reload the webpage simultaneously.

If you used the manual method to disable the plugins by renaming the plugin directories, to get them back rename all the plugin directories back to their initial or previous name by following the same step.

6. Check Your PHP Version and Upgrade It to the Latest Version Available

An outdated or old version of PHP is often responsible for your website breaking and generally responsible for other website conflicts occurring. To run WordPress successfully, the PHP version must be either 7.4 or more.

However, some webmasters prefer to stay on PHP version 7.4 to prevent compatibility issues with your current themes and plugins. But if you are using a PHP version below 7.4 then you must be required to upgrade it to the latest version available that can solve the issue “there has been a critical error on this website”.

WPOven users can upgrade their PHP version, by simply requesting Custom support and our Experts will do it for them without needing to follow any complicated steps.

7. Increase Your PHP Memory Limit

Apart from the Theme or Plugin being the culprit for “there has been a critical error on this website”, your limited PHP memory is generally the actual reason to blame.

PHP memory limit is termed as the fixed RAM that your web server has and this memory limit is set up by WordPress to run PHP scripts within the values.

When this PHP memory limit exceeds, the outcome will be the White screen of death or Critical error.

On the other hand, you cannot set your PHP memory limit even too high, or a long PHP script will slow down your website to crawl. However, the default PHP memory limit can be too low for your website, therefore slightly increasing the limit will fix the critical error.

Step 1: To do so, the first thing you need to do is to access your web files via an FTP client i.e. File Zilla, and look for the wp-config.php file.

Step 2: Open your wp-config.php file add the following code snippet just before the final line of code and save it.

define( 'WP_MEMORY_LIMIT', '256M' );

Now if it works, that means whatever plugin you have installed and used might be corrupt or broken and needs to be deleted immediately.

8. Increase Your Upload Max File Size Limit

If you are experiencing the “there has been a critical error on this website” only on certain pages not all, then it can be fixed by slightly making changes to your PHP functions to avoid certain large pages to break you need to slightly raise their recursion and backtrack limits.


To increase your upload max file size limit, you can check out our detailed post on “ How to fix “the uploaded file exceeds the upload_max_filesize directive in php.ini” Error?


But to fix breaking or certain large pages on your website, you need to insert the following code snippets in your wp-config.php file right before the final line of code.

ini_set('pcre.recursion_limit',20000000);
ini_set('pcre.backtrack_limit',10000000);

9. Scan Your Website for Malware

Sometimes, hackers put malicious scripts in themes or plugins to infiltrate your website and these scripts intentionally damage your website performance by slowing it down or triggering error messages on your webpage.

Detecting the malware and even removing a compromised faulty plugin or theme can be a daunting task, it can become even worse if you are unable to get access through the admin page and are completely locked out.

In addition to that, it is also very difficult to figure out which line of code is malicious unless you are a hardcore developer. Deleting random files won’t help you either, in fact, it can severely damage your website as well.

In this situation, the best thing you can do is to either restore your website from the backup or contact your web host for help.

10. Purge Your Website Cache Memory

Cache memory somewhat helps in loading your website faster and even reduces loading time. Mostly it turned out to be a good thing for your website.

But sometimes this cache memory can also get corrupted over time and trigger these types of errors on your website. To get rid of this, the best thing you can do is to clean or purge your cache.


Read: 🚩 To do so, you can refer to our dedicated post on “How to Clear WordPress Cache on Your Website in 2023?


Note: Do not worry about the cache memory being cleared, the cached version of your website will be stored as soon as your website is restored and it will start loading quickly again.

11. Contact Support

In the worst case, if all the above-mentioned methods fail to fix the “there has been a critical error on this website” error. The only option left is to contact your web hosting support team or a Freelancing WordPress Expert who can help you fix this critical error in no time.

WPOven offers industry-leading WordPress maintenance services with 24×7 WordPress Expert support included in every plan without any additional charges. With a higher response time and years of WordPress experience, our Expert team will help you get your website back on track as fast as possible.


Conclusion

Whenever you see an error message “There Has been a Critical Error on This Website” on your screen you do not need to panic.

We know this error might cause you confused you lose your website, but all you need to do is just check your email inbox for messages from WordPress and follow the instructions given.

However, in the worst scenario, if you have not received any email from WordPress, you can try the alternate methods we have mentioned.

1. Check error logs

2. Activate Debug Mode in WordPress
3. Revert/Restore Your WordPress Site
4. Solve Any Theme Conflict
5. Deactivate Installed WordPress Plugins
6. Check Your PHP Version and Upgrade It to the Latest Version Available
7. Increase Your PHP Memory Limit
8. Increase Your Upload Max File Size Limit
9. Scan Your Website for Malware
10. Purge Your Website Cache Memory
11. Contact Support

Also, it is highly recommended that you create backups regularly so that you can easily restore your website whenever you encounter such WordPress errors.


Frequently Asked Questions

How do I fix critical errors in WordPress?

You can fix WordPress Critical errors by following these 12 methods.
1. Fixing Critical Error in WordPress using WordPress’s Debugging email
2. Check out your Error logs
3. Activate Debug Mode in WordPress
4. Revert/Restore Your WordPress Site
5. Solve Any Theme Conflict
6. Deactivate Installed WordPress Plugins
7. Check Your PHP Version and Upgrade It to the Latest Version Available
8. Increase Your PHP Memory Limit
9. Increase Your Upload Max File Size Limit
10. Scan Your Website for Malware
11. Purge Your Website Cache Memory
12. Contact Support

What causes critical errors in the WordPress plugin?

One of the most common causes of Critical errors in WordPress is a corrupt plugin, plugin incompatibility, or Plugin conflict. If this is the cause, the best way to tackle is, to deactivate the culprit plugin. However, due to a critical error, you might not be able to access the WordPress admin or the installed plugins.


Leave a Reply

Your email address will not be published. Required fields are marked *