Fix the WordPress There Has Been a Critical Error on This Website

As a WordPress user, you may have encountered an error. No one likes errors on a website, neither the owner nor the visitor. But there are some errors like a 500 internal server error and 'critical error' which completely takes down your website, and users cannot access it. 

Sometimes you, as an admin, cannot access the WordPress dashboard. It becomes hard to fix it. This error on any WordPress site prevents it from fetching all necessary scripts. 

Every second that goes by with this error screen drives away potential customers. Seems terrifying, right? Don't worry. I got you covered here!

In today's article, I'll explain everything you need to know about the 'There has been a critical error on this website' WordPress error. I'll explain why it occurs and how you can fix it and make your website up again. 

Also, at the end of this tutorial, I'll share 

So, without any further ado, let's jump into the tutorial. 

What Causes the 'There Has Been a Critical Error on This Website' Error in WordPress?

The critical error and the message "There has been a critical error on your website. Please check your site admin email inbox for instructions." have replaced the blank screen in more current versions of WordPress

Your WordPress site's administrator email address will get an email with additional error information and a link to activate the recovery mode dashboard.

If you don't fix this, WordPress won't be able to load the rest of the files it needs, and your site will go down. 

In most cases, an incompatible plugin, script, or piece of code is to blame for the critical error in WordPress.

The crucial issue could have been caused by recent code snippet copy-and-pasting from a tutorial.

The most popular WordPress plugins have been tested extensively and should not generate this error unexpectedly. However, the problem could have been caused by a clash with another WordPress plugin or some custom code.

How to Fix the WordPress Critical Error?

To fix the WordPress, 'There has been a critical error on your website.' error, there are two main methods. 

I'll explain both of them, so continue to read. 

1. Fix the Critical Error Using the WordPress Email

When this error occurs on your site, it is not very helpful in explaining its cause and the fix. But WordPress sends you a debugging email containing all the information about this error. 

It will have a unique link that gives you access to your WordPress site in recovery mode, where you can make repairs and do more research.

Note: If you didn't receive the error, you can skip this step and move on to the next step to fix the critical error. 

At the email's conclusion, there will be additional information, including the file and line of code that caused the mistake.

You can click the unique link in the email, log in to your site and deactivate the suggested plugin or theme. 

In most cases, this will bring back your site. You can find the plugin or theme's alternative or contact the support team for further assistance. 

However, if the error isn't fixed, you need to fix it manually.

2. Fix the Critical Error Manually

Sometimes, you may not receive the email to debug this error, so you have to fix it manually. There are various ways to fix it. I'll explore them one by one. 

Note: Before jumping into the fixes, please ensure you have enabled the error logs in WordPress. You also need to create a backup of your site so that in case something goes wrong, you'll have a backup of your site. 

You can use the All in One WP Migration plugin to create a site backup. 

After creating a site backup, you can follow the following steps. Maybe the critical error on your site will be fixed by applying the first method, or you'll have to use all of them individually. It depends on the cause of the error. 

So please continue to read to find out more. 

2.1. Switch to a Default WordPress Theme

To troubleshoot the critical error, you should change your WordPress theme to a default theme. If the critical error is due to incorrect code in your current WordPress theme, this should solve it.

But as you cannot log in to your WordPress dashboard so you can do it in two ways.

Every host may have a different dashboard, so if you want to use this method, you can contact your hosting provider for further assistance. 

But you can do it yourself as well using the FTP. 

Please follow the following steps to switch to a default WordPress theme using FTP. 

If you don't have cPanel access, you can do it using the FTP client. Please follow the following steps to access your site files using the FTP and create a new .htaccess file. 

2.1.1. Create a Backup of Your Site

To follow along, please create a site backup to avoid any loss. You can create a backup from your hosting panel or cPanel. 

2.1.2. Download FileZilla

Now download the FileZilla client software to your computer. You can download it from the official FileZilla site. After downloading it, please install it.

2.1.3. Connect to Your Site/Host Via FTP

Open the FileZilla software, and you'll see a blank screen. 

You'll need the FTP address provided by your web host and your FTP username and password to access your site via File Transfer Protocol (FTP). 

Your hosting account information will include your login credentials. The host may provide information on where the FTP address is stored if you request it. It's also possible to get in touch with them directly.

Once you have all the details, please fill in the information inside the FileZilla and connect with your host. Once the connection is successful, you'll see a similar message as in the following image. 

2.1.4. Switch to Default Theme

Once connected with your site, please navigate to the /wp-content/themes folder. 

WordPress comes with a few default themes pre-installed on your site when you create it. Some users delete all those themes and use a custom or another plugin. 

If you have the default WordPress themes on your site, you need to select all the available themes except one default WordPress theme and right-click and then click the delete to delete all the selected themes. 

Note: Download the theme folders to your computer for a backup.

But, if you do not have the default WordPress theme installed on your site, you must select and delete all the themes. 

After deleting all the themes, you need to download the latest version of the default WordPress theme. As of right now, the default theme is Twenty Twenty-Three

You need to download it on your computer, extract it and upload the folder to your site. 

Once it is uploaded, your site will use the default WordPress theme. Visit your site to see if the critical error has vanished. 

If it is still there, please follow the next steps. 

2.2. Deactivate all the Plugins

If the critical error isn't because of a theme, then it would probably be because of a faulty plugin. As mentioned above, the popular plugins are extensively tested, and they are most likely to cause this error. 

But sometimes, if you are using the previous versions of a plugin, it may conflict with other plugin's code and can cause the WordPress 'There has been a critical error on your website' error. 

To fix it, we need to deactivate all the plugins and activate them one by one to find the culprit. 

As you don't access the WordPress dashboard due to the critical error, you can deactivate the plugins in two ways. 

  • Using CPanel
  • Using FTP

For this tutorial, I'll use the FTP approach to deactivate all the plugins and fix the WordPress 'There has been a critical error on your website' error. 

Follow the following steps to deactivate the plugins. 

2.2.1. Navigate to the /wp-content Folder

To connect to your site using FTP, please see the first two steps of previous step. 

Once you are connected to your site, please navigate to /wp-content folder inside the /public-html folder. 

2.2.2. Rename the Plugin's Folder

Double click to open the /wp-content folder. Inside it, you'll find the /plugins folder. The easiest way to deactivate all the plugins at once is by renaming the /plugins folder. 

WordPress searches for the plugins folder to load the activated plugins on your site. If it cannot locate the plugins folder, it cannot activate the plugins and deactivates them immediately.

To rename the plugins folder, right-click on it and select the 'Rename' option from the list. You can rename it to whatever text you want. For example, I am setting it as 'plugins. deactivated'

Now you can visit your site to see if the error is resolved. In most cases, it will solve the problem and you can reactivate the plugins one by one to find the culprit. 

Once you find the culprit, you can delete it and use its alternative. Otherwise, you can also contact the plugin's support to fix the plugin's conflict.

Note: Don't forget to rename the plugins folder whether the error is resolved or not. Otherwise, you won't be able to reactivate the plugins one by one. 

Please continue to read if this step also didn't help you solve the error. 

2.3. Reinstall WordPress

The third step to fix the critical error in WordPress is by reinstalling WordPress on your site. Please follow the following steps to reinstall WordPress. 

2.3.1. Download the WordPress File

First, you need to download the WordPress file from the official site. To download it, please navigate to wordpress.org and click the 'Download' button to download the WordPress file. 

2.3.2. Extract the WordPress File

Once you have downloaded the WordPress file on your computer, you need to extract it. To extract it, you need to install the WinRAR on your computer or If you are using Windows 11, you'll get it pre-installed. 

As I am using OS 11 so I'll simply right-click the downloaded file and extract it. 

2.3.3. Upload the File to Your Site

After extracting the folder, you need to upload it to your site to reinstall WordPress. 

To upload it, you need to connect to your site using FTP. Once you are connected, please navigate to the root folder of the downloadable file. To root folder is /wp-admin. 

You need to select it from the left panel and right-click it and select Upload to upload the folder to your site. 

Note: Ensure you are in the /public-html folder of your site. 

Once you click the Upload button, you'll see a popup asking you if you want to overwrite these files or skip them. You need to select the 'Overwrite' and 'Always Use This' option and finally click the OK button to upload the folder to reinstall the WordPress core files. 

Once the folder is uploaded, you can visit your site to see if the error is resolved. 

Doing this will resolve the error if a corrupt WordPress file or malware caused it. If the error persists, please continue to read. 

2.4. Increase the PHP Memory Limit

You can increase the PHP memory limit if none of the above methods worked. 

WordPress enforces a strict limit on the usage to prevent any PHP script from using up all your web server's RAM. A critical error or the white screen of death will appear when this threshold is passed.

By increasing the PHP memory limit, the WordPress 'There has been a critical error on this website error can be resolved. 

To increase the PHP limit, please follow the following steps. 

2.4.1. Edit the wp-config.php File

You need to edit the wp-config.php file. It is one of the WordPress core files. To edit it, you need to access the WordPress files using FTP or cPanel file manager. 

I have used the FTP throughout this tutorial and'll use it again. 

First, connect to your site using FTP and then navigate to the root folder of your site, which will probably be public_html. Inside the folder, you'll find the wp-config file. 

Right-click on it and select 'View/Edit' to edit the file. Once you click it, the file will automatically open in the default text editor of your computer. 

2.4.2. Increase the PHP Limit

Once the file is opened on your computer's editor, look for the line that says, 'That's all, stop editing! Happy blogging.'

After that, you need to paste the following code below that line. 

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

You can also try 256M if this doesn't fix the issue, but anything greater than that is probably unneeded unless the plugin documentation specifically calls for it.

Note: Please follow the Add Code Snippet to WordPress guide to learn more about adding code to WordPress. 

Once you save the plugin, it will automatically be uploaded to your site. Now, check your site to see if the error is resolved. 

If it persists, please continue to read. 

2.5. Upgrade Your PHP Version

You can upgrade your PHP version if the above methods don't help. If you're using an outdated version of PHP, there's a chance that your website will break, and additional issues will arise. 

Your website should typically run on the most recent version of PHP supported by WordPress, which ranges from PHP 7.3 to PHP 8.2.

Because they are concerned about theme and plugin compatibility, some WordPress users would remain on PHP 7.5 rather than upgrade. 

In most cases, this won't result in any issues. However, you must upgrade if you are utilizing PHP 5x because it can generate significant problems.

Because upgrading PHP is such a big task, you should ensure that you have a recent data backup before attempting the upgrade.

You can upgrade the PHP version from your Cpanel, or you can also contact your hosting provider for further assistance in upgrading the PHP version. 

It will fix the critical error on your site. 

Final Thoughts

That's it for today's article. 

I hope this article was helpful to you and you were able to fix the WordPress 'There Has Been a Critical Error on This Website' error. 

You can also try clearing your browser and site's cache sometimes, it also fixes the error. To put it more simply, here's the summary of the manual way to fix the error. 

  • Switch to a Default WordPress Theme
  • Deactivate all the Plugins
  • Reinstall WordPress
  • Increase the PHP Memory Limit
  • Upgrade Your PHP Version

Also, ensure a site backup before using any of the methods mentioned above.

Brian
Brian

Welcome to the AovUp blog, where we discuss all things WooCommerce. I hope we can help you achieve something today...

Leave a Reply

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

We – and our partners – use cookies to deliver our services and to show you ads. By using our website, you agree to the use of cookies as described in our Cookie Policy