How to Resolve the Error Message “There Has Been a Critical Error on This Website” WordPress

You are here:
Estimated reading time: 3 min

This guide provides a solution to the “There Has Been a Critical Error on This Website” issue. The first step in fixing a major problem in WordPress is identifying its source. WordPress might describe the faulty file and code line, but if not, don’t worry.

The “Critical Error” in WordPress is a common issue that usually stems from plugin conflicts, theme issues, or PHP-related problems.

 

Here’s a step-by-step guide to fix the critical error in WordPress:

Step 1: Check Your Email for Error Details

When a “Critical Error” occurs, WordPress often sends an email to the admin email address with more details, including the specific plugin or theme causing the issue.

  1. Look for an email with the subject “Your Site is Experiencing a Technical Issue.”
  2. If the email provides the plugin or theme causing the error, you can directly disable it (details in the next steps).

If you didn’t receive the email or it doesn’t provide enough details, proceed with the following troubleshooting steps.

Error logs document various activities on your web server, including software or server issues. These logs contain important information about warnings, errors, and other server-related problems. By examining error logs, tech specialists can determine the root cause of serious faults on a WordPress website.

Here is how:

  1. First, sign into cPanel.
  2. In the “Files” section, select the “File Manager” sub-option.
  3. Go to the folder named “public_html.”
  4. Look for the “error_log” file.
  5. To read the contents of the “error_log” file, just perform a right-click and choose “Open.”
    Important note: You can use an FTP client like FileZilla if you don’t have cPanel.
  6. Locate the “public_html” folder by navigating to the directory where WordPress is installed. Next, look for files with the name “error_log.”
  7. Next, locate the error message along with the precise cause by opening the error log file.
  8. You can troubleshoot and resolve the mistake once you’ve identified it.

Step 2: Enable Debugging Mode in WordPress

  1. Access your website’s file system via FTP, cPanel, or your hosting provider’s file manager.
  2. Find the wp-config.php file in the root directory of your WordPress installation.
  3. Add the following lines right before the line that says /* That's all, stop editing! Happy publishing. */:
    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
    
  4. Save the changes and reload your website.
  5. WordPress will now generate a debug log at wp-content/debug.log. Check this file for any errors pointing to a specific theme, plugin, or function causing the issue.

Step 3: Disable All Plugins via FTP or cPanel

If you can’t access the WordPress dashboard, disabling plugins manually is the next step.

  1. Access your site’s files via FTP or cPanel.
  2. Navigate to the wp-content directory and find the plugins folder.
  3. Rename the plugins folder to something like plugins-deactivated. This will disable all plugins on your site.
  4. Check if the critical error is resolved by reloading your website.
    • If the error is resolved, one of the plugins is causing the issue.
    • You can reactivate plugins one by one via the WordPress dashboard or by renaming the plugins-deactivated folder back to plugins and then renaming individual plugin folders to pinpoint the problematic one.

Step 4: Switch to a Default WordPress Theme

If the issue persists, the theme might be causing the critical error. To switch to a default theme:

  1. Still in FTP or cPanel, go to the wp-content/themes/ directory.
  2. Rename your active theme folder (for example, if using twentytwenty, rename it to twentytwenty-old).
  3. WordPress will automatically switch to a default theme like twentytwentyone if it is available.
  4. Check if the error is resolved.

If you don’t have a default theme installed, you can download one from the WordPress Themes Repository and upload it via FTP to the wp-content/themes/ directory.

Step 5: Increase PHP Memory Limit

Sometimes, a low PHP memory limit can cause critical errors in WordPress.

  1. Open the wp-config.php file via FTP or cPanel.
  2. Add the following line right before the line /* That's all, stop editing! Happy publishing. */:
    define( 'WP_MEMORY_LIMIT', '256M' );
    
  3. Save the file and reload your website.

If increasing the memory limit fixes the issue, it indicates that your website was running out of memory. You may want to check resource usage or optimize the website.

Step 6: Reinstall WordPress Core Files

If none of the above steps work, there might be an issue with the core WordPress files.

  1. Download a fresh copy of WordPress from wordpress.org.
  2. Extract the files on your local computer.
  3. Using FTP or cPanel, upload the contents of the wordpress folder to your website’s root directory.
    • Do not overwrite the wp-content folder or the wp-config.php file.
    • Only replace the core WordPress files.
  4. Once the upload is complete, check if the error is resolved.

Step 7: Contact Your Hosting Provider

If the issue still isn’t resolved, it may be related to server settings or configurations. Contact your hosting provider’s support for further assistance. They can check server logs, file permissions, and other server-related issues that may be causing the error.

Step 8: Restore from Backup

If all else fails and you have a recent backup of your site, restoring the backup might be the fastest way to resolve the issue. Use your backup plugin or hosting provider’s backup feature to revert to a previous working version of the site.

By following these steps, you should be able to resolve the “Critical Error” in WordPress and get your website back online.

That is it! Hope you liked our article. However, if you face any difficulty, feel free to contact our support staff.

Was this article helpful?
Dislike 0

Author

Joshua

Web Hosting Geek Technical Support Staff G Online Sites