New 24/7 monitoring and daily cloud backups now included in every Shield Pro plan.

Error fix

Learn how to fix a WordPress critical error.

Use the error log to find what failed, then isolate the affected plugin, theme, or server setting. This guide covers safe recovery steps even when wp-admin will not open.

Time: 20-40 minutes Level: Intermediate
Neil McNaught, founder of BugShield and WordPress author
Written by
Written by
Updated
Updated

What this problem looks like

A white or grey screen showing “There has been a critical error on your website” means WordPress stopped while processing the page. The cause is often a plugin or theme error, an incompatible PHP version, or a memory limit.

To fix a WordPress critical error, find the real error message before reinstalling or replacing anything. If wp-admin will not open, you can inspect files through your hosting File Manager, SFTP, or FTP.

Step 1: Enable debug logging in wp-config.php

Connect via SFTP, hosting File Manager, or FTP and open wp-config.php in your site root. It usually sits next to the wp-admin and wp-content folders. Search for WP_DEBUG, WP_DEBUG_LOG, and WP_DEBUG_DISPLAY first. If those lines already exist, set them to the values below instead of adding duplicates. If none of them exist, paste these lines above the line that says stop editing. On a live site, log to file only and never print errors to visitors.

php
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

Reload the broken page once, then open wp-content/debug.log. The last lines usually name the plugin file and line number. If debug.log stays empty, check your host PHP error log in cPanel, Plesk, or Site Tools.

Step 2: Use WordPress recovery mode

When a plugin or theme fatals, WordPress may email the site admin a recovery mode link. That link lets you access wp-admin with the offending extension paused. Follow it, log in, and deactivate the plugin from the Plugins screen.

  • Check the inbox for your site admin email, including spam folders.
  • If no email arrived, skip to file-level plugin isolation below.
  • After recovery, update or remove the plugin before reactivating it.

Step 3: Deactivate plugins at the file level

When wp-admin will not load, rename the plugins directory so WordPress cannot load any plugin PHP. If the site then loads, a plugin is causing the critical error.

  1. Go to wp-content/ in File Manager, SFTP, or FTP.
  2. Rename plugins to plugins.disabled.
  3. Reload the site and wp-admin.
  4. If the site works, rename plugins.disabled back to plugins. WordPress will see the plugins again, but they should remain deactivated.
  5. In wp-admin, activate plugins one at a time and reload the site after each activation.
  6. When the critical error returns, the plugin you just activated is the culprit. Deactivate or remove it, then activate the rest as needed.

Step 4: Rule out the active theme

If disabling plugins does not help, switch themes at the file level. WordPress falls back to a default theme when the active theme folder is missing.

  1. Open wp-content/themes/.
  2. Rename your active theme folder, for example mytheme to mytheme.off.
  3. Ensure twentytwentyfour or another default theme folder exists.
  4. Reload the site.

Step 5: Check PHP version and memory limits

Hosts migrate PHP versions without warning. Legacy plugins break on PHP 8.x. Temporarily switch PHP 8.2 to 8.1 in hosting only as a short test, not a permanent fix.

If logs mention memory exhausted, raise limits in wp-config.php:

php
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );

When to stop DIY and hire help

If the critical error persists after plugin and theme isolation, or the error log points at WordPress core files you did not change, stop guessing on a live shop. BugShield resolves critical errors at a confirmed price without hourly billing surprises.

Questions answered

WordPress critical error FAQs

Clear answers about finding the cause, protecting your site, and knowing when to stop troubleshooting.

Will enabling WP_DEBUG break my site?

With WP_DEBUG_DISPLAY set to false and logging enabled, visitors still see the critical error screen but errors write to debug.log. Turn debug off after you fix the issue.

Can I fix a critical error without FTP?

Only if recovery mode email works or your host offers a file manager. Without file access you need your host or a developer to intervene.

Should I delete wp-content/plugins?

No. Rename it so you can restore instantly. Deleting loses custom plugin code and makes rollback harder.

How do I fix a WordPress critical error after an update?

Updates often expose incompatible plugins. Isolate plugins first, then update or replace the extension named in debug.log.

What usually causes a WordPress critical error?

Common causes include an incompatible plugin or theme, a failed update, unsupported PHP code, exhausted memory, or damaged WordPress files. The error log normally gives the best clue.

Where can I find the WordPress recovery mode email?

WordPress sends it to the site administration email address. Check that inbox and its spam folder. If no message arrived, use your hosting File Manager, SFTP, or FTP to continue troubleshooting.

Where is the WordPress critical error log?

With debug logging enabled, WordPress writes errors to wp-content/debug.log. Your hosting account may also provide a PHP error log when WordPress cannot create its own file.

Can a WordPress memory limit cause a critical error?

Yes. The error log may say that the allowed memory size was exhausted. A higher limit can help, but a plugin or task using excessive memory may still need to be fixed.

Should I restore a backup after a WordPress critical error?

Only when you understand what the backup contains and what changed after it was created. A full restore can remove newer orders, form entries, users, or content unnecessarily.

When should I ask a developer to fix the critical error?

Get help when the site handles live orders or customer data, you do not have a safe backup, the logs are unclear, or plugin and theme isolation does not restore the site.

Would you rather a developer fixed it?

Request a fix at a confirmed price and speak directly with the BugShield developer working on your site.

Request a Fix