You’re messing around in your functions.php file (courtesy of Appearance > Editor). You type in a bit of code, hit “Save”, then suddenly your whole site goes white.
Blank.
You can’t even sign in.
A lot of people think this means their blog is GONE… but that’s not the case.
One time, a girl posted about this white screen of death and how she thought her blog was gone, so she did all this stuff about trying to reinstall WordPress, etc. Long story short, the problem could have been fixed in 10 seconds, but since she didn’t know that, she ended up doing even more irreparable damage to her blog.
The white screen is like a spelling mistake.
Imagine you’re writing a six page essay. You make a stupid spelling or grammar mistake, so the teacher pulls your essay out of your hands, writes the spelling mistake on a blank white piece of paper, shoves it in your face and says, “Does this seriously look correct to you?”
Since the glaring spelling mistake is in your face, you can’t see your essay. But that doesn’t mean it’s gone. It’s just hidden behind the teacher’s back in her other hand. You fix the spelling mistake and she’ll give your essay back.
That’s LITERALLY what’s happening here.
- Your blog is not deleted.
- Your posts are all still there.
- Your theme and design is all still there.
So what’s the problem?
It’s just a coding syntax error.
There’s a coding error in your blog. You messed up the PHP code while digging in functions.php. Maybe you…
- forgot a semi-colon.
- mis-typed the name of a function.
- tried to put CSS inside of the PHP file.
Whatever it is, because of this coding error, your blog is having a hard time being displayed. Everything is still there and fine behind the scenes, it just can’t be displayed right now.
Fix the coding error and everything will go back to normal.
-
Login to your cPanel. This is usually accessible through your web host’s website. If your host doesn’t use cPanel then I can’t help you here and you’ll need to ask your web host where to find the “File Manager” or how to get FTP set up.
-
Inside cPanel, locate the “File Manager” icon, which is in the “Files” section. Click it.
-
A little window might pop up asking you to “Select the directory what you wish to open.” Select, “Document Root for {your website here}”. If that’s not an option, “Web Root” is also okay.
-
That will open up a page that looks a bit like this:
Double click on wp-content, then double click on themes then find your theme’s folder inside that one and double click on it.
-
Now you’re inside the folder of your theme. And guess what’s in there! functions.php (or whatever file you were editing before your site crashed).
-
Click on the functions.php file, then click the “Code Editor” button at the top of the page. This will show you all the code in functions.php. It’s just like editing in Appearance > Editor, but it’s actually better. You can find what bit of code you added before your site crashed and fix it or remove it.
Once you fix the problem, your site will be accessible again!
The first time this happened to me, I was in near hysterics. I was lucky enough to have someone more knowledgeable than me in the office who helped me fix it. He stayed nice and calm and talked me through logging into the FTP and re-uploading the functions.php file to the server. I was smart enough to have a copy of the original code before I made changes.
Yeah if you’re not familiar enough with code to identify and fix the errors, then it’s always a good idea to take a backup first.
My workflow before I got good at PHP was:
1) Copy entire functions.php file and save it in a text file.
2) Make my changes on the site.
3) If something bad happened, just copy and paste the original back in.
I have, Ashley! In my case it was a plugin that did not work with a new WP update. Naturallt, I panicked but did a quick google search and found out a lot of people had issues when with it when they updated their blog! There was also a tutorial on how to delete it.
I’m glad I googled before doing any damage to it!
Hey! I had the white screen crash after installing plugins too. What did you do? Because the functions did no work for me.
You will have to have access to your ftp files. Go to the plugins folder and delete that plugin from there.
Hope that helps!
Seriously, your posts all seem to arrive at the PERFECT time. I had this exact issue the other day – I knew it wasn’t a big problem, but I had no idea how to fix it. So I had to faff about by contacting my web host to get them to sort it. Several hours (and a lot of stress) later, it was fixed… but it’s so good to read this post and learn how to fix it myself, if it happens again! Thank you 🙂
You’re so welcome, Mike!
It’s really useful to be able to take control of a situation like this on your own. 🙂
Awesome post, Ashley.
It is good to be able to take control of the situation when a white screen (WSOD) happens.
In some ways this is a good thing when it happens on a live website, because it means that the actual error (along with the path to the faulting file) is hidden from prying eyes. A reasonably good security measure (somewhat).
For a local test website, folk may wish to display these errors (if they exist).
As you pointed out, “functions.php” is usually the culprit. In some other cases, it could be themes or plugins.
This is why backups are so important.
Do you have any recommendations for troubleshooting further, in case its not “functions.php” at fault?
Thanks
Hey CJ!
If it’s not functions.php then you’ll want to get the exact error message. As you said, many hosts choose to hide these errors by showing you a blank page instead (or a 500 Internal Server Error page). You’ll need to get the actual error message by checking your error logs. These can often be found in cPanel too.
Once you have the error logs, you’ll need to find the error message. This shouldn’t be too difficult because they’re all timestamped. Just find the most recent one.
The error message will give you the EXACT FILE (and line number) the error is coming from. Something like:
So as you can see, it gives you the path to the exact file the error is occurring in, and the exact line. With that info, you can either edit the file in question, or disable that particular plugin/theme (by renaming the plugin/theme folder or similar).
Ashley, you are a breath of fresh air. Your instructions are clear and easy to follow – something most of us non-coder people are grateful for!!! I’m still struggling with my switch from blogger to wordpress but I will bookmark this page! You will now be my go-to for all that is wordpress and soon wordpress will be my bitch too!!! Thank you!!! 😉
You’re so welcome! 🙂 Have a lovely day Sabrina!
This happened to me once when I misspelled something and at first it freaked me out because I had no idea what was wrong. Thankfully, my hosting providers helped me fix it right away. Not a fun experience though. Great post!!
Wow, great information!!! I was able to easily follow your instructions and fix my errors. Thank you so very much!!!!
Ashley – thanks a million for this article! I just got the white screen of death myself, but I fixed it swiftly thanks to your instructions. I think I’ll just leave functions.php alone from now on… 😛
I’m so glad you were able to fix it! 🙂
Thank you im newbie and you fix my problem ^_^
THANK YOU SO MUCH!!!
No word of a lie, I just spent god knows how long (a good hour at least!) trying to figure out how to delete the stupid code I wrongly inputted. After website after website telling me I needed to download filezilla and make a child themed page I was so close to smashing the glass currently next to me.
But then I found your blog and THANK GOD I DID!
How simple was that!
I owe you one!
I’m so glad you got it figured out! 🙂
Messing around today and got the White Screen of Death on a new site I am developing. Freaked out for most of the day thinking all was lost until I found your post. So easy to fix once you know where to look. Thanks.
Oh my gosh you just saved me from complete panic. Thank you!
You just saved me with this! Am a bit of a noob and just trying to hack together something from various resources around the web, didn’t think I’d be so easily be able to break the entire file so I couldn’t get into my admin account at all. Thanks so much!
Hey Ashley,
Wonderful post, I was having trouble finding information on this topic. I also used the appearance editor and didn’t realize the danger compared to FTP programs. However, even after I went to my file manager and fixed the functions.php in my child theme (error was on line 13 & 18) the site is still giving the same error (but only on certain WooCommerce products). Any ideas why?
“Fatal error: Cannot redeclare dequeue_woocommerce_cart_fragments() (previously declared in /home/proces39/public_html/wp-content/themes/kallyas-child/functions.php:113) in /home/proces39/public_html/wp-content/themes/kallyas-child/functions.php on line 118”
Hi Jason 🙂
That error means you have a function with the same name declared two times. Once on line 113 and another time on line 118. A function name can only be used one time.
I suggest doing a CTRL+F search for “dequeue_woocommerce_cart_fragments”. You’ll probably have at least two results.
You just saved my ass. Such a quick and easy fix, thanks to you! Cheers, Ashley!
Thank you so much for this, you saved my life! I was panicking so much after I got a fatal error from messing with my functions.php file… You’re a lifesaver!
Had to reinstall my child theme and start over. So glad to find your site though. Thanks!