Security, speed and SEO

How to Fix Common WordPress Errors

Plain-English fixes for the critical error message, the white screen, 500 errors, database connection errors, memory errors and more.

In short

  • Most WordPress errors are caused by a plugin or theme; deactivating it usually fixes the site.
  • Since WordPress 5.2, a fatal error triggers an email to the admin address with a link to recovery mode.
  • You can deactivate all plugins without logging in by renaming the wp-content/plugins folder by FTP.
  • A stuck "Briefly unavailable for scheduled maintenance" message is fixed by deleting the .maintenance file.

Before you start

Don't panic, and don't start deleting things. Note exactly what the error says and what you changed just before it appeared (a plugin update? a new theme?). If you have a recent backup, you can always fall back to it. You'll need access to your hosting control panel or FTP for some fixes.

"There has been a critical error on this website"

This is WordPress's fatal error protection, added in version 5.2. Visitors see a message that the site is experiencing technical difficulties, and WordPress emails the site's admin address with details of the problem and a secret link to recovery mode.

  1. Check the admin email inbox (and spam folder) for the message from WordPress.
  2. Click the recovery mode link and log in. WordPress shows which plugin or theme caused the error.
  3. Deactivate it, then look for an update or contact its developer with the error details.

No email? Turn on debugging (below) or deactivate plugins by FTP.

The white screen of death

A completely blank page usually means a PHP error with error display turned off. WordPress's documentation suggests deactivating plugins or switching theme. If you can't reach the dashboard:

  • Plugins: by FTP or File Manager, rename wp-content/plugins to plugins_old. All plugins are deactivated. Rename it back, then reactivate plugins one at a time to find the culprit.
  • Theme: rename your active theme's folder in wp-content/themes. WordPress falls back to a default theme, if one is installed.

500 Internal Server Error

Try these in order: rename .htaccess to .htaccess_old and then re-save Settings › Permalinks to create a fresh one; deactivate plugins; switch to a default theme; increase the PHP memory limit; or re-upload the wp-admin and wp-includes folders from a fresh copy of WordPress.

"Error establishing a database connection"

WordPress can't reach its database. Check the database name, username, password and host in wp-config.php match the details in your hosting panel. If they're right, contact your host: the database server may be down or over its limits.

"Allowed memory size exhausted"

A plugin or theme needed more memory than PHP allows. Increase the limit in wp-config.php, for example define( 'WP_MEMORY_LIMIT', '256M' );, or ask your host to raise PHP's memory_limit.

"Briefly unavailable for scheduled maintenance"

An update was interrupted. Delete the .maintenance file from your WordPress folder with FTP or File Manager (turn on hidden files to see it). Then run the update again from Dashboard › Updates.

Pages show "Not Found" (404) but the home page works

Go to Settings › Permalinks and click Save Changes without changing anything: this rebuilds the rewrite rules. On Apache, the server's mod_rewrite module must be enabled, and the .htaccess file must exist.

How do you turn on WordPress debugging?

Add these lines to wp-config.php, above "That's all, stop editing!", to record errors in wp-content/debug.log without showing them to visitors:

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

Turn debugging off again (set WP_DEBUG to false) when you've finished.

Where to go next

Prevent the next problem with a safe update routine and regular backups. Still stuck? Ask us a question.

Questions and answers

What should I do if a plugin update breaks my site?

Check the admin email inbox for WordPress's recovery mode email, use the link to log in, and deactivate the plugin. With no email, rename the plugin's folder in /wp-content/plugins/ by FTP. How to fix common errors.

How do I fix "There has been a critical error on this website"?

Look for the email WordPress sends to the site's admin address. It names the problem and includes a link to recovery mode, where you can deactivate the plugin or theme causing it. Step-by-step fixes.

Sources and further reading

  1. Common WordPress errors – WordPress Advanced Administration Handbook
  2. WordPress 5.2 fatal error recovery mode – Make WordPress Core

Didn't find your answer?

Ask us anything about WordPress or the theme builder. We answer the most useful questions here, so others can benefit too.

We may publish your question (never your name or email) with an answer. See our privacy policy.

One useful WordPress tip a week

Short, practical and free. Unsubscribe whenever you like.