There Has Been a Critical Error on Your Website

How to Fix the “There Has Been a Critical Error on Your Website” Error

Facing errors is a common incident, and one of the most frustrating messages is the “There has been a critical error on your website” error. This error can leave website owners and administrators feeling helpless and unsure of what to do next to solve it. In this article, we will explore the causes of this error and provide step-by-step, proven solutions to fix it promptly.

What is the “There Has Been a Critical Error on Your Website” Message?

The “There has been a critical error on your website” message appears on WordPress websites when an issue arises that prevents the site from functioning correctly. This error is distinct from other common WordPress mistakes, and it usually results in the website becoming inaccessible.

Causes of the “Critical Error”

Several factors can trigger the “There has been a critical error on your website” message on your website. Some of the common causes include:

  • Plugin Incompatibility
  • Theme Issues
  • Memory Limit
  • PHP Compatibility
  • Site Cache
  • Debug in WordPress
  • Malware

Troubleshooting and Fixing the “Critical Error”

When faced with the “There has been a critical error on your website” message, it’s essential to act swiftly and follow a systematic method to resolve the “critical error” issue. This section will guide you through a simple, step-by-step process to fix the critical error on your WordPress website.

Identifying the Problematic Plugin

 Deactivate All plugins.

Step-1 The first step is to access your website’s files through the File Manager. 

Step-2 Locate the File Manager in the Files section.

 Step-3  Next, locate public_html, click on it, and select the “wp-content” folder.

 Step-4 In the “wp-content” folder, locate the “plugins” folder and rename it something like “plugins-deactivated.”

 This action will deactivate all plugins on your website.

Another Way to Deactivate Plugins: You can easily deactivate your plugins by using the WordPress Dashboard.

Step-1 Login to your WordPress admin and locate plugins.

Step-2 Next, select the installed plugins and tick the checkbox at the top of the plugins list.

Step-3 Then Click Bulk Actions, then select Deactivate, and then apply.

Reactivate Plugins One by One:

Reactivate the plugins one by one, starting with the essential ones. After activating each plugin, check your website to see if the critical error returns. If it does, you have likely found the problematic plugin causing the issue.

Theme Compatibility Check

Switch to a Default Theme: If the critical error persists even after deactivating the plugins, You need to check the theme compatibility issue. Temporarily activate a default WordPress theme, such as “Twenty Twenty-One” or any other default theme provided by WordPress.

If the default theme resolves the critical error, it indicates that your previous theme may have compatibility issues. 

In that case, you need to update your previous theme to the latest version. If updates are not available or the issue persists, switch to a different theme compatible with your current version of WordPress.

Increase the PHP memory limit.

To increase the memory limit, you need to edit the `wp-config.php` File:

Access your website’s root directory through FTP or the File Manager. (To go to public_html, follow the above “deactivate plugins” steps; you just have to go to public_html, and after that, you will see the wp-config.php folder.)

`wp-config.php` file. Open it using a text editor and add the following line just before the “That’s all, stop editing!” line:

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

This will increase the memory limit of your WordPress website to 256MB. Increasing the memory limit can help prevent critical memory-related critical errors.

PHP Version Update

If your WordPress website is running an Older version of PHP, then you need to update it to the latest PHP version supported by WordPress. Running an older PHP version can cause compatibility issues and security vulnerabilities, leading to critical errors.

If you do not know how to change the PHP version, checkout – How to Change PHP Version in cPanel

Clear Your Site Cache

Sometimes, caching plugins or server caching can interfere with your website’s functionality and cause critical errors. Clear your website’s cache to eliminate any caching-related issues.

Enable Debug in WordPress

WordPress comes with its own debugging system, where you can easily identify code errors in themes, plugins and core software

To Activate Debug Mode: Enabling the WordPress debug mode can provide more detailed error information. 

To do this, open the `wp-config.php` file again and find the line that says “That’s all, stop editing! Happy publishing” – Just before this line, go ahead and add the following code:

define(‘WP_DEBUG’, false);`. Change “false” to “true” to enable the debug mode.

define( 'WP_DEBUG', false );
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', false );
define( 'SCRIPT_DEBUG', false );

The “false” values mean that WordPress debug mode is deactivated. Replace “false” with “true” on all lines to activate it.

Scan for Malware

Malware can also trigger critical errors, especially if unfamiliar PHP scripts appear without a trace of their source. Removing unwanted malware scripts becomes more challenging, particularly when you’re locked out of your website and can’t perform a scan. 

It’s too difficult to differentiate between legitimate and suspicious files can be tough, and deleting core files randomly can cause further issues. Malicious code may also hide within PHP files, making it hard to detect for non-developers. In such cases, seek assistance from your web host, such as Hostbet, offers best shared hosting in India and Best Alternatives Of Hostinger Hosting

You may also consider these other WordPress errors,

FAQ Section on There has been a critical error on your website

What causes There has been a critical error on your website?

Several factors can trigger the “There has been a critical error on your website” message on your website. Some of the common causes include:

Plugin Incompatibility
Theme Issues
Memory Limit
PHP Compatibility
Site Cache
Debug in WordPress
Error Logs

How to resolve There has been a critical error on your website?

Troubleshooting and Fixing the ” There has been a critical error on your website”
Deactivate All the Plugins.
Enable Debug in WordPress.
Switch to a Default Theme.
Increase PHP Memory Limit.
Check for Malware.

What happens if I don’t update my PHP version?

Running an outdated PHP version can lead to security vulnerabilities and compatibility problems. It’s crucial to keep PHP up to date.

Can a single faulty plugin cause the critical error

Yes, a single plugin with compatibility issues can lead to a critical error. Deactivating and reactivating plugins will help pinpoint the problematic ones.

Exit mobile version