How-tos

How to Fix “There has been a critical error on this website” in WordPress

Nothing ruins your afternoon quite like opening your site and seeing that dreaded message: "There has been a critical error on this website." Honestly, it’

Nothing ruins your afternoon quite like opening your site and seeing that dreaded message: “There has been a critical error on this website.” Honestly, it’s super annoying—especially when you’re right in the middle of publishing a post or tweaking a layout.

The good news? This error doesn’t mean your site is gone for good. Starting in WordPress 5.2, WordPress swapped out the old blank “White Screen of Death” for this slightly more helpful line whenever PHP hits a fatal error it can’t recover from. Usually, something broke in a plugin, a theme, or your PHP setup—and most of the time, you can fix it yourself in a few minutes.

Quick sanity check: Before changing anything major, make sure you aren’t just looking at a cached page in your browser or CDN. Open an incognito window and refresh.

Why This Happens (and Real-World Examples)

At its core, this message shows up when PHP runs into a wall and stops executing code. Here’s what usually causes it:

  • Plugin conflicts or bad updates: You hit “Update” on a plugin, or install a new one that clashes with another plugin or your WordPress core version. Example: You update a page builder or SEO plugin, and right after that, your homepage throws a critical error.
  • Theme bugs or dodgy functions.php edits: A theme update introduces bad code, or you paste a snippet into functions.php and miss a semicolon or bracket. Example: Everything runs fine until you switch themes—or save functions.php—and boom, the site goes down.
  • PHP memory limit exhaustion: WordPress runs out of allocated RAM while trying to load heavy scripts. Example: Your site loads fine on light pages, but crashes with a critical error when you open the media library, run a heavy WooCommerce query, or edit a big page
  • PHP version mismatch: A newer plugin or theme expects PHP 8.1+ or 8.2+, while your hosting is still stuck on an older version—or an older plugin chokes on a newer PHP release.
  • Corrupted core files or database glitches: An interrupted update leaves half‑written files behind, or a database hiccup stops WordPress from loading properly.

How to Fix It (Every Working Approach)

Work through these fixes in order. Don’t panic—just take it one step at a time.

1. Check Your Email for WordPress’s Recovery Mode Link

Before touching code or FTP, check the inbox of the WordPress admin email address. When a fatal error happens, WordPress may send an email with a Recovery Mode link.

  • Click that link to log into /wp-admin even while the front end is broken.
  • WordPress may indicate which plugin or theme triggered the error, allowing you to deactivate or update it.
2. Turn On WordPress Debugging to See the Real Error

WordPress hides technical details on live sites for security, which is why you only see the generic message. You can turn on debug logging so it tells you what actually broke and where.

  • Connect to your site via FTP/SFTP or your hosting File Manager, and open wp-config.php
  • Find /* That’s all, stop editing! Happy publishing. */ and add these lines right above it:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
  • Refresh the broken page, then open /wp-content/debug.log. Look at the most recent Fatal error line—it will usually point to the exact file, plugin, or theme causing trouble.
  • Once you fix the problem, set WP_DEBUG back to false and delete or secure debug.log so you don’t leave logs exposed.
3. Disable All Plugins (via FTP, File Manager, or phpMyAdmin)
  • Via FTP or File Manager: Go to /wp-content/ and rename the plugins folder to plugins_old. That forces WordPress to turn off every plugin at once. Check your site—if it comes back, rename the folder back to plugins, then rename individual plugin folders inside it one by one until you find the culprit.
  • Via Database (phpMyAdmin): Open the wp_options table (your table prefix might be different), find the row where option_name is active_plugins, and clear its value or set it to a:0:{}.

If you can’t get into the dashboard and don’t have a recovery email, bad plugins are still your number one suspect.

4. Switch to a Default Theme

If plugins aren’t the issue, your active theme might be.

  • Open /wp-content/themes/ and rename your active theme folder (for example, my-theme to my-theme-off).
  • Make sure a default theme like Twenty Twenty‑Four or Twenty Twenty‑Five is in /wp-content/themes/. WordPress will fall back to it automatically. If the site loads, your theme needs a fix, rollback, or update.
5. Increase the PHP Memory Limit

If your debug log says Allowed memory size exhausted, your site simply needs more breathing room.

  • Open wp-config.php and add or raise this line above the “stop editing” comment:
define( 'WP_MEMORY_LIMIT', '256M' );
  • If 256M isn’t enough for a heavy site, try 512M—and if your host still caps it lower, check your hosting control panel under PHP Selector or PHP Options.
6. Check and Switch Your PHP Version

Incompatible PHP versions cause plenty of fatal crashes after updates.

  • Log into your hosting panel and check which PHP version is active.
  • Try switching to a supported version (such as PHP 8.2 or 8.3, depending on what your plugins and host support), then reload your site. If bumping up broke an older site, step back one version temporarily while you update outdated plugins or themes.
7. Reinstall WordPress Core Files

If core files got corrupted during a botched update, a fresh copy of WordPress fixes it without wiping your content.

  • Download a fresh copy of WordPress from WordPress.org and unzip it on your computer.
  • Delete the wp-content folder from that downloaded copy so you don’t overwrite your themes, plugins, or uploads.
  • Upload the remaining files (wp-admin, wp-includes, and root .php files) over your existing site via FTP or File Manager, overwriting existing files.
8. Check File Permissions, .htaccess, or Database Health

If none of the steps above fixed it, look at a few underlying server pieces:

  • File permissions: Directories should generally be 755 and files 644 (never 777 on a live site).
  • .htaccess: Back up your .htaccess file, rename it to .htaccess_bak, and see if the error goes away. If it does, go to Settings → Permalinks in WordPress and click Save Changes to generate a fresh one.
  • Database issues: If you see database errors in debug.log, use phpMyAdmin to repair tables or restore a recent database backup from your host.
9. Restore a Backup or Ask Your Host

When you’re on a deadline or a messy update broke multiple things at once, there’s zero shame in rolling back. Many hosts provide automatic daily backups—restoring a recent snapshot can get your site back online quickly while you test updates on a staging site. And if your host’s error logs show server‑level blocks or limits you can’t change yourself, reach out to support with the timestamp and what debug.log says.

See also: How to Manage Your WordPress Site From Your Phone With AI (2026).