How To Resolve The “There has been a Critical Error on This Website” Error?

1 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 51 vote, average: 5.00 out of 5 (1 votes, average: 5.00 out of 5, rated)
Loading...
Critical Error on a Website

The “There has been a critical error on this website” error is a critical error in WordPress that means that the platform has encountered an issue that is preventing it from loading essential scripts required for proper functionality.

Previously, this would lead to fatal error messages or the infamous white screen of death, often perplexing novice users. But to help its users, WordPress now includes a feature to detect such errors and notify administrators via email.

In the email, the reason(s) because of which the problem is occurring (problem’s nature) is mentioned, such as – plugin or theme failures, database corruption, or memory insufficiency. The email also includes a recovery link that they can use to access the site in recovery mode to resolve the “There has been a critical error on this website” issue.

What Causes the “There has been a critical error on this website” WordPress Error?

The “There has been a critical error on this website” error commonly arises from malfunctioning plugins, scripts, code disrupting WordPress operations, memory limit being surpassed or database corruption. Copying and pasting code snippets from tutorials or conflicts with other plugins or custom code can also trigger this error.

How to Fix The Critical Website Error?

You can utilize the methods mentioned below to resolve the “There has been a critical error on this website” error. It is advised to initiate with the first one, and if it doesn’t work, try using the subsequent method, and so on.

  • Check Error Logs
  • Enable Debug in WP
  • Temporarily Swap to a Default WP Theme
  • Deactivate All the Plugins
  • Increase the PHP Memory Limit
  • Clear Site Cache
  • Scan for Malware

Let’s explore each method in-depth.

Method 1: Check Error Logs

First, examine the error log file. This log file documents – PHP error details that can aid you in identifying the cause of the error in the discussion. The error log file is accessible via FTP in the public_html folder.

Follow the steps mentioned below to check the error logs:

  • Connect to your site using File Transfer Protocol (FTP).
  • Navigate to the public_html folder.
  • Click the public_html folder if needed.
  • In the Filename column, click error_log.
  • Scroll to the bottom.
  • Read the latest error entry to identify the cause of the error.

Method 2: Enable Debug in WordPress

Modify the wp-config.php file in the public_html directory to activate the WP’s integrated debugging system. Enabling debug mode allows for identifying coding flaws within WordPress core, themes, and plugins, with errors logged in the wp-content folder.

Follow the steps mentioned below to enable debugging in WP:

  • Connect to your site using File Transfer Protocol (FTP).
  • Navigate to the root folder.
  • Double-click the root folder.
  • Open wp-config.php using a – text editor, like- Notedpad++.
  • Enter the below mentioned code at the document’s end before the final message:
    • define( ‘WP_DEBUG’, true );
    • define( ‘WP_DEBUG_DISPLAY’, false );
    • define( ‘WP_DEBUG_LOG’, true );

Note: Once debugging has been completed, remove the code. 

Method 3: Swap to a Default Theme

Switching to a default theme like Twenty Twenty-One temporarily can help determine if the critical error stems from theme conflicts. If your site functions correctly with a default theme, the issue likely lies within your previous theme.

All that you need to do to accomplish this is to download a fresh copy, delete existing themes, and upload the default theme.

Follow the steps mentioned below to swap to a default WP theme:

  • Connect to your site using File Transfer Protocol (FTP).
  •  Navigate to wp-content/themes.
  • Either rename your theme folder or delete it.
  • Click Search, placed on the taskbar.
  • Type Chrome and press Enter.
  • In the URL bar, type https://wordpress.org/themes/twentytwenty/.
  • Press Enter.
  • Click Download.
  • Unzip and extract the files from the twentytwenty.zip folder.
  • Copy the twentytwenty WP theme files and paste them into the themes folder.
  • If the site was appropriately loaded, it was a theme issue.

Method 4: Deactivate All the Plugins

Deactivate all plugins first. If the error vanishes, installed plugins are to blame. Now, reactivate them one by one. Keep monitoring your site after reactivating each of them.

If the WP site starts showing the “There has been a critical error on this website” error again, that particular plugin is the cause.

Follow the steps mentioned below to deactivate all the plugins:

  • Use your credentials to log into the WP console.
  • In the left pane, click Plugins.
  • From the list, click Installed Plugins.
  • The Installed Plugins window will open.
  • In the Installed Plugins window, check the checkbox at the top to select all the installed plugins simultaneously.
  • Click Bulk.
  • Click Actions.
  • Click Deactivate.
  • Verify whether the issue persists.
  • If not, click Activate to enable a single WP plugin. If activating it does not bring back the error, activate the other one.
  • If activating a particular error brings back the error in discussion, that’s the culprit.

Method 5: Raise the PHP Memory Limit

The web server has a specific amount of RAM. So, WP limits how much RAM a single PHP script can take up. When this limit is surpassed, you get greeted by the white screen of death or memory-related errors, such as the “There has been a critical error on this website” warning message.

To resolve this, increase the PHP memory limit and verify whether the issue persists.

Follow the steps mentioned below to raise the PHP memory limit:

  • Connect to your site using File Transfer Protocol (FTP).
  • Open wp-config.php using a – text editor, like- Notedpad++.
  • Enter the below mentioned code at the document’s end before the final message:
    • define( ‘WP_MEMORY_LIMIT’, ‘128M’ );
  • Verify whether the “There has been a critical error on this website” error persists.
  • If it does, try 256M. (define( ‘WP_MEMORY_LIMIT’, ‘256M’ );)

Method 6: Clear Site Cache

Corrupted cache files can give rise to the “There has been a critical error on this website” error. Clearing your site’s cache removes stale or corrupted cache files resolves the error in discussion and restores site functionality.

Follow the steps mentioned below to clear the site cache.

  • Use your credentials to log into your hosting dashboard.
  • Click Sites.
  • From the list, click Tools.
  • Click Clear Cache.
  • Reaccess the WP site.
  • Verify whether the issue persists.

Method 7: Check for Malware

Malware infections can compromise your site’s integrity and lead to critical errors, such as the “There has been a critical error on this website.”

Hence, conduct malware scans and remove any detected threats to restore the WP site’s stability. If unfamiliar PHP scripts are present, seek help from the web host to perform a thorough scan and remove malicious content.

Encountering the “There has been a critical error on this website” error on a WP site can be troublesome as well as alarming, but it can be resolved or fixed with the seven methods that are mentioned in this article.

But in adverse cases, if the above mentioned methods cannot resolve the error in the discussion, seek assistance from your web hosting provider.

Secure your website with Trusted SSL Certificates, Starts at Just $2.99/Yr!

~ Buy Now

Janki Mehta

Janki Mehta is a Cyber-Security Enthusiast who constantly updates herself with new advancements in the Web/Cyber Security niche. Along with theoretical knowledge, she also implements her practical expertise in day-to-day tasks and helps others to protect themselves from threats.

Buy Cheap Wildcard SSL