Your WordPress website just went down! It crashed and you have no idea what to do. Never fear! This is the process I use with my clients to determine what actions to take.
Note: before doing any of this, go to downforeveryoneorjustme.com and determine whether your site is actually down for everyone, or just you. I find that more often than not, it’s a local issue for clients. If you are seeing an issue for just your local machine, try clearing your cache or trying a browser other than your normal one to see if it’s just a cache issue.
Want us to check your site and see what’s wrong?
Fill out the form and we’ll take a look, free of charge.
Step 1: Determine Whether the Crash is a WordPress or Hosting Issue
This is critical. You need to know what you’re dealing with before you can take action. We highly recommend you first enable PHP error reporting within WordPress, which is very easy to do and can help you quickly diagnose the problem.
It is more than likely a WordPress issue if any of the following are true:
a. You are seeing PHP errors of any kind. How do you know if it’s a PHP error? It will almost always follow a similar syntax as this:
Error type: Explanation of error in /home/example/public_html/wordpress/folder/file.php on line 123
Tired of dealing with your slow WordPress website? Enter in your email address here to receive the secret to lightning-fast load speeds overnight.
Here is what it might look like in your browser:
b. You get a blank, white page that loads quickly. All valid WordPress pages behave the same way. Other, made up page URLs (try example.com/abcdefg.html) may or may not return a fairly blank looking 404 error page.
Jump to the solution for no PHP errors.
c. Any part of your normal website loads, but something is definitely wrong.
Jump to the solution for partial WordPress Functionality.
d. Your home page is fine, but you get a 404 error on every other page. This is an easy fix; the permalinks just need to be reset. Log in to the backend of your site, go to settings -> permalinks, and just click “Save Changes”. This will reset them and your other pages should start working again.
It may be a WordPress issue OR hosting issue if any of the following are true:
a. You get nothing but a blank page with a big error message reading: “Error establishing database connection”. This error means exactly what it says, though it doesn’t explain why. If the site has been at the current host for a long time and you haven’t made any changes to the DNS or database itself, odds are this is a hosting issue. Occasionally the database may go offline on your host’s end, but the website files remain available, especially at cheap shared hosts like Godaddy, Host Gator, Bluehost, etc. If that’s the case, you can probably just wait it out. If it persists more than a couple hours, it may be worth giving your host’s support line a call. If you have a better host, like CloudAccess, you may want to open a ticket immediately.
If you HAVE made a change to the DNS, Database, or Hosting Account lately, it is likely another issue. If you changed the DNS, make sure that the changes have propagated. I recommend going to whatsmydns.net, entering in the domain name, and making sure that the same IP address comes up for every location. If not, and if you changed it lately, you may need to wait up to 24-48 hours for that to propagate (though it’s usually less than 2 hours in most cases, sometimes instantaneously, especially if Godaddy houses your DNS.) If you changed your Database or Hosting Account in some way that might affect this, verify the location, name, username, and password of your database via your hosting account, then double check the values in your wp-config.php file (located in the website root folder). Look for the section that looks like the following:
/** database username */
/** MySQL database password */
/** MySQL hostname */
Note also that for many hosts (including CloudAccess and Godaddy), the database name and username are one and the same. Also for those two hosts, CloudAccess typically uses the database host of ‘db’ while Godaddy has a long, unique URL for each that usually looks something like “sitename.db.46548942.hostedresource.com” or something similar.
If all else fails, give the host a ring and they should be able to help you out.
- The first thing to try with this is to back up the .htaccess file located in the WordPress root, and then delete the original. Many times this will fix the problem temporarily. If it comes back, you probably have a security plugin going rogue on you. It could also be malware, which I cover in another post. If you can get in the backend of WordPress and disable the plugin, that works great. Otherwise, you can also navigate to the plugin directory and rename the directory of the plugin itself to disable it. Plugins are located at: websiteroot/wp-content/plugins/. Then load up the plugins page from the backend, where it will inform you that the plugin has been disabled because it no longer exists. At that point, you can safely re-name the plugin folder via FTP and it will re-appear but stay deactivated.
If deleting the .htaccess makes no difference, there is probably something else misconfigured with the hosting. It’s probably best to just contact the host and find out what they can tell you.
- If the .htaccess does nothing, you’re going to want to view the error logs of the server. Often times these will point to the path of a specific file, frequently a plugin. On most shared hosts, you need to enable the error logs first. Then you can try accessing the website to generate some errors, and view the most recent log entries. It’s easiest just to Google how to view the error logs for your host. If you have a VPS or Dedicated Server, you may just want to Google how to view the error logs on your platform, such as WHM, cPanel, Plesk, or whatever you might be using.
c. You get a 404 error on the homepage. This can mean there isn’t a file called index.php, index.html, home.php, or home.html in the website’s root folder on the server. Check via FTP to ensure there are files there, and that WordPress’ index.php is there. If those files ARE there, it may be a hosting or .htaccess issue. You should contact the host, or you may want to try steps b1 and b2 from above.
It’s probably a hosting-related issue if any of the following are true:
a. The page times out or the server returns nothing. You may get a “No Data” error or something similar. This is very common what hosting typically does when it’s just totally offline. It may be worth contacting the host, especially if it’s lasting longer than an hour or two. This is a major problem if it happens more than .5% of the time. On good hosts, it will likely be much less than .1% of the time. For the most part, you’ll just want to wait this out. It could also be a DNS issue, or a problem with your plugins, especially if you ran some updates recently. If that’s the case, follow the instructions for disabling all the plugins.
b. You see a message with the host’s branding saying that the site isn’t configured properly. You maybe have not added it to the hosting account yet, even though the files are there, you’ve let your hosting account expire (often because your credit card expired), or something is wrong on their end. You should probably contact the host. It could also be a DNS issue, especially if the error is from a host company you don’t expect it to be.
c. You get a cryptic, non-PHP error. Godaddy will sometimes have the famous “pageok” error. You generally want to contact the host for these.
It’s probably a malware-related issue if any of the following are true:
a. Any pages redirect to some other website you’ve never heard of, especially Russian ones. I don’t know why, but most malware seems to come from Russia…
b. You get random text or ads on your site advertising Viagara or anything else unusual and unwanted.
c. WordFence security is listing “Malicious Content” in its scan results. I highly recommend having WordFence installed on your site, and making sure the “Scan theme files against repository versions for changes” and “Scan plugin files against repository versions for changes” options are checked as well. Click the link below for more instructions on using WordFence.
Step 2: Fix the Problem and get WordPress Back Online
If WordPress was the problem, and nothing or almost nothing is working
If you determined that WordPress was causing the issue and not the hosting, there are a few things you can do. First, it might be smart to see if you can access the WordPress backend. The backend location is almost always example.com/wp-admin. Go there, log in if you can.
Many (perhaps even most) times, old versions of plugins or themes are not compatible with newer versions of other plugins, themes, or WordPress and this is the cause of the problem. If possible, back up all your files and the database before you do anything.
If you got a PHP error, take a look at that error. Are there some file paths in there? Often, the first one will lead you right to the problem file, and it’s quite often a plugin. It might look like username/public_html/wp-content/plugins/pluginname/plugin.php. If that’s the case, we have our problem plugin! Navigate to that folder in FTP and rename that folder for that plugin (in this case, it’s named pluginname). Try renaming it to pluginname2 for now. Try reloading your website a few times. It might take a minute to “reset”. Tip: In Google Chrome, hold down ctrl while you press “f5” a couple times to clear some of the cache at the same time.
If your site is back up, great! You may want to consider getting the newest version of that plugin and WordPress as well and testing it again. Remember to rename that plugin folder back to what it was.
If, in that PHP error, you saw the filename “pluggable.php”, then you know a plugin is likely to blame. You can rename the plugins folder just like you did for the one folder in the previous example. It will be located at wp-content/plugins. Rename it “plugins2”. Then reload. If the site loads, you have a plugin issue. IMPORTANT: the first time you go to the “plugins” page after this process, you will see a bunch of errors, saying that some plugins were deactivated because their folders don’t exist. Take note of which plugins are listed: these are the ones that used to be active, and there’s no way to recover that list later. You might not think this is important, but you don’t want to find yourself asking a client if he or she knows which plugins were active and which were inactive before you messed with the site.
Once you are back in, then rename the plugins folder back to what it was. You may want to re-activate them one at a time until you find the problem plugin. Once you do, rename its folder to disable it again. Once again, either try updating everything, or possibly contact me for further troubleshooting 🙂
If you didn’t see a PHP error, you can still follow the above instructions to rename the whole plugins directory to disable all the plugins. If that doesn’t work, it may be worth doing the same thing with the theme. If you happen to know what theme you are using, go to wp-content/themes/ and look for the likely folder of your active theme, and rename that. Go through one-by-one if you aren’t sure until the site comes back up. Then, proceed to “Updating Everything”.
If WordPress was the problem and some things are working
Odds are you have some plugin / theme incompatibilities with versions. Proceed to “Updating Everything.” If updating everything doesn’t work, you may just have some things that aren’t going to work together anymore or problems with some custom code. I recommend having an expert take a look.
If it’s malware
I have full instructions on removing malware in a separate post located here.
Warning: I highly recommend you make sure you have backups of your entire site’s files and database before proceeding.
Make sure everything is up to date. This should include WordPress itself, all of your themes, and all of your plugins. You may have to check manually for updates to your theme and premium plugins.
For WordPress itself, you can have WordPress do it automatically by following the prompts. There should be a promt on every page in the backend asking you to update WordPress, so just click that and follow the instructions. If that doesn’t work, what I like to do is download the latest version of WordPress, unzip it to my local machine, and then create a new archive with all of the files and folders EXCEPT wp-content. Then I upload that folder to my server, and unzip it using SSH or the online file explorer tool, making sure to overwrite existing data.
For the theme, go to Themes -> Appearance and click on your active theme and it should tell you the version. If it’s a child theme, find the parent theme and find the version of that. Then Google the name of your theme and “version” and hopefully you will find the current version. If there is a newer one available, you’ll want to download it. Hopefully you purchased the theme yourself, and can still download the update. Explore the zip file to make sure it’s the actual theme install. There should only be one folder in it. If not, try and browse around until you find the zip for just the theme, and then extract that to your local machine and upload that. Using FTP or the online file manager in your hosting account (preferred method where available), upload the file directly to your site’s wp-content/themes directory. Then, still using the online file manager or SSH, unzip the whole thing, overwriting any files along the way.
Once this is done, your theme should be updated! Check the version in the backend (Appearance -> Themes) to verify it is up to date.
You may need to update some premium themes in the same manner. Specific ones to look out for are WP Bakery Visual Composer (whose folder is named js_composer I believe), Revolution Slider (sometimes has alternate, similar names), Gravity Forms, and basically anything with “Pro” in the name. Keep in mind, too, that many of these are sometimes bundled with the theme, and so installing the newest version of the theme may allow you to upgrade the plugin, too.
If these updates actually break the site, you may want to consider reverting back. Hopefully you made that backup I told you to make, which you can now use to revert back. You can use FTP to upload just the files for the specific plugin or theme that’s causing a problem if you want. Where available, I prefer to just make zip files, upload those, and unzip them at the end location because FTP is usually pretty slow.
There are lots of ways things can go wrong with a WordPress website, but a little proactive maintenance goes a long way. Doing things the right way is critical to minimizing the chance of these things happening. Incidentally, the best way to prevent most foreseeable problems is to keep everything updated regularly. I recommend updating WordPress, your themes, and your plugins on at least a monthly basis. This ensures they will stay compatible with each other, and also prevents malware from getting in. If you don’t keep your stuff updated, I guarantee you will get hacked sooner rather than later, and believe me, it’s not fun to deal with.
Sometimes, when running updates, you may find that things go wrong or don’t work any longer. That’s the main advantage of hiring a team like ours to do the updates for you. We know exactly how to revert plugins back to old versions and even troubleshoot new issues. With my current clients, I just work on a monthly basis and go through and keep them updated. It’s inexpensive and will actually save you money in the long run since you won’t have to pay someone to remove a hack!
I hope this guide helps some people out. It is the culmination of my years of experience working with WordPress and other websites and is actually how I approach this problem with my own clients. It doesn’t cover everything under the sun but should be a good enough guide to deal with 90% of the problems that might come up. Let me know what you think or if I missed anything.