Fix 503 Service Unavailable Error in WordPress
In this article, I will show you how to fix the 503 service unavailable error in WordPress.
The 503 service unavailable error is not in fact a WordPress-specific error. It is a general server error related to the server settings of your WordPress hosting provider.
Unfortunately, as this is a generic error code, it does not really tell you anything useful, other than there is a problem on the server. The error results gives no clues about what is causing the problem, which makes it extremely frustrating for webmasters, both experienced and newbies.
Why do You Get a 503 Service Unavailable Error in WordPress?
The 503 Service Unavailable Error in WordPress occurs when the website you are on cannot connect to a proxy server or the connection itself times out.
The most common reasons for the error are:
- Low server resources. The server resources offered by WordPress hosting companies for each hosting account are not infinite. If the limits set cannot handle heavy usage, a 503 Service Unavailable Error results. This error is particularly prevalent on shared hosting accounts.
- The scripts or programs running on the site are taking too long or are nonresponsive.
- An external resource the site needs, like a web service or database, is slow or nonresponsive.
- A programmatic error on the site is preventing locked resources from being released.
- The site may be under attack, possibly a brute-force DDoS attack.
The 503 service unavailable error will go away as soon as the underlying problem is corrected. If the error is caused by heavy usage, a server glitch, or a DDoS attack, then it could automatically disappear, so please try your request again in a few minutes.
However, if your web server is unable to get a proper response from a PHP script, then it will keep occurring unless you find and disable the code causing the problem.
For WordPress users, the misbehaving PHP script is undoubtedly contained in a WordPress plugin, WordPress theme, or custom code snippet.
Check Your WordPress Hosting Company
An obvious, but often overlooked reason for the 503 Service Unavailable Error in WordPress, is maintenance on your server. Check with your hosting company before continuing.
How to Fix 503 Service Unavailable Error in WordPress
Assuming the error is continuous and not caused by heavy usage, a server glitch, or a DDoS attack, then the cause is probably some PHP script.
The fix for this is really quite simple, but tedious. Disable all unnecessary PHP scripts one at a time until the misbehaving code is found.
Step 1: Deactivate All WordPress Plugins
As a WordPress plugin, especially if you just installed one, is the probable cause of the error, the first thing you need to do is deactivate all your WordPress plugins.
Unfortunately, as you cannot login to your WordPress dashboard due to the 503 server error, this task must be done using an FTP client or your cPanel File Manager.
Once connected to your server you will need to rename the current plugins folder and then create a new plugins folder:
- Go to the /wp-content/ folder and rename the plugins folder to plugins-corrupt
- Create a new folder and name it plugins
All your WordPress plugins are now deactivated.
Next, visit your WordPress site to see if this resolves the 503 server error. If the error has been resolved, then a plugin installed on your website was causing the error.
Irrespective of the outcome, you now need to restore your plugin files.
Still using your FTP client or cPanel File Manager, restore the original plugins folder.
- Delete the empty plugins folder you just created
- Rename the plugins-corrupt folder to plugins
This will make all your installed plug-ins available to WordPress again. However, these plug-ins will remain deactivated, and must be re-activated from your WordPress dashboard.
If Plugin Causing 503 Server Error
If a WordPress plugin was causing the 503 server error you should be able to login to your WordPress admin area.
When you have logged in:
- Go to the plugins page
- Activate your plugins one at a time
- Visit several pages on your site to check usability
- Repeat untill you find the plugin causing the 503 server error
- When found, disable the plugin. You may have to revert to your FTP client or cPanel File Manager again for this step.
- Finally, report the problem to the plug-in’s. author.
If this step resolved the 503 error problem, then you do not need to follow the rest of these instructions. You are done.
Switch to a Default WordPress Theme
If deactivating plugins didn’t resolve the issue, the next step is to switch to a default WordPress theme.
- This will deactivate your current, active, WordPress theme.
Connect to your WordPress site using an FTP client or cPanel File Manager.
Once connected, go to the /wp-content/themes/ folder.
Check that you have one of the default WordPress themes installed.
- Any of the default WordPress themes from Twenty Ten, to Twenty Eighteen will do.
If you do not have one of the default WordPress themes, then you will need to upload a default theme to your website before continuing.
- Next, download your current, active, WordPress theme to your computer as backup.
- After downloading your current, active, theme, delete it from your website
With your theme deleted, the default WordPress theme will be automatically activated.
Check your website to make sure the 503 service unavailable error is resolved.
How to Fix 503 Service Unavailable Error in WordPress Final Thoughts
If the 503 service unavailable error was not caused by a WordPress plugin or WordPress theme, then take the following actions:
- Check your site’s error log for more information.
- Check if temporary files, cache files, or session files are building up somewhere like your /tmp directory.
- Contact your WordPress hosting company and ask for help. Their tech support may be able to pinpoint the cause of the problem.
- Check your traffic in Google Analytics to see if you are getting more traffic than usual. Do not assume the problem is a lack of system resources. Although it is tempting to automatically assume this is the problem, it is rarely the case.
- Check for slow database queries or locking issues.
- Make sure you do not have rewrite logs enabled.
Well, I hope you liked this tutorial and found it helpful. If you have any comment, corrections or items you think should be added to, ‘How to Fix 503 Service Unavailable Error in WordPress’, please do not hesitate to let me have them in the comment box below.