Skip to main content
Wordpress Troubleshooting & Common Errors

How to Troubleshoot & Fix WordPress Critical Errors and White Screen of Death (WSOD)

How to Troubleshoot & Fix WordPress Critical Errors and White Screen of Death (WSOD)

When WordPress encounters an unrecoverable PHP Fatal Error, unhandled exception, or memory exhaustion, it halts execution and displays the generic message:

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

In older versions or unhandled web server errors, this appears as a blank white page, commonly referred to as the White Screen of Death (WSOD). This runbook walks through the exact diagnostic steps to isolate the root cause, identify the faulty component, and bring your site back online safely.


1. Quick Triage Flowchart

Follow this progressive triage order to minimize downtime:

  1. Enable Error Logging in wp-config.php to capture the real stack trace.
  2. Inspect the Log (wp-content/debug.log) for the exact file path and line number.
  3. Isolate the Culprit:

– If a plugin: Rename the plugin’s folder to deactivate it.
– If a theme: Revert to a default theme (Twenty Twenty-Four) via database or filesystem.
– If memory limit: Increase WP_MEMORY_LIMIT in wp-config.php.

  1. Fix or Replace the offending function, plugin, or syntax error.

2. Enabling Diagnostics via wp-config.php

By default, WordPress hides internal PHP errors from end users for security reasons. To force WordPress to record errors to a private server log, open wp-config.php located in your site’s root folder.

Find the line that says /* That's all, stop editing! Happy publishing. */ and place the following configuration immediately above it:

// Enable WordPress Debugging & Log to wp-content/debug.log
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false); // Keep false so visitors do not see errors
@ini_set('display_errors', 0);
Important: > If define('WP_DEBUG', false); already exists higher up in wp-config.php, replace it. Defining the constant twice causes a PHP notice.

After saving wp-config.php, refresh the broken page in your web browser. This triggers the PHP error again and writes the full stack trace to:

/wp-content/debug.log

3. Reading and Interpreting wp-content/debug.log

Open wp-content/debug.log. Look at the most recent entries at the bottom of the file. You will typically see one of four common error patterns:

Case A: Fatal Error in a Specific Plugin

[20-Oct-2026 14:15:22 UTC] PHP Fatal error: Uncaught Error: Call to undefined function get_woocommerce_term_meta() in /wp-content/plugins/custom-addons/custom-addons.php:142

Resolution:
The file path /wp-content/plugins/custom-addons/ tells you exactly which plugin caused the failure.

  1. Access your server via FTP, SSH, or local file manager.
  2. Navigate to wp-content/plugins/.
  3. Rename the directory custom-addons to custom-addons.disabled.
  4. Refresh your WordPress dashboard. The plugin is automatically deactivated, and your site recovers immediately.

Case B: Memory Exhaustion Error

[20-Oct-2026 14:20:05 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480000 bytes) in /wp-includes/class-wp-image-editor-imagick.php on line 389

Resolution:
134,217,728 bytes equals 128 MB. A heavy operation (such as processing high-resolution images or running complex reporting queries) exceeded your PHP memory allocation.

To resolve this, add these lines to wp-config.php above the “stop editing” comment:

// Increase WordPress Memory Limit
define('WP_MEMORY_LIMIT', '256M');
define('WP_MAX_MEMORY_LIMIT', '512M');

Also check your server’s php.ini file:

memory_limit = 512M
Tip: > After modifying php.ini, remember to restart the Apache service via XAMPP Control Panel or terminal (sudo systemctl restart apache2).

Case C: PHP Parse / Syntax Error

[20-Oct-2026 14:28:11 UTC] PHP Parse error: syntax error, unexpected token ";", expecting "]" in /wp-content/themes/xyphla-child/functions.php on line 45

Resolution:
A recently edited snippet in functions.php has a syntax mistake (e.g. missing bracket or semi-colon).

  1. Open the file indicated (functions.php) at line 45.
  2. Correct the syntax error or remove the custom code block.
  3. Save the file and reload the website.


4. Bypassing WSOD with WordPress Recovery Mode

Starting in WordPress 5.2, WordPress features a built-in Recovery Mode. When a fatal error occurs, WordPress attempts to email an error notification and a temporary Recovery Mode URL to the site admin address (admin_email).

The email contains:

  • The exact plugin or theme that caused the crash.
  • A one-time login link: https://example.com/wp-login.php?action=enter_recovery_mode&rm_token=...

When logged in via Recovery Mode:

  1. The broken plugin/theme is temporarily paused only for your administrative session.
  2. A red banner at the top of the admin bar states: “One or more plugins failed to load properly.”
  3. You can click Deactivate on the offending plugin directly from the WordPress admin interface without needing FTP or shell access.


5. Deactivating All Plugins via Database (Emergency Recovery)

If you have database access (phpMyAdmin or MySQL CLI) but cannot access the filesystem or admin dashboard:

-- View current active plugins
SELECT option_value FROM wp_options WHERE option_name = 'active_plugins';

-- Temporarily deactivate all plugins safely
UPDATE wp_options SET option_value = 'a:0:{}' WHERE option_name = 'active_plugins';
Caution: > This deactivates all active plugins simultaneously. Once you regain access to /wp-admin/, re-activate plugins one by one to pinpoint which one causes the crash.

6. Preventive Checklist

To prevent unexpected fatal outages:

Action Recommended Practice
PHP Version Compatibility

Test plugin updates against your PHP version (e.g., PHP 8.2) on staging before deploying to production. |
| Automated Backups | Configure daily file and database snapshots prior to updating core or major plugins. |
| Memory Buffer | Ensure production servers have at least 256MB allocated for WP_MEMORY_LIMIT. |
| Staging Environment | Never edit theme functions.php directly on a live production server. |

Was this technical article helpful?

Help us continuously refine Xyphla documentation.