DEV3 Technologies home

DEV3 Developer Forum

How do I fix the WordPress white screen of death?

WordPress helpSolved0 views
dev3 ·

My site shows a blank white page on the front end (and sometimes wp-admin) after I activated a plugin. No error is displayed. How do I find the cause?

#wordpress#debugging#php

0

1 reply

dev3 · Accepted answer

A white screen is a PHP fatal error with display turned off. Make WordPress log it.

1. Turn on debug logging in wp-config.php, above the line "That's all, stop editing":

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

Reload the page, then read wp-content/debug.log. The last "PHP Fatal error" line names the file and line, which shows the plugin or theme at fault.

2. Typical causes

  • Memory exhausted (Allowed memory size of ... exhausted). See the memory limit topic.
  • A plugin or theme using a function that does not exist in your PHP version (for example, after upgrading PHP).
  • A syntax error from a hand edit of functions.php.
  • A corrupted update that left files half-written.

3. Get back in when wp-admin is dead

  • Rename the plugin folder over SFTP: wp-content/plugins/bad-plugin to bad-plugin.off. WordPress deactivates it automatically.
  • If unsure which, rename the whole plugins folder, then restore it and re-enable one by one.
  • For themes, rename the active theme folder; WordPress falls back to a default theme.

With WP-CLI: wp plugin deactivate --all or wp plugin deactivate bad-plugin.

WordPress 5.2+ also shows "recovery mode" and emails the admin a link when a fatal error occurs; check the admin email inbox.

Pitfall: do not leave WP_DEBUG_DISPLAY true on a live site. Errors leak paths to visitors. Also delete or protect debug.log afterwards, as it is publicly reachable by default at /wp-content/debug.log unless blocked.

0

Your reply

Every post is reviewed by DEV3 before it appears. Usually reviewed within 24 hours.

Markdown supported. Use ``` for code blocks. Images are not allowed.