WordPress shows "There has been a critical error" or a white screen

Before changing anything

Back up the website files and database if you can.

A critical error or white screen usually means PHP stopped while processing the page. Common causes include:

  • A broken or incompatible plugin
  • A theme error
  • An unsupported PHP version
  • A failed update
  • Missing PHP files
  • Exhausted memory
  • Custom-code errors

Check for a WordPress recovery email

WordPress may email a recovery link to the site administrator. Check the administrator inbox, spam or junk folders, and any mailbox previously used for the website.

The recovery link may let you sign in while the faulty plugin or theme is paused.

Check what changed

Think about what happened immediately before the error:

  • Was a plugin or theme updated?
  • Was WordPress updated?
  • Did the PHP version change?
  • Were files uploaded or edited?
  • Was the site moved?
  • Was a new plugin installed?

Reverse the most recent change first where possible.

Enable the WordPress debug log

Open wp-config.php and find:

/* That's all, stop editing! Happy publishing. */

Add these lines immediately above it:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors', 0);

Reload the broken page, then check wp-content/debug.log.

Disable debugging when you finish:

define('WP_DEBUG', false);

Do not leave public error display enabled on a live website. Logs can contain file paths and other sensitive information.

Disable the suspected plugin

  1. Open File Manager.
  2. Go to public_html/wp-content/plugins.
  3. Rename the suspected plugin folder.
  4. Reload the website.

If you do not know which plugin failed, rename the plugins folder to plugins-disabled. This disables all plugins. If the site starts working, restore the folder name and activate plugins one at a time to find the cause.

Test the active theme

  1. Open public_html/wp-content/themes.
  2. Rename the active theme's folder.
  3. Reload the website.

WordPress can fall back only if another working theme is installed. Restore the folder name if this does not help.

Check the PHP version

A plugin or theme may not support the selected PHP version.

  1. Record the current version.
  2. Restore the version that worked previously.
  3. Test the website.
  4. Review the error log.
  5. Update or replace incompatible software.

See How to change my PHP version and PHP settings.

Check the memory limit

A memory error normally contains text such as:

Allowed memory size exhausted

Review the PHP memory_limit, but do not increase it blindly. A plugin consuming excessive memory may need to be repaired or replaced.

The hosting account's default total memory limit is 2 GB. PHP settings cannot override the account's resource limits.

Clear website caches

After fixing the cause:

  1. Clear the WordPress cache.
  2. Clear any LiteSpeed Cache.
  3. Clear your browser cache.
  4. Test in a private window.

Restore a clean backup if necessary

If files were damaged during an update or edit, restoring a known-good backup may be safer than repairing individual files.

Do not restore over the current site until you have preserved a copy of its files and database.

Still stuck?

Open a support ticket and include:

  • Your domain name
  • Whether the error affects the whole site or one page
  • The date and approximate time it began
  • What changed immediately before it began
  • Your current PHP version
  • The relevant entries from wp-content/debug.log
  • Any plugin or theme folders you renamed
  • A screenshot of the error

Did this answer it?