WordPress White Screen of Death

Errors in WordPress files can make WordPress only display a plain white screen. Since the screen is all white, it’s difficult to figure out what is going on.

What Causes A White Screen?

Some causes could be:

  • Errors in a WordPress update, leaving files incomplete. (Syntax errors)
  • Errors in a Theme update (or bugs in the theme)
  • Errors in a Plugin (or bugs in the plugin)
  • Exceeding the PHP memory limit of a web hosting provider (can be changed in most cases, try editing your php.ini to include: memory_limit = 33554432 (32MB, or a higher number)

How to Find the Problem

A temporary thing to try (don’t leave this set!) is to edit your .htaccess adding this line: php_flag display_errors on, which could let you see if files are missing or what file and line number has the syntax error. Any PHP programmer could then help you fix it, since it is highly likely something simple.

But the most common solution you’re going to find online is to remove a blank line and that “blank line” was the problem, since removing it fixed it! (Not accurate) A Variant is “a space” did it (also not accurate).

Simple Fix for the Most Common Problem

It isn’t removing the blank line (or closing PHP tag, or ___) that does the trick. It is the Editing that does the trick. Most programmer editors (or plain text editors) will fix weird line ending characters. PHP has a few commands that must start at the beginning of a line. PHP has comments that continue Until The End of Line (use // to start the comment).

If there is an improper line-ending for a “//-comment” the following line’s code will be “eaten”, very likely leading to a syntax error (if not, then a logic error). Syntax errors you can see with simple configuration settings in my link below.

Most editors will fix line breaks (on a Windows machine, it will convert all line breaks to Windows format), and FTP programs will, in ASCII Mode, convert to the destination computer’s format.

TIP: Don’t transfer .php files from an Apache server (Unix line endings, LF) to a Windows computer (Windows line endings, CRLF) in Binary mode. Transfer .php files Always In ASCII (Text) mode, so the line endings are correct. Most FTP programs have settings for that, so you don’t have to remember it.

NotePad++ and other programmer editors will let you see line ending characters. In NotePad++ in the View menu, Show Symbol, Show End of Line. NotePad++ will allow you to change line endings: Edit menu, EOL Conversion. That’s how I found one of those line-ending problems… Download to your computer in Binary mode and look at what is Really in the file.

Get Debugging Information that Only You See

I wrote detailed instructions how you can see the debugging information that PHP and WordPress provide, with changes in wp-config.php (or a file included in any other PHP project), to display lots more error information when you and only you are seeing it, and no errors for anyone else.

Don’t guess what the problem is, diagnose it.



One response to “WordPress White Screen of Death”

  1. George Avatar

    Also see my posts on:
    PHP unzip bug makes WordPress updates hang, fixed several versions of PHP ago, but many web hosts still use the old one!

    Tracking down Deprecated functions, the WordPress error messages point to the file and line *reporting* the error, not the file and line *with* the error.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.