Ffile2fix
Sign in Get started

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

There has been a critical error on this website. Please check your site admin email inbox for instructions.

This is WordPress's fatal error handler (added in 5.2): a plugin, theme or custom code caused a PHP fatal error, so WordPress shows a generic message instead of a broken page. It also emails the admin address a recovery mode link that lets you log in with the faulty plugin or theme paused.

Also appears as: There has been a critical error on this website. · There has been a critical error on this website. Learn more about troubleshooting WordPress. · Your Site is Experiencing a Technical Issue · There has been a critical error on your website.

Common causes

  • A plugin or theme update that is incompatible with your PHP or WordPress version
  • A PHP fatal error from a syntax error after editing theme files or snippets
  • PHP memory limit exhausted
  • Two plugins declaring the same function or class
  • Upgrading PHP (for example to 8.x) with outdated plugins that call removed functions
  • Corrupted or incomplete files after a failed update

How to fix it

  1. Use the recovery mode email. Check the inbox of the site admin email for a message titled 'Your Site is Experiencing a Technical Issue'. It names the plugin or theme and contains a recovery link that logs you in with it paused so you can deactivate or update it.
  2. Read the debug log. If no email arrived, add define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', false); to wp-config.php, reload the page and read wp-content/debug.log. The PHP Fatal error line names the file, usually under wp-content/plugins/ or wp-content/themes/.
  3. Disable the faulty plugin. Rename the plugin's folder over SFTP or the hosting file manager, or run wp plugin deactivate plugin-name with WP-CLI. Reload the site to confirm the error is gone.
  4. Switch theme if needed. If the error is in the theme, rename the active theme's folder or run wp theme activate twentytwentyfour. Then fix or roll back the theme change.
  5. Check PHP version and memory. If the error started after a PHP upgrade, temporarily switch back in the hosting panel and update the plugin. For memory errors, add define('WP_MEMORY_LIMIT', '256M'); to wp-config.php.
  6. Update or replace the code. Update the plugin or theme to its latest version, or roll back to the previous version. If it is abandoned, replace it with a maintained alternative.

wp-config.php (debugging and recovery email)

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

// Optional: send recovery mode emails to a different address
define( 'RECOVERY_MODE_EMAIL', '[email protected]' );

How to stop it happening again

  • Test updates on staging before applying them to production
  • Check the 'Requires PHP' value before installing plugins
  • Make sure the admin email address is valid and can receive mail
  • Keep backups that can be restored without logging in to wp-admin

Frequently asked questions

I did not receive the recovery email. What now?

Many servers cannot send mail, or the admin email is out of date. Use debug.log or the server error log instead, and fix the plugin or theme over SFTP.

Can I see the actual error instead of the generic message?

Yes. Enable WP_DEBUG_LOG to write it to wp-content/debug.log. Setting WP_DEBUG_DISPLAY to true shows it on screen, but do that only on staging.

How long does recovery mode last?

The recovery link is valid for a limited time, and the recovery session lasts until you exit recovery mode or it expires. It only pauses the extension for your session, so visitors still see the error until you fix it.