How to Fix "There has been a critical error on this website" in WordPress

Introduction

The "There has been a critical error on this website" message in WordPress usually appears when something breaks in the backend, most commonly due to a faulty plugin, theme conflict, or an outdated PHP version.

Here is a step-by-step guide to troubleshoot and resolve this error quickly:

Step 1: Enable WordPress Debug Mode

To find the exact cause of the error, you need to see the actual error message instead of the generic warning.

  1. Log in to your cPanel and open File Manager.
  2. Navigate to your website's root directory (e.g., public_html).
  3. Find the wp-config.php file, right-click it, and select Edit.
  4. Scroll down to find the line that says:
    define( 'WP_DEBUG', false );
  5. Change it to true by editing it like this:

    PHP
     
    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_DISPLAY', true );
    
  6. Save changes and refresh your website. The specific error or conflicting plugin/file name will now appear on the screen.

Step 2: Check for Problematic Plugins or Themes

Most of the time, a newly updated plugin or theme causes this crash.

  1. Go to your cPanel File Manager and open public_html/wp-content.
  2. Rename the plugins folder to plugins_backup.
  3. Check your website:

    • If the site starts working, it means one of your plugins is causing the issue. Rename the folder back to plugins, then go inside the folder and rename each plugin folder one by one to find the culprit.
  4. If plugins are fine, check your active theme inside the wp-content/themes folder and temporarily rename it to switch back to a default WordPress theme (like Twenty Twenty-Four).

Step 3: Update PHP Version

WordPress requires a stable and updated PHP version (such as PHP 8.1 or 8.2).

  1. Log in to your cPanel and search for Select PHP Version or MultiPHP Manager.
  2. Ensure your domain is running on a recommended, updated PHP version. If it's running on an older version (like 7.4), upgrade it to fix compatibility issues.

Conclusion

Once you fix the conflicting plugin/theme or adjust your PHP version, don't forget to revert your wp-config.php debug mode back to false for security purposes. If you need further assistance, feel free to open a support ticket with our HostBreak team!
Was this answer helpful? 0 Users Found This Useful (0 Votes)