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.
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!