Join Morten Rand-Hendriksen for an in-depth discussion in this video What to do when something goes wrong, aka resolving the white screen of death, part of WordPress 4 Essential Training.
- Now that we've talked about securing WordPress with updates, and backups, and plugins, and external services, and all of that, let me address what happens when something goes wrong with your site. Because invariably, if you do a lot of customization with your site, you will at one time or another, run into a situation where your site either crashes because of a new theme or crashes because of a new plugin. In those cases it's actually much easier to fix the problem than you think. So let me just walk you through that process. I'm going to start by showing you exactly what happens when something goes horribly wrong.
Before we start let me just show you a Google search. If you do a Google search for "wordpress white screen of death" you get several million results. And that's because this is the most common error that people come across when something goes very, very, wrong with their site. And when it happens it's kind of hard to figure out exactly how to fix it because you basically can't get access to anything. So on my local site I'm going to walk you through this exact experience so you know what to look for. Under Appearance and Themes I have a new theme. It's called "CrashyTheme2000".
If you go and check out the theme details you can see it's probably not a theme you should be installing. It says it's, "The only content marketing business theme "for the WordPress that is use by everyone who want "a professional business site with ROI "and also content marketing." Yaay! The reality is I've come across themes that look exactly like this. They're kind of crazy, they are not available from the WordPress Theme Directory and when people install them things go very, very, wrong. So this is a perfect example of a theme you should not be installing just based on the information but it also illustrates really well what happens when a theme is very poorly coded.
So I'm going to show you two scenarios here. First, I'll go and Live Preview the theme. And my entire site disappears. Now this is the white screen of death. And as you can see it's exactly what it sounds like. It's just a white screen, you have no access to anything. The good thing is I just did a live preview of my site so I should be able to just go back, and then just close this, and navigate through the rest and everything is fine. However I can also activate this theme and if I do very bad things happen. So now you can see that not only am I unable to access the front end of my site, it's just white, but I can no longer access the back end of my site.
So I have essentially rendered my entire site useless. This is the white screen of death and at this point people freak out because they go, "What am I supposed to do now? "I have no access to anything. "My site is broken, my content is gone, "the world is coming to an end." Well the reality is this is actually not a very big problem. The problem as you saw is that you installed a theme that has some sort of conflict with WordPress. The solution therefore should be to remove the theme. Now because this is a local install of WordPress I don't have to use an FTP application to do this but what I'm going to do you would do the exact same thing in your FTP application.
First go to your WordPress install and the wp-content folder Then go to the themes folder and find the theme in question. So in this case it's CrashyTheme2000. Now all you need to do here is rename the folder to anything else. So I'll call it just "OLD". And then go back and reload the page. Now what will happen is when you reload the WP Admin you are taken back to the Admin page. But if you go to the front end you'll see it's still a white screen. So what's happened now is because the error is gone we're able to gain access to the back end of WordPress.
But WordPress is still trying to use that theme on the front end. To fix it you just have to go to Appearance and Themes. And the second you go into this page WordPress will go, "The active theme is broken. "Reverting to the default theme." And once that's happened, you can jump to the front end and now you see your site using whatever is the current default theme, in my case 2015. So WordPress has recovered your site. CrashyTheme2000 is still there but because it's now living in a folder under a different name WordPress recognizes it as a different theme and no longer keeps it active.
Of course once this has happened and you discover that CrashyTheme is broken you should really delete the theme but in some rare cases this might also happen when you do a WordPress update. In that case it means that the current theme that you have installed is broken or in conflict with WordPress in some way and you go through the exact same procedure. Go into the folder and rename all the themes you have except for the default themes. And then go back to WordPress Admin and click on Appearance and Themes and WordPress will revert back to one of the default themes and everything should be working fine.
So that's themes, what about plugins? If you go online and search you will see that a lot of people will tell you there are tons of plugins out there that will destroy your site. So I built one, it's called Destroy, it's made by Netrom the Destroyer, and it says, "This plugin is awesome. "You should totally activate it, "it will absolutely not break your site at all." Now if I activate this plugin it will actually destroy my site in the same way the theme does. However because it's a plugin that gets attached to WordPress, WordPress is smart enough to say, "You know what? "Buggy plugins shouldn't work." So if I try to activate this WordPress just goes, "Plugin could not be activated "because it triggered a fatal error." So you can't actually activate the plugin if it's broken.
In fact the only time you can get a plugin to break your site is if there is some sort of coding error in your site that doesn't look like a coding error. Meaning it's trying to do one thing but it ends up doing something else. And those situations are very rare. For the most part if you install a plugin and try to activate it and there's something wrong WordPress will simply stop you, just like you saw here. So plugins are actually relatively safe. The biggest chance you have of your WordPress site going entirely blind like the white screen of death is a theme. And the only thing you need to do to fix it is to go to the back end through FTP, go through your themes folder, find the theme in question, rename it and WordPress should just set itself back to where it was before.
Note: This course covers WordPress 4.3. We will update the training as WordPress evolves.
- Creating posts and pages
- Formatting text
- Publishing and scheduling posts
- Adding images, audio, and video
- Bulk editing posts and pages
- Customizing themes and menus
- Using widgets
- Extending WordPress with plugins
- Editing users profiles
- Configuring settings
- Getting new readers
- Keeping WordPress up to date and secure