The WordPress critical error ("There has been a critical error on this website") and the blank white screen are stressful, but almost always fixable. This guide goes from the safest steps to the more technical ones. Stop as soon as your site comes back.

Before you touch anything

  1. Take a backup. If your host has a backup tool, use it. If you can reach your files, copy the wp-content folder and export the database.
  2. Check your email. WordPress often sends a message to the admin address with a special recovery link that lets you log in and deactivate the broken plugin.
  3. Note what changed. Did you update a plugin, change a theme, edit code or switch the PHP version just before it broke? That is your main clue.

Step 1: Turn on the error log

The error log tells you the exact file causing trouble. In your wp-config.php file, add these lines above the comment that says "That's all, stop editing":

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

Reload the site, then open wp-content/debug.log. The message usually names a plugin or theme folder. Remember to set WP_DEBUG back to false when you are done.

Step 2: Deactivate all plugins

If you cannot log in, use your host's file manager or FTP:

  1. Open wp-content.
  2. Rename the plugins folder to plugins-off.
  3. Reload your site.

If it works again, a plugin is the cause. Rename the folder back to plugins, then reactivate plugins one by one from the dashboard until the problem returns. The last one you activated is the culprit.

Step 3: Switch to a default theme

If plugins were not the problem, rename your active theme's folder inside wp-content/themes. WordPress will fall back to a default theme such as Twenty Twenty-Four if one is installed. If the site loads, the issue is in your theme or in custom code you added to functions.php.

Step 4: Check the PHP version

Many critical errors come from a plugin or theme that is not compatible with the PHP version your host runs. In your hosting control panel, look for the PHP version setting. Try moving one version down or up and reload. Use a version that is still supported, and ask the plugin author if you are unsure.

Step 5: Increase the memory limit

A site that runs out of memory can show a white screen. In wp-config.php add:

define( 'WP_MEMORY_LIMIT', '256M' );

If this fixes it, find out why the site needs so much memory. A heavy plugin or an unoptimised page builder is the usual reason.

Step 6: Repair the .htaccess file (500 error)

For an "Internal Server Error", rename .htaccess to .htaccess-old and reload. If the site comes back, log in and go to Settings, then Permalinks, and click Save to generate a clean file.

"Error establishing a database connection"

This is a different problem: WordPress cannot talk to its database. Check these in order:

  • Credentials. The database name, username, password and host in wp-config.php must match what your host shows.
  • Your hosting. Ask the host whether the database server is down or the account has hit a limit.
  • Corrupted tables. Add define( 'WP_ALLOW_REPAIR', true ); to wp-config.php, visit /wp-admin/maint/repair.php, run the repair, then remove the line straight away, because that page does not require a login.

When to stop and call someone

Get help if:

  • You see unfamiliar admin users, strange redirects or spam pages.
  • The error log mentions files you do not recognise.
  • You have no backup and cannot reach the files.
  • The site earns money and every hour counts.

A professional can usually find the cause quickly from the error log. Our WordPress bug fixing service covers this exactly, and you can send us the error message for an honest first opinion.

How to avoid it next time

  • Update plugins one at a time, not all at once.
  • Test updates on a staging copy first.
  • Keep automatic daily backups stored away from your hosting account.
  • Delete plugins and themes you no longer use.
  • Read our guide on how to speed up a WordPress website, because lighter sites also break less often.