What is Error 503 Service Unavailable in WordPress – How to Fix It?
An Error 503 Service Unavailable is not an error inherently associated with WordPress sites, it’s an error that can appear for any type of website. In this article, we’ve chosen to discuss potential fixes should this error appear on a WordPress website, so you’ll be prepared and know what to do if you ever come across this error.
There are a lot of issues that could cause an Error 503 Service Unavailable, and some of these errors may be related to the content management system that you’re using (in this case WordPress), while in other cases the error is a result of some issue with your server.
Before we explore the different ways to fix an Error 503 Service Unavailable, let’s see what it is.
What is Error 503 Service Unavailable?
As opposed to a 404 Not Found Error, which pops up when the server could not find the resource that was being accessed, a 503 Service Unavailable appears when a resource is being accessed and the server is temporarily unavailable. Thus, the resource that’s being accessed does exist just that the server is currently unavailable to handle the request.
As for the potential causes, here are the most common ones that may set off a 503 Error:
- PHP scripts: often, the inability of a plugin or theme to load at the server’s request will return a 503 Error;
- Custom scripts: recently added custom scripts to your WordPress website can be another possible cause;
- Server downtime: depending on your web host, your server may be temporarily unavailable due to maintenance or overloading;
- Distributed Denial of Service (DDoS) attacks: if your site falls prey to a DDoS attack, which floods your website with traffic, thus, rendering it unavailable because of the overwhelming traffic.
Next, let’s see how to fix an Error 503 Service Unavailable in WordPress, and what can you do to avoid its occurrence in the future.
Tired of Getting Errors on Your WordPress Site?
Move your WordPress website to a reliable web hosting company, who is able to provide you with reliable and secure service. BlueHost is a versatile web hosting provider that we recommend for hosting your WordPress blogs or websites.
How To Fix Error 503 Service Unavailable?
If the likely cause of the Error 503 Service Unavailable is a problem with WordPress, here are some fixes you can try to solve the issue:
Like most people, you’re probably using multiple plugins, which could cause incompatibility issues. By disabling your plugins, then reactivating them one-by-one while checking if your WordPress site is still running, you’ll run into the plugin that caused the issue.
But how do you access your plugins if you are unable to access your dashboard by logging into the WordPress admin area? You’ll need to use an FTP client like FileZilla, which means that you’ll need to look up your FTP credentials to be able to transfer files to and from your server.
Once you’ve managed to log in to your server from FileZilla, follow the steps below to disable your plugins:
- Locate and open the public_html folder (WordPress root folder)
- Navigate to the wp-content directory
- Right click on the plugins folder and choose the Rename option
- Rename your plugins directory to plugins-deactivated
This will deactivate all your plugins and you should be able to access your WordPress website if the 503 Error was caused by a plugin incompatibility issue.
Next, you’ll need to head back to FileZilla, access the wp-content folder and rename your plugins-deactivated folder to its original name. This won’t reactivate your plugins, it will only make WordPress recognize them, so you can reactivate them one-by-one in your WordPress dashboard until you find the culprit. When you do, head back to FileZilla, and delete the corresponding plugin in the wp-content/plugins directory.
Now, let’s see what to do if the 503 Error is caused by your active WordPress theme.
Disable Your WordPress Theme
If a plugin incompatibility issue was not at fault, the culprit may be your WordPress theme. Here too, you’ll need to rely on an FTP client to get the job done.
Access the wp-content/themes directory and locate the folder of your active theme, then just as you renamed your plugins folder, do the same for the themes folder, i.e. mytheme-deactivated, and try to access your site. If you succeed, and at this point you’ll see the default WordPress theme instead of your old theme, it means that the Error 503 Service Unavailable was caused by your theme.
Make sure you download the latest version of your theme from the developer, and if the problem still persists even if you’re using the latest version of your theme, and the developer is unable to provide a fix, you’ll unfortunately need to find another theme.
Debug Custom Code
If neither plugins, not your theme were the causes of the error, it’s time to enable the Debug Feature in WordPress to see if any your custom code additions may have caused the problem.
To enable the Debug Feature, follow the steps below:
- Go to FileZilla and locate the WordPress root folder
- Look for the wp-config.php file
- Right click on it, then choose View/Edit, which will open the file in your text editor
- Locate the line That’s all, stop editing! Happy blogging
- Add the following code above that line: @ini_set( ‘display_errors’, 1 )
- Save changes, and close the file
This will enable the debugging feature, and will display an error message usually detailing the file and even the specific line of code that’s disrupting things. Thus, you can locate the file using FTP, and make the necessary changes to get things back to normal.
WordPress’ debugging feature is disabled by default due to security reasons, so if you’re done with the changes, we recommend disabling it.
Contact Your Web Host
If you suspect that you’re under a DDoS attack, or you have a legitimate traffic spike that’s causing downtime issue, get in touch with the support team of your web host as they’ll be able to evaluate the situation and offer a solution.
Your web host may recommend that you upgrade your hosting plan, or they may temporarily scale up your resources to be able to handle the influx of traffic, or implement defense mechanisms against a DDoS attack if the problem is caused by a DDoS attack.
If your web host is not proactive in helping you deal with the issue, you may want to consider migrating to another hosting company. For WordPress websites, we recommend choosing BlueHost since they offer multiple WordPress hosting plans built on VPS technology, and designed to meet the particularities of WordPress websites in terms of speed optimization, security, and performance. Read our BlueHost review if you want to find out more about this company.
As your website gets more traffic and stars to grow, you may notice that it will slow down, or you may downright face downtime issues.
Thus, we recommend that you upgrade your hosting plan to a better one to avoid such problems from occurring.
You may also want to consider integrating a Content Delivery Network with your WordPress website (we recommend MaxCDN), which will lessen the load on your server, and makes your website faster and more secure.
An Error 503 Service Unavailable may seem like a tough nut to crack at first, but if you follow our instructions step-by-step, you should be able to quickly deal with it.