Maintenance

There Has Been a Critical Error on This Website (WordPress): 7 Fixes

Fix "There has been a critical error on this website" in WordPress: use the recovery email, read debug.log or disable plugins by File Manager.

There Has Been a Critical Error on This Website (WordPress): 7 Fixes
On this page
  1. What the critical error actually means
  2. Common causes, and the clue that points to each
  3. Before you change anything
  4. Step 1: Use the recovery mode email
  5. Step 2: Read the real error with WP_DEBUG_LOG
  6. Step 3: Disable plugins through File Manager or SFTP
  7. Step 4: Switch to a default theme
  8. Step 5: Critical error after a PHP update? Check the PHP version and memory limit
  9. Step 6: Restore a backup if you can't find the cause
  10. After the fix: a short check, and how to stop it coming back
  11. When to get help
  12. FAQs
Key takeaways
  • A WordPress fatal error is what triggers "There has been a critical error on this website", usually from a plugin, theme, PHP version change or memory limit; your content is almost always safe.
  • Start with the recovery mode email WordPress sends to the admin address; if it never arrives, turn on WP_DEBUG_LOG and read the fatal error in wp-content/debug.log.
  • No log access? Rename the plugins folder in File Manager or SFTP to find the culprit, switch to a default theme, then check PHP version and memory before restoring a backup.

"There has been a critical error on this website" means PHP hit a fatal error, usually from a plugin, a theme or a PHP version change. Use the recovery mode link WordPress emails to the admin address to deactivate what it names; with no email, read debug.log or rename the plugins folder in File Manager.

Quick fix (5 steps):

  1. Check the admin email inbox for the WordPress "recovery mode" link, log in through it and deactivate the plugin or theme it names.
  2. No email? Turn on WP_DEBUG and WP_DEBUG_LOG in wp-config.php and read wp-content/debug.log to see which file failed.
  3. Rename the wp-content/plugins folder in your host's File Manager to switch off every plugin, then rename it back and reactivate them one by one.
  4. Switch to a default theme such as Twenty Twenty-Five by renaming your active theme's folder.
  5. Raise the PHP memory limit (for example define('WP_MEMORY_LIMIT', '256M');) or roll back the PHP version in your hosting panel if the error started after a PHP upgrade.
Short answer: The WordPress critical error is a safe wrapper around a PHP fatal error, almost always caused by a plugin, theme, PHP version change or memory limit. Your pages, posts and orders are in the database and are almost always untouched. Use the recovery email, read debug.log, then disable the plugin or theme the error names.

What the critical error actually means

Since version 5.2, WordPress has a feature called fatal error protection. When a plugin, theme or custom code triggers a PHP fatal error, WordPress catches it and shows a short message instead of a blank screen. Visitors see "There has been a critical error on this website", usually with a link to WordPress's troubleshooting guide. If you're logged in or on the admin side, it adds "Please check your site admin email inbox for instructions."

At the same moment, WordPress tries to email the administration address set in Settings > General. That email names the plugin or theme involved and contains a special recovery mode link. Older sites, or sites where the protection is switched off, may show a completely blank page instead; that's covered in the WordPress white screen of death, and the fixes overlap heavily.

Common causes, and the clue that points to each

CauseTypical clueFirst fix
A plugin updateError started right after updating; the email or log names a file in wp-content/pluginsDeactivate or roll back that plugin
A theme update or theme switchLog names a file in wp-content/themes, often functions.phpSwitch to a default theme, then fix or roll back
PHP version change by you or your hostErrors such as "Call to undefined function" across several plugins at onceSwitch back to the previous PHP version, then update the old code
Memory limit exhausted"Allowed memory size of ... bytes exhausted"Raise the limit and find the heavy plugin
A code edit or snippet"syntax error, unexpected ..." in functions.php or a snippets pluginUndo the edit over File Manager or SFTP
An interrupted update"Failed opening required" or "No such file or directory"Reinstall the plugin, theme or core files
Missing PHP extension"Class ... not found" for something like ZipArchive or an mb_ functionEnable the extension in the hosting panel
Malware or modified filesUnfamiliar file names in the log, odd code at the top of filesTreat it as a hack, not just an error

Need this fixed? Samverse can do it. See WordPress maintenance and support for what is included, or message Samverse on WhatsApp with your site address for a fixed quote.

Before you change anything

  • Note what changed in the last day or two: updates, a new plugin, a code edit, a PHP switch or a hosting move. The most recent change is the most likely cause.
  • Check whether wp-admin also fails. If yourdomain.com/wp-admin still loads, you can often fix it from the dashboard.
  • Take a backup if you can from your hosting panel, and don't keep clicking update or reinstalling WordPress. Random changes make the real cause harder to find.

Step 1: Use the recovery mode email

Look in the inbox of the site's administration email for a message with a subject like "Your Site is Experiencing a Technical Issue". It explains which plugin or theme caused the error, often with the file and line number, and includes a link to log in to recovery mode.

  1. Click the recovery mode link and log in as normal.
  2. WordPress pauses the faulty plugin or theme for your session only, so you can reach the dashboard while visitors still see the error.
  3. Go to Plugins (or Appearance > Themes) and deactivate the extension named in the email.
  4. Click "Exit Recovery Mode" in the admin bar and check the site in a private window.

The link expires after a while, so use it promptly. If the email never arrives, the admin address may be old or a former developer's, the message may be in spam, or the site may not send email reliably; see fixing WordPress emails with SMTP. A line in wp-config.php can send future recovery emails to a different address:

define( 'RECOVERY_MODE_EMAIL', 'you@yourdomain.com' );
Fix WordPress critical error: recovery mode Plugins screen with a plugin paused during recovery mode
Step 1: From the recovery mode link, open Plugins, deactivate the paused plugin, then click Exit Recovery Mode.

Step 2: Read the real error with WP_DEBUG_LOG

If there's no email, the error log tells you exactly what failed. Open wp-config.php in your host's File Manager or over SFTP, and add these lines above the one that says "That's all, stop editing!", replacing any existing WP_DEBUG line:

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

Reload the broken page, then open wp-content/debug.log. Look for the most recent line that starts with "PHP Fatal error". It will look something like this:

PHP Fatal error:  Uncaught Error: Call to undefined function create_function()
in /home/u123456/public_html/wp-content/plugins/old-slider/slider.php:42

The path tells you where the problem is: here, a plugin folder called old-slider, using a PHP function that was removed in PHP 8. Many hosting panels also have their own error log, under a name like Errors or Logs.

Message in the logWhat it usually means
Allowed memory size of 268435456 bytes exhaustedPHP ran out of memory; a heavy plugin, import or loop
Call to undefined functionCode written for an older PHP version, a missing extension, or a plugin that depends on another plugin you deactivated
syntax error, unexpectedA typo in code someone edited or pasted
Cannot redeclareThe same function loaded twice, often a snippet pasted twice or two plugins clashing
Failed opening requiredA file is missing, usually after an interrupted update

When you're done, set WP_DEBUG back to false and delete debug.log. By default that file sits in a public folder, and it can reveal file paths and other details about your site.

Fix WordPress critical error: wp-config.php in File Manager with WP_DEBUG, WP_DEBUG_LOG and WP_DEBUG_DISPLAY lines
Step 2: In File Manager, add the WP_DEBUG lines to wp-config.php above the "stop editing" comment, then save.

Step 3: Disable plugins through File Manager or SFTP

If you can't read the log, disable plugins at file level. This doesn't delete any plugin settings.

  1. Open your hosting File Manager (hPanel and cPanel both have one) or connect with an SFTP app such as FileZilla.
  2. Go to public_html/wp-content, or wherever WordPress is installed.
  3. Rename the plugins folder to plugins-off. WordPress can no longer find any plugins, so none of them load.
  4. Reload the site. If it works, a plugin is the cause.
  5. Rename the folder back to plugins. WordPress may now show your plugins as deactivated.
  6. Reactivate them one at a time, starting with the one updated most recently, and reload the site after each. When the error returns, you've found it.

If the email or log already named a plugin, just rename that plugin's folder. Also check wp-content/mu-plugins, whose "must-use" plugins load automatically. With SSH access, WP-CLI does the same job without loading the broken code:

wp plugin list --skip-plugins --skip-themes
wp plugin deactivate old-slider --skip-plugins --skip-themes

When the cause is two plugins that work alone but clash together, finding and fixing plugin conflicts walks through the narrowing-down process.

Step 4: Switch to a default theme

If plugins aren't the cause, test the theme. In wp-content/themes, rename your active theme's folder, for example to astra-off. WordPress then falls back to a default theme such as Twenty Twenty-Five, if one is installed; if none is, upload one from WordPress.org first. On a child theme, check the child's functions.php, where copied snippets usually end up. Then roll back the update, undo the edit or ask the theme's developer for a fix.

Step 5: Critical error after a PHP update? Check the PHP version and memory limit

If the error appeared after a PHP upgrade, or affects several plugins at once, look at the server settings. Once you can reach the dashboard, Tools > Site Health > Info > Server shows the PHP version and PHP memory limit.

  • PHP version: in Hostinger's hPanel this is under the website's Advanced > PHP Configuration at the time of writing; on cPanel hosts look for "Select PHP Version" or "MultiPHP Manager". Switching back to the previous version usually takes effect immediately and buys time to update or replace the old plugin. Updating your PHP version safely explains how to move forward properly.
  • Memory: WordPress can ask for more memory with a line in wp-config.php, but it can't go above the server's own memory_limit, which is set in the hosting panel's PHP options. If raising the limit only delays the error, a plugin is using far more than it should.
define( 'WP_MEMORY_LIMIT', '256M' );

For the full set of memory fixes, see how to fix "Allowed memory size exhausted" errors.

Step 6: Restore a backup if you can't find the cause

If the site needs to be online and you can't pin down the cause quickly, restore the latest backup taken before the error started, then investigate on a staging copy. On a WooCommerce store, a full restore also removes orders placed since that backup, so restore the files only or roll back the single plugin where you can. The backup and restore guide covers both methods.

After the fix: a short check, and how to stop it coming back

  1. Log in to wp-admin and open Tools > Site Health. Fix anything under "Critical issues", such as an outdated PHP version or a failed loopback request.
  2. Open the homepage, a service page, a blog post, the contact form and, on a store, the cart and checkout. Submit one test enquiry or order.
  3. Check wp-content/debug.log again for new fatal errors, then set WP_DEBUG back to false so the log stops growing.
  4. Update the plugin that caused the error, or replace it if it hasn't been updated for a long time.
  5. From now on, update plugins one at a time, test PHP upgrades on a staging copy first, and keep a backup taken just before each update.

What I check on client sites: the exact line in debug.log, the plugin and PHP versions involved, whether a backup from before the error exists, and whether the same plugin causes problems on staging.

No recovery email? It goes to the address in Settings > General > Administration Email Address, which is often an old developer's inbox. If you can reach wp-admin, update it; WordPress only switches after you confirm the new address.

When to get help

Get help if the error returns after every update, the log points to core files or files you don't recognise, you have no recent backup, or it's a store losing orders. My WordPress maintenance plans take a backup before every update, test key pages afterwards and roll back anything that breaks. You can also send the details through the contact form.

Related fixes: Elementor not saving changes, featured image not showing and the "Updating failed" error in WordPress.

FAQs

Is my content lost when WordPress shows a critical error?

Almost never. The error comes from PHP code, not the database. Once the faulty code is disabled or fixed, the content reappears exactly as it was.

Why does the critical error appear after updating WordPress or PHP?

Because an old plugin or theme uses code the new version no longer supports, or two updated plugins now clash. The fix is to identify that plugin from the email or log, then update, roll back or replace it.

The critical error only shows in wp-admin or on one page. Why?

The faulty code only runs there: a plugin's settings screen, the editor, or a shortcode, widget or form on that one page. The same steps apply. Check the log or the recovery email, then disable the plugin responsible.

Can a hack cause "There has been a critical error"?

Occasionally. Malware can corrupt files or inject broken code. If the log names files you don't recognise, or the error keeps returning after a clean reinstall of plugins, treat it as a possible hack and clean the site rather than just restoring it; see hacked site repair.

How do I fix the WordPress critical error without access to wp-admin?

Use the recovery mode link from the admin email if it arrived. If not, open File Manager or SFTP, rename wp-content/plugins to plugins-off to disable every plugin, then rename it back and reactivate plugins one by one.

How do I find which plugin is causing the WordPress critical error?

Turn on WP_DEBUG_LOG and open wp-content/debug.log. The fatal error line includes a file path such as /wp-content/plugins/plugin-name/, which names the plugin or theme that crashed.

Need help with your website?

I'm a freelance WordPress developer building fast, SEO-friendly websites since 2020. Tell me what you need and I'll reply with a plan and a fixed quote, usually within 24 hours.

Found this useful? Share it:
Contact

Let's build your next website

Available for freelance projects, agency white-label work and long-term maintenance. Feel free to pass this along to your team or company.

I reply within 24 hours, usually the same day. Your details are emailed to me, then WhatsApp opens so we can chat right away.

Chat now