How to Fix The Critical Error in WordPress

How to Fix The Critical Error in WordPress

Is your WordPress website displaying the critical error notification? In this article, we will discuss How to Fix The Critical Error in WordPress.

As a website owner, Nothing disappoints you more when your WordPress site goes down, and you are getting an alarming message “There has been a critical error on this website.”

Luckily, it is possible to fix the errors with a few simple and easy methods.

What is a Critical Error in WordPress?

A critical error in WordPress is an error that stops WordPress from loading the scripts it needs to function properly. And may stop you from accessing the dashboard.

In earlier days, ‘the white screen of death’ was the error caused by the websites. This unexpected error causes your entire website to load as a blank white page. 

But the current versions of WordPress display the critical error with the text ‘There has been a critical error on this website. Please check your site admin email inbox for instructions.’

The email has a URL to access the site in recovery mode. You can click the link to safely log in to the WordPress dashboard to fix the issue. 

How Critical Error Occurs in WordPress?

The critical error in WordPress is caused when the plugin, code, or script stop working and prevents WordPress from functioning unless you fix the issue.

It may occur if you have newly copy-pasted code from any tutorial to your website, then the critical error might occur.

All the WordPress plugins are tested thoroughly. Therefore, there are rare chances for them to cause a critical error. But, two plugins may not work correctly with other plugins, or some custom code showing a conflict that may trigger the error.

Now, let’s move forward to know how to fix the critical error in WordPress.

Fixing The Critical Error in WordPress (2 Methods)

WordPress sends an email to the admin email address of your website when it finds some critical error. But there may be cases when the site admin doesn’t receive the crucial email.

Therefore, we will explain two methods for both the users who receive emails and one who doesn’t.

1. Fixing Critical Error with WordPress Debugging Email

First, visit your WordPress administration email inbox for the email 

It is the same email address you entered while installing WordPress.

In your email inbox, you will see an email with the line in the subject ‘Your Site is Experiencing a Technical Issue.’ Go through the email. 

You will find more helpful information inside it explaining what generated the critical error on your website.

We will show you different examples of emails showing the critical errors.

1. In the first one, the WordPress theme caused the critical error.

The email provides a link to let you log in to your WordPress website in recovery mode to analyze and fix the issue.

At the end of the email, you will find more information about the error. It includes the specific file and the code that triggered it.

2. In the next example, the code at line 614 in our theme’s functions.php file triggered the error.

3. Another example showing the error is caused by the abnormal behavior of the WordPress plugin.

As you have seen different examples, you have to move ahead to fix the error.

Now, click on the provided link to access your WordPress admin area in recovery mode.

After logging in, It will display a notification with details about the critical error and what caused the error. 

It will provide a link to enter the place to fix the error.

For now, the following example tells that the plugin causes the critical error with a link to the plugins page.

When you click the link, it will display the plugin that was causing the error. Moreover, It will also display the exact line of code that caused the error.

Now, Step forward and deactivate the plugin for now.

You can find an alternative WordPress plugin similar to this or see if the plugin developers can help you.

Likewise, if the problem is with your theme, then you will get a link to the Themes page, which will display the theme, causing the error.

For that, change or delete your WordPress theme and then reinstall the same fresh theme from the official source. And notice if the issue resolves.

After resolving the issue, you can go ahead and select the Exit Recovery Mode option at the top.

This mostly resolves the error, and your WordPress website will start working properly.

But, if you are still seeing the critical error message in WordPress, then you can try the next troubleshooting steps.

Fixing Critical Error in WordPress Manually

You can also fix the critical errors manually if you did not receive the critical error notification email or if your email could not help you resolve the error. 

You can follow the below steps to fix the errors.

If your recent action causes the error, you can undo that to fix the issue. 

For example, if you have downloaded a plugin or theme and your site starts behaving abnormally, this is because of the plugin or theme you downloaded. You have to deactivate it to resolve the issue.

You can deactivate it by the below method.

In contrast, if you don’t know what causes the error, follow the steps.

1. Deactivate All WordPress Plugins

To disable the defective plugin, you have to deactivate it. But, due to the critical error, you can not deactivate the plugin easily as you can not access the admin area. Moreover, you also don’t know which plugin is misbehaving.

For resolving this, You have to deactivate all WordPress plugins on your site. Don’t be afraid; you can reactivate them once you resolve the issue and get access to your WordPress admin area.

First, connect to your WordPress website using the File Manager app or an FTP client in your WordPress hosting control panel.

After that, go to the /wp-content/ folder.

Now, you will see a folder named ‘plugins’ inside the wp-content folder. You have to Right-click on it and then select the ‘Rename’ option.

Then, change the folder name to anything you like and remember it. Here, we are naming it ‘plugins. deactivate’.

When you do this, It will deactivate all the plugins on your site.

This is because WordPress finds the plugins folder to load the activated plugins on your website. When it cannot find the folder with the name plugins, it cannot activate the plugins and sets them as deactivated automatically.

Now, visit your WordPress site to see if the critical error message is disappeared or not.

Note:  The critical error issue is fixed or not but, don’t forget to rename the folder back to ‘plugins.’

This is because WordPress will recognize the ‘plugin’ folder only and allow you to reactivate them one after another from the WordPress dashboard to find out which one caused the critical error.

2. Switch to Default Theme

The next step in fixing the critical error is to switch your WordPress theme to a default theme. This will fix the critical error if some code causes it in your current WordPress theme.

For this, download a fresh copy of the TwentyTwenty or Twenty Twenty-One WordPress theme by Visiting the WordPress.org themes directory.

Then, you have to unzip the theme file on your computer. Once you unzipped the file, it will create a folder with the theme name on your computer.

Now you have to connect to your WordPress site using the file manager app or an FTP client in your hosting control panel.

Then, go to the /wp-content/themes folder. The folder contains the list of themes installed on your WordPress website.

After that, step ahead and download all the themes to your computer for a backup. 

Then, delete all theme folders from your WordPress site.

Now your WordPress site has no theme installed.

After that, upload the default theme folder you downloaded in the earlier step.

When finished, try to visit your website.

If your WordPress theme caused the critical error, it should disappear now, and you will be able to access your website.

3. Reinstall your WordPress

The corrupt WordPress core file or software could also induce a critical error in WordPress. The easiest method to fix this is by reinstalling your WordPress.

For this, visit WordPress.org and download a fresh copy of WordPress to your computer. Then, you have to unzip it to your computer. It will create a folder named ‘WordPress,’ which contains all the files you need to reinstall.

Then, you have to connect to your WordPress site using the file manager app or an FTP client in your hosting control panel.

After that, go to the root folder of your website. The root folder contains many folders, namely: wp-admin, wp-includes, and wp-content folders.

You have to select the files inside the WordPress folder on your computer and upload them to your website.

Then, Your FTP client will ask you to overwrite these files or skip them. You have to select ‘Overwrite’ and tick the check box next to the ‘Always use this action’ option.

Then, Click on the OK to continue. 

Now, Your FTP client will replace all your core WordPress files with fresh copies from your computer.

When finished, try to visit your website to see if this resolved the error or not.

If your corrupt WordPress core file or software caused the critical error, it should disappear now, and you will be able to access your website.

To conclude-  WordPress critical errors prevent WordPress from functioning properly and stop you from accessing the dashboard.  

When it finds a critical error on your website, it displays an error message and instructs you to visit your admin email inbox to fix the error.

We hope this write-up helped you fix the critical error in WordPress easily.

You may also like to read How to Find and Access WordPress Error Logs.  

 

Leave a Comment