How I Solved My WordPress White Screen of Death

There are two types of WordPress blog owners: Those that have seen the white screen of death, and those that will. And once you’ve seen it, plan for a full adventure to find the cause.

Summary of my Troubles

  • I upgraded to WordPress 2.9 and updated my Thesis design on the same day. Bad choice.
  • My admin pages stopped working. At first they’d render spotty, but soon I got the total white screen of death. I felt fear for what was to come.
  • I spent two days of my holiday vacation completed engrossed in my FTP client and CPanel, trying to figure out wtf happened. Awesome.
  • I put my computer down and walked away, giving it glances of malace whenever the shiny silver reflection would catch my eye.
  • I resolved to solve the issue today and set aside hours for the cause.
  • I changed one line of code and it worked.

How it Began

I did an automatic upgrade to WordPress 2.9 on December 21, 2009, and everything seemed to be fine. On that same day, I changed my Thesis layout and design, tinkering with just about every file in the wp-themes/thesis folder. Soon, admin pages would turn up blank after posting or approving comments. I walked away and figured I’d sort it out later.

Unfortunately when later came, I couldn’t log in at all. The occasional blank screen had officially turned into the White Screen of Death and while I could see the blog/wp-login.php page, I couldn’t access my administrative functions at all. Hence, off to the races with Google, my FTP client and CPanel to find the cause. I’m posting this blog so that anybody else who runs into this might have a starting point and a few good references.

Finding the Solve: Step 1 – Locating the blank line in the code

I started here: http://www.colinmcnulty.com/blog/2008/07/08/solution-to-wordpress-blank-screen-of-death/. After reading this post, I figured the problem could be an extra blank line at the end of the code following the ?> character, that somehow appeared in during my upgrade. I went through the wp-config.php, wp-settings.php and each .php document in my /blog/wp-admin folder to find the culprit. No luck.

Finding the Solve: Step 2 – Reinstalling WordPress 2.9, reverting back to 2.8.6

So then I found this blog post: http://www.smartbloggerz.com/2009/12/wordpress-2-9-carmen-whats-new-problems-you-could-face/. I decided to do a full manual re-install of my WordPress /wp-admin and /wp-includes folders, along with all the various .php files the /blog directory. First, I reinstalled WordPress 2.9 and that didn’t seem to help. Then, I decided to revert back to WordPress 2.8.6. That didn’t work either.

Finding the Solve: Step 3 – Uninstall & Reinstall Plugins

Okay, next option: Plugins. I realized I hadn’t uninstalled my Plugins before the upgrade to 2.9. So lazy of me, I’ll never do this again – The 5 seconds I saved by not uninstalling them was not worth the 5 hours of Plugin torture that would follow. This forum http://wordpress.org/support/topic/343128 lead me to believe that if I just uninstalled my Plugins and then reinstall them one-by-one I would probably be able to find the one that was causing the error. I still don’t know how to uninstall my plugins in the CPanel, so instead I moved the contents of the plugins folder completely. Then I added each one back one by one. That didn’t help, and the amount of spam that I accumulated was incomprehensible after unistalling Akismet.

Finding the Solve: Step 4 – Regroup

At this point I had burned through two entire days of my holiday vacation, so I decided to put it to rest. Looking back, this is the best thing I could have done and highly recommend doing do if you’re mired in the muck of code, get out! Take a break. Go for a walk.

Finding the Solve: Step 5 – Dig into my /wp-content folder and /themes/thesis

After giving my computer dirty looks all day long yesterday, I finally picked it up this morning and decided to give it another go. For the first time, I thought about the problem in a different light. Instead of a function of the Upgrade, perhaps my troubles were a result of a faulty line of code in my new Thesis /custom_functions.php file, which I had just edited before all the craziness started. I went to my Cpanel and opened the file, found a blank line of code following the ?> character. I deleted that blank line… and voila! My blog works again.

Summary

So, in sum, the solution was in fact what Colin McNulty described in the first blog post I referenced. However, it was a coding error in my Thesis custom_functions.php file (which had recently edited). I did go back into my original /custom_functions.php file and take full responsibility for the two extra lines of blank code after the ?> character, apparently I left them in there when I uploaded through my FTP clent. I can hardly believe such a little detail has caused so much wasted time.

But out of the frustration, I’ve definitely learned a couple important points.

  • I will back up my WordPress files before upgrading from now on.
  • I will uninstall my plugins before upgrading from now on.
  • I will not perform multiple back-end upgrades/redesigns on the same day.
  • I will double check every page I upload for erroneous code.

So I’m still on WordPress 2.8.6 as I’m typing this post, and I’m sure I’ll bounce over to 2.9 eventually. But for now, Happy New Year!

50 comments… add one

  • Typhoon January 1, 2010 at 3:57 am

    Thanks amanda for linking up my post. I am glad that it helped yo in solving the mysterious wp 2.9 error which majority of pople will be getting on upgrading. I hope it also helps others solving same kind of 2.9 upgrade related prob.

    edit
  • Amanda January 1, 2010 at 5:25 pm

    Hi Typhoon, Thanks for writing your post about the error. I don’t know what I would have done without it and I hope others find it useful. Cheers, Amanda

    edit
  • markus January 3, 2010 at 2:45 am

    I also was just working on the functions.php file and i got the white screen. I noticed the extra line at the end and i also deleted it. But i still get the white screen…i dont know what else to do. Im going nuts over here…

    edit
  • Amanda January 3, 2010 at 4:01 pm

    Hey Markus, So sorry to hear you saw the white screen too! You’re working in Thesis, right? Did you give a thorough check for that blank line in all the files in your /thesis folder?

    edit
  • Rich January 28, 2010 at 2:41 am

    I didn’t think fiddling with my theme’s PHP files (as opposed the WP ones) was going to cause any major problem…never did before. Well, that is until I left a $%&*ing extra line anyway earlier today and got the blank screen. This post saved me from days of frustration, no doubt. Serves me right anyway for trying to fix what wasn’t broken, eh?

    Thanks!

    edit
  • Amanda January 28, 2010 at 3:17 am

    Glad this post was helpful!!! thanks for letting me know :)

    edit
  • NW Skyles February 11, 2010 at 3:52 pm

    This post is the single most helpful thing I’ve seen on the internet. I’ve was messing with my functions.php and though I deleted what I had added (after I started getting the white screen only on submitting posts or theme edits), I had failed to take out the extra line… Then everything went south… I was replacing files, backing up, getting ready for the dreaded reinstall and then your post popped up on google and I took a deep breathe and decided to read through it.

    Sure enough, I took out one return out of my functions.php and everything snapped back into place.

    Thank You

    edit
  • Amanda February 11, 2010 at 4:02 pm

    i’m so glad it was helpful, and thank you for the nice note! i’m also super-glad you got your blog back up and running. :-)

    edit
  • NW Skyles February 11, 2010 at 6:06 pm

    No prob, sorry for the atrocious grammer… I blame the WSOD trauma. Strangely enough, you may be interested in one of my projects. It’s a soccer documentary called “Pelada.” It’s about two soccer players who travel the globe looking for pick up matches.

    http://www.nicholaswskyles.com/blog/?tag=pelada

    edit
  • Greg Weber March 26, 2010 at 1:43 pm

    Amanda, thanks so much for posting this. Who knew that a blank line in the stupid functions.php file could take down the entire WP install, which is what was causing my “white screen of death – guess I’ll just have to slash my wrists now” problem. Thanks so much! Us geeks are lucky there are persistent girl-geeks like you out there.

    edit
  • Rich March 26, 2010 at 3:30 pm

    I haven’t gotten the white screen but a few days ago I got a 500 Internal Server Error. Then all pages but my homepage disappeared. When you go to them (ie, http://www.thelunaticltd.com/about) it gives me a Page Not Found error. I’ve tried creating & publishing new pages but they aren’t found. I’m hoping that a reinstall of WP will fix it. I’ll use your links for more info. Thanks for the great post.

    edit
  • Amanda March 29, 2010 at 12:38 am

    @Greg Weber – Best. Compliment. Ever. = “persistent girl-geek”. Glad you got your problem solved :-)

    @Rich, that sounds bad, sorry. I wish I could help but luckily I haven’t gotten a 500 error – wouldn’t that mean there’s a problem w/ your webserver? Not sure a WP reinstall will solve that…? But let me know if it does!

    edit
  • Amanda March 29, 2010 at 12:42 am

    @NW Skyles thanks for the link!

    edit
  • Rich May 21, 2010 at 3:34 am

    Thanks for saving me 2 days of work! The exact Wordpress error message happened to me a few minutes ago. Your first step made me think to reload the original Thesis 1.7 comments.php file I was working on – and boom it restored my WP-Admin panel.

    Great article…Rich

    edit
  • Carl June 15, 2010 at 2:05 pm

    I LOVE YOU AND MY GIRLFRIEND JUST GAVE ME PERMISSION.
    If you were here we’d make you Salmon for dinner.
    I just started my new job and this monster ‘Blank White Screen of Death’
    over took my work days. But nomore Thank you Jesus for Amanda.
    Friends fa sho.
    ~Carl

    edit
  • Amanda June 15, 2010 at 2:25 pm

    @Rich so happy you were able to solve the issue! @Carl I love you too ;-* Salmon is my favorite – give your girlfriend my love. Cheers! AV

    edit
  • Thompson July 19, 2010 at 8:28 pm

    Thank you. I actually did have blank spaces after the close php tag in my functions.php. Who’da thought?

    edit
  • Amanda July 19, 2010 at 8:35 pm

    Glad you were able to find the problem!!!

    edit
  • p July 22, 2010 at 9:00 am

    Thank you , I was freaking out until I found your blog
    Had a blank space in my function.php

    edit
  • Amanda July 22, 2010 at 11:30 am

    Glad this blog helped you! I can’t believe how annoying that one little space can be. Thanks for letting me know :)

    edit
  • Niels September 10, 2010 at 6:08 pm

    Thank you very much for this post. Had the same problem, some blank lines in my functions.php file. It’s all fixed now, thanks to your post.

    edit
  • Amanda September 10, 2010 at 6:13 pm

    you are very welcome – glad the post was helpful! :D

    edit
  • David November 29, 2010 at 2:22 am

    I am having problems posting to this site. I get a blank screen with wp-comments-post.php. Do you use Akismet? Am I blacklisted by Akismet?

    edit
  • Amanda November 29, 2010 at 1:03 pm

    Hi David! Thanks for posting a comment. I approve all comments before they go on my site so I think that’s what happened. Sorry for the trouble and I appreciate you taking the time to write. Best, Amanda

    edit
  • David November 29, 2010 at 11:49 pm

    Hi Amanda,

    I appreciate your attention and response. Your article is well written and I sympathize with the WordPress woes. I used to use WordPress for an old site but now I program my site using PHP, HTML, CSS, etc. I followed you on Twitter. @davidsyw

    David

    edit
  • Amanda November 29, 2010 at 11:59 pm

    Hey David, Thanks for your comment, and for the Twitter follow! Hope you’re well and your programming (and back linking) continues to thrive. I appreciate your approach. Cheers, Amanda

    edit
  • StefanMz December 30, 2010 at 5:01 am

    It is unbelievable, but this tiny fix helped me too! Thanks for investing so many hours and sharing your solution. Best Stefan

    edit
  • Amanda December 30, 2010 at 12:55 pm

    Hey Stefan, I’m happy you’re up and running again. That little space really is unbelievable isn’t it?!?! Cheers, Amanda

    edit
  • greg March 24, 2011 at 7:00 pm

    the blank line in the functions.php solved it for me. it only took me about 3 hours of going through possible solutions on google to find out that the extra space was the issue. amazing.

    edit
  • Amanda March 24, 2011 at 7:03 pm

    well, glad you found it at least. :/ here’s to continued success…

    edit
  • Mercadder November 27, 2011 at 6:48 pm

    I am sorry to say the following:
    -I have a site, subdomains and ad on domains.
    -I have the white scream in subdomains, but not in ad on domains.
    -Functions and other .phps are identical.

    Everything was ok for my main domain, I had installed wp2.9 and thesis. Problems begun with wp3 and Thesis 1.82, and I suspect the problem is caused for Thesis since any other theme works perfectly, only Thesis return a White Screan.

    The first problem was a width and layout going crazy with the “big ass save button”.

    So, I decide to create subdomains, and White Scream arise on them. Others themes works great.

    Maybe that white spaces AFTER the php closing symbol cause problems, the thing is there is several Wordpress .php with blank lines and without closing symbol and they works ok.

    So, I think Thesis have a bug, and everybody think, including the thesis “support” fanatics genious, that is a wp installation. If you installs everything again, of course the problem, in some cases, is resolved. Some thesis genius refer you to a “special support” that you have to pay for.

    This is a Thesis bug and it have to be resolved.

    edit
  • Gabor December 30, 2011 at 8:36 am

    Quite strange that all the highflier asshole dumb nerds couldn’t even be close to solve this problem. PHP hacks and all the bullshits, and even the official wordpress site has no clue! This is typical and very sad, this is why I feel so frustrated when I have to realize that lazy programmers and bad software companies are so harmful by killing our times day by day. Anyway you saved the second day for me, as THIS IS THE REAL SOLUTION! Thanks Amanda, really!

    edit
  • Alan January 14, 2012 at 1:51 am

    Thanks so much! Still helping me years after you posted. I think this happens with Thesis more often because you’re so casually editing a functions file. Cheerio!

    edit
  • Lauryn Doll February 24, 2012 at 5:01 pm

    LMFAO! This whole thing helps because my hosts, HOSTMONSTER, were NOT HELPFUL At all… now I know where to look in my codes. I was almost freaking out. THANK YOU.

    edit
  • Robert April 18, 2012 at 5:55 am

    Thanks, but for me it was slightly different.
    After moving my blog to another host, the front worked okay, but I got a white screen for wp-admin.
    First I put error messages ON, by adding this to wp-config.php (put in just beneath the <php? opening tag):
    @ini_set('log_errors','On');
    @ini_set('display_errors','On');
    @ini_set('error_log','/php_error.log');

    That helped a lot, as I saw that is was a 'headers already sent' problem.
    I had made a couple of user functions, and the error pointed to my own home made functions.They had been working perfectly on the other host.
    The headers already send problem means that there is already output before this is allowed (google for more information.)
    The solution: I had left some white lines between tags in a plugin I made, and some userfunctions, such as

    white line
    white line

    The error message pointed exactly to this white lines. Where is the error? One would say, but the white lines ARE the error.
    good luck

    edit
  • Robert April 18, 2012 at 6:07 am

    Tags were striped from the above example. It needs te be:

    PHP-tag (php code) PHP closing tag
    white line
    white line
    PHP-tag (php code) PHP closing tag

    edit
  • Steve May 7, 2012 at 4:07 am

    Lol, I have had the same troubles with wordpress many a time, it really is something that is rather unusual. Sometimes wordpress just makes me want to pick up my computer and toss it out the window but with people like you on the internet posting and sharing similar problems, you make it all worth the while. Keep up the good work!

    edit
  • Tusar Rath June 30, 2012 at 4:32 pm

    hi Amanda

    I was into the same white screen wp-admin issue since last 6/7 days and was struggling a lot to come out of it. Finally got your post and gone through it. Yes, it was the faulty white spaces in my customfunction.php file.

    Thanks again.

    Tusar

    edit
  • linda July 27, 2012 at 4:25 pm

    This saved my life and my weekend. THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!

    edit
  • Amanda July 27, 2012 at 4:26 pm

    you are very welcome!

    edit
  • Jeff August 31, 2012 at 1:29 pm

    In my theme, there was a jquery.php file that had nearly 1600 blank lines at the start of the file – I never would have found it if I didn’t turn on error logging. THANK YOU!!!

    edit
  • Manuela September 20, 2012 at 7:50 am

    Very good explanations. Thank you, you saved my time :)

    edit
  • Jeragster October 23, 2012 at 1:02 pm

    To fix this problem one might also consider one-by-one emptying the plug-ins folder. Or even the themes folders. It worked for me. BTW: On my white screen I had the text “?>?>?>” (not sure if it was ‘>’ or ‘<' though).

    edit
  • Daniel October 26, 2012 at 2:53 pm

    Thanks for the help :) It turned out for me that WP Super Cache plugin was causing all the problem…

    edit
  • Adam October 27, 2012 at 2:24 pm

    I just had this problem. It turned out to be because I had too many comments loaded on the page. I limited the comments to 50 per page and then everything worked again.

    edit
  • Björn M October 28, 2012 at 4:34 pm

    Thanks, this post saved my day as well. I knew it was something with functions.php causing my white screen but never got my eyes on the two blank lines at the end ;-)

    edit
  • Fatima November 8, 2012 at 5:43 pm

    OMG! am having this problem. but I CAN’T login!!! I don’t get the login box via domain/wp-admin OR domain/wp-login.php… OMG!!! PLEASE SOMEONE HELP ME!

    edit
  • J December 3, 2012 at 8:29 pm

    For what it’s worth, after 3 years, step 5 worked wonders. Before I read your post I repeated steps 1-4. It was on the umpteenth step 4 that I read step 5. Immediately solved the problem: white space in functions.php.

    Thanks a lot – really happy!

    edit
  • Louie January 28, 2013 at 10:49 am

    You owe a big Thanks! I would like to point out that it can also happen due to a false permission set to wp-content.

    edit
  • Louie January 28, 2013 at 10:53 am

    Hi,

    This is a good piece of know how for all wp beginners.
    I also would like to point out here that it can happen due to incorrect permission set to wp-content folder as well.

    edit

Leave a Comment