Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Fix "There Has Been a Critical Error on Your Website"

This guide helps you fix a WordPress error message. You will find the cause and get your site back.

Domains and DNS2 min read9 steps

What does this error mean?

WordPress is a popular tool for building websites. This message means that some code in your site broke. Most often a plugin (an add-on) or a theme (the site's design) is the cause. Sometimes the PHP version is too old or too new. PHP is the language WordPress is written in.

Warning: Take a backup before you change files. A backup is a saved copy of your site you can restore later.

Step 1: Check your email

WordPress often sends a message to the admin email. It names the plugin or theme that failed. It may also include a special link to log in safely. Look in your inbox and spam folder.

Step 2: Turn off all plugins

If you cannot log in, use a file tool. File Manager in cPanel works well.

  1. Log in to your hosting control panel and open File Manager.
  2. Open the folder public_html, then wp-content.
  3. Right-click the folder named plugins and choose Rename.
  4. Change the name to plugins-off.
  5. Reload your website.

If the site comes back, one plugin is the cause. Rename the folder back to plugins. Then rename the plugin folders inside, one by one, to find the bad one. Reload the site after each change.

Step 3: Switch to a default theme

  1. In File Manager, open wp-content/themes.
  2. Rename the folder of your active theme, for example add -off at the end.
  3. WordPress then falls back to a default theme, if one is installed.
  4. Reload the site.

Step 4: Turn on error messages

Open the file wp-config.php in the main WordPress folder. Find the line that says WP_DEBUG. Change it so it reads:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );

This writes errors into a file called debug.log inside wp-content. Open that file to see which file and line failed. Set WP_DEBUG back to false when you finish.

Step 5: Check the PHP version

In your control panel, look for a tool such as Select PHP Version or MultiPHP Manager. Try a different PHP version. Pick one your plugins support.

Tip: Also check that your hosting space is not full. A full disk can break a site too.

Cannot find the cause? Open a support ticket and include the text from your debug log.

Quick recap

  • The error means some code in WordPress failed.
  • Read the email WordPress sent you.
  • Rename the plugins folder to turn off all plugins.
  • Test a default theme and a different PHP version.
  • Use the debug log to find the exact fault.