If you’re new to WordPress, learning the platform’s ropes takes some time. In most cases, using it will be plain sailing. However, you may run into an error that needs a little troubleshooting to fix. It’s rare, but it does happen. For new users, this can be huge source of frustration. An excellent example of this is the 503 service unavailable error.
This error in particular has a lot of potential causes. The good news is that if you’re methodical, you can solve it fairly quickly. Once it’s taken care of, you can even take a few measures to prevent it from happening again.
In this article, we’re going to talk about what a 503 service unavailable error is and what causes it on WordPress websites. Then we’ll guide you through a four-step method to troubleshoot it, and teach you two ways to prevent it from happening again. Let’s get down to business!
Table of Contents
- What a 503 Service Unavailable Error Is (And What Causes It)
- How to Fix a 503 Service Unavailable Error in WordPress (In 4 Steps)
- How to Avoid Future 503 Server-Based Errors in WordPress (2 Tips)
The 503 service unavailable error is not inherent to WordPress alone. It’s a universal message that appears when you try to access a website but its server can’t be reached. In contrast to a 404 error (which pops up when you try to access a non-existent page), the 503 error lets you know there’s something there, but it’s currently inaccessible. In fact, some browsers display a 503 service temporarily unavailable message to basically tell you to try again later.
As is often the case with these types of errors, there’s more than one potential cause behind it. Let’s break down the four most common:
- A problem with one of your themes or plugins. When it comes to WordPress, one of the most common causes of the 503 error are PHP scripts. More specifically, one of your plugins or themes may be unable to load at your server’s request, which in turn means it can’t render your website.
- Custom scripts. A lot of people add custom scripts to their WordPress websites. This could lead to a similar situation as the above.
- Server downtime. Most modern web hosts have incredibly low downtimes. However, on some rare occasions, your server may become temporarily unreachable due to an excess of traffic, which brings us to the next potential cause.
- Denial of Service (DDoS) attacks. In some cases, your website may be targeted by a DDoS attack, which involves directing massive amounts of traffic towards it to make your site inaccessible.
If you’re paying attention, you’ll notice we can divide the above causes into two categories – those that depend on your server, and those related to WordPress. Let’s talk about how to solve both of them.
Unlike most WordPress errors, this one can’t be easily solved by accessing a recent backup. However, you should still remember to back up your site regularly in case you run into any other problems. With that in mind, let’s jump right into step number one.
1. Disable Your WordPress Plugins
If your server isn’t the problem, things get a bit more interesting (or annoying, depending on your perspective). Chances are the 503 error is being caused by a plugin or a theme. However, the former is often more likely because most people use multiple plugins simultaneously, which increases the odds of an incompatibility.
Since you can’t access your dashboard as you usually would and disable your plugins from there, we need to get creative. Before we move on, you’ll need to download an FTP client – such as FileZilla – and install it. This type of software enables you to transfer files to and from your server securely. You may also need to brush up on your FTP skills before progressing.
When you’re ready, look up your FTP access credentials. On 000webhost you can find them in Settings -> General section. Use them to log into your server from within FileZilla:
Once you’re in, on the right-hand side you’ll see a list of all the folders you own on that server. Here’s what you need to do, step by step:
- Locate the WordPress root folder, which is often named public_html.
- Open that folder and navigate to the wp-content directory.
- Find the plugins folder, right-click it, and choose the Rename option.
- Change the name of the plugins folder to something such as plugins-deactivated or anything else you like, as long as you remember what it is.
- Try accessing your WordPress website.
If a plugin was behind the 503 error, you should be able to access your site. By changing the name of your WordPress plugins directory, it essentially deactivated all of your plugins.
You’ll now need to do some housekeeping after the changes you made. To do so, return to the wp-content folder using your FTP client. Change your plugins-deactivated name back to its original one. Now WordPress will recognize all of your old plugins, but they’ll be deactivated by default:
This is where things can get a bit tricky depending on how many plugins you have. You’ll need to access your WordPress dashboard, head to the Plugins tab, then reactivate them one by one. After enabling each, see if your website is still loading until you run into the one that’s causing the error. When you’ve identified it, you can access the wp-content/plugins directory within your FTP client and delete its corresponding folder (which should share a similar name):
Doing so will prevent the error from occurring again, but of course you’ll be left without your plugin. At this stage, you should contact the developer to ask them for a fix, and also look for a replacement in WordPress’ Plugin Directory if the plugin was vital to your workflow. Either way, if you run into that pesky 503 error again, you know how to make short work of it.
2. Disable Your Active WordPress Theme
If you’ve made it this far down the list and still see the error, we can rule out plugins as the source. This means there are still themes and custom scripts to check. Let’s tackle the former first.
Fortunately, this process is very similar to step number two, so it should be a breeze for you. What we’re going to do is disable your active theme using FTP, to see if it’s the source of the error. Here are the steps you should follow:
- Access your server using an FTP client.
- Locate and access your WordPress root folder.
- Go into the wp-content/themes directory.
- Look for a folder that shares the same (or a similar name) to your active theme.
- Once you identify it, right-click your theme’s folder, choose the Rename option.
- Change your theme name to something similar as mytheme-deactivated
- Go to your WordPress website just like you would any other time.
By now, you know the drill. If you can access your WordPress site without running into a 503 service unavailable error, your theme was behind it. You’ll also notice your website probably looks different. That’s because deleting your theme’s folder forces WordPress to replace it with a default one:
Naturally, you’ll want to get your old theme back. However, that may mean you’ll run into the error again. With that in mind, we recommend re-downloading the theme from its provider and making sure you’re using the latest version. As with the previous solution, you’ll also want to contact the developer for a fix.
If the error persists, you’ll have no choice but to start looking for theme alternatives. You could also use one of the theme’s older versions – if it’s available – but that’s not something we recommend. After all, old software is often more vulnerable to attacks.
3. Enable WordPress’ Debug Feature to Track the Source of the 503 Error
So far, we’ve ruled out server-side errors, plugins, and themes as potential culprits for the error. That means there’s only one thing left on our list: custom scripts. The problem here is that most people lose track of their custom code additions. WordPress has a lot of files, so finding the right one and narrowing down the exact lines that cause the error is like looking for a needle in a haystack. What you need is a metaphorical metal detector, and WordPress includes one in the form of a debugging feature.
First, since it’s turned off by default, we need to enable it. To do that, you’ll need to open your FTP client and follow these instructions:
- Access your WordPress root folder.
- Look for the wp-config.php file.
- Right-click the file and choose the View/Edit option, which will open it using your default text editor.
- Look for the line that says That’s all, stop editing! Happy blogging near the end of the file.
- Above this line, enter this:
@ini_set( 'display_errors', 1 );
- Save changes and close the file. Go to your website, which should trigger the 503 error.
Let’s take a minute to break down what just happened. Adding that line of code to the wp-config.php file tells WordPress it should turn on the error display feature. It will display a detailed error message instead of generic one (like 503 Service Unavailable Error).
Since we haven’t fixed the 503 error yet, visiting your site should’ve triggered it. Then, WordPress will show a detailed summary of what happened when you tried accessing your website.
In most cases, the error message will also mention which file causing the error, as well as the specific line of code it was trying to execute. That gives you all the information you need to find the file using your FTP client and make necessary changes. In our example, 503 error in WordPress is caused by wp-config.php file. Carrying out an internet search should bring up instances from other users, which may reveal a fix.
Due to security reasons, it’s strongly recommended to turn off error reporting once you have fixed your WordPress. You can do so by reverting changes made to wp-config.php file.
4. Contact Your Web Hosting Provider
If your website is receiving a massive influx of traffic – be it legitimate or malicious – it’s usually not something you alone can solve. To fix the problem, you’ll need to contact your web host’s support team.
The first thing you need to ask is whether there’s any unusual traffic activity on your website. Whichever agent you’re talking to should be able to ascertain if that’s the case in minutes, and maybe even tell if you’re indeed dealing with an attack. At that point, one of several things may happen:
- They may temporarily upgrade your plan to deal with the spike in traffic, if it’s possible for them to do so.
- You may be asked to move to a better plan that can handle the traffic you’re receiving.
- They may be able to implement some defense against the DDoS attack, if that’s the cause of your problems.
- You may be told to sit tight and wait until the traffic wave dies down on its own.
A good web host will stick to answers one through three, since they’re proactive ways of dealing with the problem. If on the other hand, someone just tells you to wait until the service is back up again, you probably should consider migrating to a host that takes better care of its users. If the spike in traffic didn’t come from an attack, it may be time for you to consider upgrading your hosting plan permanently anyway. That way, you won’t run into the same problem again.
Finally, you’ll notice we didn’t discuss the possibility of the 503 service unavailable error being caused by downtime on your server. It could happen, of course. However, most modern web hosts have amazing uptime records, so random server crashes are very rare.
How to Avoid Future 503 Server-Based Errors in WordPress (2 Tips)
Before we entered the troubleshooting rabbit hole, we talked about how spikes in traffic can cause 503 errors. If you want to avoid running into this issue in the future, there are two things you can do to be proactive.
1. Upgrade to a Better Hosting Plan
The more powerful your hosting plan is, the fewer issues it should have handling large amounts of visitors. Our free plans are great for small to medium sites, for example, but if your site needs a bit more kick, that’ll become apparent quickly.
Once your website outgrows your current hosting plan, you’ll notice that it starts to feel slow all the time. That’s a great indicator you’re ready for an upgrade, and we suggest starting with Hostinger’s WordPress plans. They offer lots of useful features, and can handle any type of website you throw at them.
2. Use a Content Delivery Network (CDN)
CDNs are groups of servers that take your site, make copies of its pages, and serve them whenever necessary. Think about them as an intermediary between you and your visitors. The great thing about CDNs is that they lessen the load on your servers. Plus, since they’re spread all over the world, they’re often faster than yours. Best of all, they can protect your site in case you’re facing a DDoS attack or a traffic spike.
In most cases, there’s no downside to integrating a CDN into WordPress. Although, there is no guarantee you will not get a different kind of errors. When you’re ready to go, here’s a quick guide to help you integrate Cloudflare with WordPress. If the process runs smoothly, you could be up and running with Cloudflare within the hour.
The 503 service unavailable error for WordPress can be a bit of a headache. However, fixing it isn’t particularly difficult. It does require you to be methodical, but you should have your website up and running again in no time. Plus, if you can tackle this particular error, you shouldn’t have problems troubleshooting anything else that WordPress throws your way.
Let’s recap the four steps you need to take to fix the 503 error. Keep in mind that you’ll need an FTP client for most of them, so download one if you haven’t yet (we recommend FileZilla):
- Disable your WordPress plugins.
- Disable your active WordPress theme.
- Enable WordPress’ error display feature to track down the source of the error.
- Contact your web hosting provider.
Do you have any questions about how to fix the 503 service unavailable error in WordPress? Let’s talk about them in the comments section below!
This post was last modified on February 27, 2018, 10:06 am