How to Troubleshoot and Fix 503 Errors on Your WordPress Website

How to Fix the HTTP 503 Service Unavailable Error in WordPress

When you see an error on your WordPress website, your first reaction might be to feel annoyed and frustrated. But don’t worry! Most errors are actually quite simple to resolve.

The 503 Service Unavailable error is one example. While it can seem technical and confusing, it’s actually quite a straightforward error.

The solutions are both also easy to do and don’t require any deep technical knowledge.

In this post, we’ll walk you through fixing the 503 Service Unavailable error.

First, we’ll discuss what causes this error and why you are probably seeing it. Then, we’ll go through seven different possible solutions to fix it. Finally, we’ll talk about how you can avoid seeing this error in the first place.

Ready to fix the 503 Service Unavailable error? Let’s get started!

What Is the 503 Service Unavailable Error?

503 error example

The HTTP 503 Service Unavailable Error indicates that your website’s server is unavailable and cannot load your page. There are a few different variations of its name, but it will usually look something like this:

  • 503 Error
  • HTTP 503 Error
  • HTTP Error 503
  • 503 – HTTP Error
  • 503 Service Unavailable
  • Service Unavailable
  • The server is currently unavailable
  • The server is too busy right now, please try again later

If we look at technical documentation, we can see more detail about exactly what this means.

W3C logo

W3.org defines the 503 error as:

The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay MAY be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response.

They also have a note indicating that if a server is overloaded, that doesn’t mean it will always display the 503 error. Sometimes it just won’t connect at all.

Note: The existence of the 503 status code does not imply that a server must use it when becoming overloaded. Some servers may wish to simply refuse the connection.

And Mozilla (makers of the Firefox browser) has a similar definition:

The HyperText Transfer Protocol (HTTP) 503 Service Unavailable server error response code indicates that the server is not ready to handle the request.

Common causes are a server that is down for maintenance or that is overloaded. This response should be used for temporary conditions and the Retry-After HTTP header should, if possible, contain the estimated time for the recovery of the service.

Importantly, this error means that your website is online but cannot be reached for whatever reason.

This is unlike some other errors which show that your website is offline entirely or that there is an issue with your DNS settings. For example, DNS_PROBE_FINISHED_NXDOMAIN indicates that your domain could not be found.

Beyond this, the error message doesn’t contain much information as to how you should fix it. It will usually just say, “Service Unavailable”, which doesn’t help us diagnose the problem.

Not to worry, though, we’ll go through all of the most likely causes of the problem and show you how to address them.

A quick note: if you visit the front end of your WordPress site during a plugin or theme update, you may see this message. If you are currently in the middle of updating things, just wait a few minutes and refresh the page.

If the error goes away, that was most likely the cause.

What Causes the 503 Service Unavailable Error?

So, what causes the error? There are many reasons as to why this happens. The server is down, it’s too busy, it’s being repaired or maintained, or that there is an issue with your particular site’s relationship to the server.

It can also be an issue with the code on your site, usually within a particular plugin.

Your Server Is Overloaded

If your server cannot handle the current amount of traffic that it is receiving, you will likely receive the 503 error. This is a common problem for sites using shared hosting plans, which are at the cheapest end of the hosting spectrum.

Because you are sharing a server, other sites on it also consume server resources.

A Problematic Plugin or Theme

Sometimes, a plugin or theme that has been improperly coded can cause the 503 error. This is usually an issue with the PHP code of the plugin/theme, which then causes a problem with the server. This is why you should only install reliable plugins from reliable sources.

A Code Snippet Gone Rogue

If you have added a custom code snippet to your site, it can cause the 503 error. If you add any custom code, be sure to check it in a tool like PHPCodeChecker.com.

PHP code checker website

In addition, you should always be very careful when adding custom code (especially JavaScript and PHP) to your site if you aren’t a programmer. It’s very easy to take your site offline with a few misplaced keystrokes!

Maintenance

If your server is under maintenance, it will normally display the 503 error. Usually there will be a message that indicates that maintenance is underway.

For example, WordPress will display a brief message indicating that the site is under maintenance. This happens when you update plugins or themes that are active and enabled.

Website under maintenance notification

Most reputable hosts will give you a warning before doing significant maintenance. Most reputable hosts will have mirrored servers which means your website will always be available regardless of what maintenance may be happening at the time.

Server Glitch

Sometimes, there are minor glitches, errors, or other problems with the server. If you use a web hosting plan (i.e. don’t own your own servers) then this is somewhat out of your control. Just wait a bit and see if the error is resolved.

Depending on your web host, you can also contact support via chat and/or email and see if they are aware of the error. Most hosts like SiteGround have on-demand chat support.

DDOS Attack

Finally, an infrequent but possible cause is that your server is being DDOSed. This is unlikely, but still happens.

As a DDOS attack is essentially the same thing as overloading your server, you will receive the same 503 message.

How to Fix the 503 Service Unavailable Error

Now that we know what the 503 Service Unavailable Error is and what causes it, let’s solve it!

As mentioned above, there are many different possible causes of the error. Thus there are many different potential solutions.

Let’s go through each of them, step by step.

1. Wait a Few Minutes and Refresh

Before doing anything, it is a good idea to just wait a few minutes and refresh your site. Oftentimes, server issues will be resolved quickly by your host in a matter of minutes.

2. Try a Different Browser and Use Incognito Mode

Browser incognito mode

Likewise, sometimes your cookies and cache can interfere with the site. Try visiting your site from a different browser in “private” or “incognito” mode.

3. Deactivate and Troubleshoot Your WordPress Plugins

Still have the error? Then, the first thing you should do is troubleshoot your plugins. This way, we can figure out if the problem is caused by your site itself or if the problem is with the server.

To troubleshoot your plugins, you’ll need to deactivate them. Unfortunately, you can’t do this the normal way in the WordPress dashboard, as your site is inaccessible due to the 503 error.

So, to connect to your site, you’ll need to use FTP/SFTP or SSH. If you don’t have a FTP client, we generally recommend FileZilla.

FileZilla website

Connect to your site. If you don’t know what credentials you’ll need, ask your host or search for “[host name] connect FTP]”. For instance, here are some guides to connecting via FTP for SiteGround.

Once you’ve connected, find the wp-content folder and click on it. Then, find the plugins folder.

WordPress wp-content folder

Rename this folder to old-plugins. Then, create a new folder and name it plugins. This will deactivate all of the plugins on your site.

Open your WordPress site in your browser and see if the 503 error is still there.

  • If you still see the 503 error, then the issue is unrelated to the plugins. Delete the new plugins folder you created and then rename old-plugins back to just plugins.

    Note that your plugins will all be deactivated, so you’ll need to reactivate them in the WordPress dashboard (later, after you’ve regained access to it.)
  • If you don’t see the 503 error, that means the error is likely caused by a plugin. To find out which one it is, go to your plugins panel in the WordPress dashboard and reactivate the plugins one at a time, checking the home page after each one.

    When you discover the culprit, connect to your site via FTP/SFTP or SSH again. Navigate to the wp-content/plugins directory and delete the folder for that specific plugin.

4. Deactivate Your WordPress Theme

WordPress themes from dashboard

Similarly to plugins, a theme can often cause this issue, especially if it’s a customized or non-standard one.

To deactivate your theme, first connect to your site via FTP/SFTP or SSH. In the wp-content folder, find the themes folder.

Find the theme that you have activated now and download it to your computer for safekeeping. Then, delete it from the web server.

WordPress theme in folder

Go back to your site and see if the 503 error is still there.

  • If the error is still there, then the issue wasn’t the theme. You can safely reinstall it.
  • If the error is no longer there, then you know that the theme was the cause. Contact the theme’s developer to see if they can fix the issue and use a different one until they do.

5. Enable WP_DEBUG

Debug mode is a setting in WordPress that will display a log of any PHP errors (and other errors) right on your site. It’s an excellent way to see exactly what the source of an issue is.

WordPress debug error

There are two ways to enable debug mode: with a plugin and by editing the wp-config.php file.

Unfortunately, since we are locked out of our site by the 503 error, we can’t install and activate a new plugin. So, we have to modify the wp-config.php file.

If you’re unfamiliar with WP_DEBUG, check out our full guide to enabling debug mode in WordPress.

Otherwise, you need to access your site via FTP/SFTP or SSH. Go to your public_html folder and find the wp-config.php file.

Right click to edit it, then find the text that says “That’s all, stop editing! Happy publishing.”

Just before that line, add the following code:

define( 'WP_DEBUG', true);
define( 'WP_DEBUG_LOG', true);
enable wp_dubug

Finally, go back to your website and repeat the steps that led to the error. Once you receive the 503 error again, switch back to your FTP/SFTP client and open the file at public_html/wp-content/debug.log.

You should see a list of any errors, one of which hopefully indicates what is causing your 503 issue.

6. Limit the WordPress ‘Heartbeat’ API

The WordPress Heartbeat API communicates with your server using AJAX, which allows it to display some information in your WordPress dashboard in real time.

For example, it will display if a post is being edited by another user, so that you can avoid overlapping.

While the heartbeat is useful, it’s not essential, and sometimes it can cause issues by sending too many requests to your server.

Normally, to disable the heartbeat, you can install the Heartbeat Control plugin. However, if you have the 503 error, you won’t be able to access your site’s control panel.

WordPress heartbeat API

In this case, you’ll need to connect to your site via FTP/SFTP or SSH and find the functions.php file. It is in the folder for your theme, which is at ​​wp-content/themes/your-theme, replacing your-theme with your current theme name.

In the functions.php file, add the following code:

add_action( 'init', 'stop_heartbeat', 1 );
function stop_heartbeat() {
wp_deregister_script('heartbeat');
}

Then save and reload your website. Is the error there?

This code will be erased when you update your theme. So, once you regain access to your site, we recommend creating a child theme, using the Custom Layouts Module in Astra Pro, or using the Heartbeat Control plugin we mentioned earlier.

7. Increase Server Resources

As the 503 HTTP error is a server error, the issue is sometimes simply a lack of server resources. This often happens if you are on a shared hosting plan or are using a very inexpensive hosting service.

The easy solution here is to upgrade your host. We generally recommend a managed WordPress host, as they can help solve many of these issues for you.

However, you can also try upgrading the PHP memory limit on your WordPress website. You have four different ways for doing this, all of which require you to access your site via FTP/SFTP or SSH. Try one of the options below:

  • Add memory_limit = 256M; to the php.ini file.
  • Add ini_set(‘memory_limit’,’256M’); to the wp-config.php file.
  • Add define(‘WP_MEMORY_LIMIT’,’256M’); to the wp-config.php file.
  • Add php_value memory_limit 256M to the .htaccess file.

8. Temporarily Disable Your Content Delivery Network (CDN)

Finally, a CDN can sometimes be the culprit when it comes to the HTTP 503 Error. While CloudFlare and other services usually prevent the error from happening, sometimes there can be minor conflicts in the data center that cause it.

Try disabling your CDN and then revisiting your site. If it loads successfully, get in touch with your CDN and tell them about the issue.

Can You Prevent the 503 Service Unavailable Error?

As they say, the best way to solve a problem is to avoid it in the first place! So are there any ways in which you can avoid dealing with the 503 Service Unavailable Error to begin with?

There are two very easy solutions to prevent the error.

Upgrade to a Better Hosting Plan

The simplest way to avoid the 503 Service Unavailable Error is to upgrade to a better hosting plan (on your current host) or to a better host company entirely.

Many of the causes of the error come down to not having enough server resources or issues related to your web server. So, upgrading your host is a simple way to solve this problem.

SiteGround web hosting

When it comes to upgrading your web hosting, there are two options:

  • Pick a better hosting plan on your current hosting provider
  • Pick a different hosting provider altogether

We typically recommend using a managed WordPress hosting plan, such as SiteGround or WPEngine.

Use a Content Delivery Network (CDN)

Another way to prevent the HTTP Error 503 error is to use a CDN like Cloudflare. These services will protect your site against a variety of threats, including traffic overload.

They will also reduce the actual amount of bandwidth that is required to deliver your site to viewers, which lessens the potential for server issues.

Cloudflare homepage

This is especially relevant if you anticipate having a massive amount of traffic in a short period of time. For instance, if your site goes viral on Reddit or Twitter.

Fixing the 503 HTTP Service Error: A Wrap-up

Errors can be frustrating to deal with, especially if you aren’t technically-inclined. However, most of them are actually simple to solve if you know what to do.

The 503 Service Unavailable error is a common problem and it locks you out of your website. Thankfully, fixing it is usually pretty easy and doesn’t require much time or effort. Just go through the different steps we covered in this post.

Have you experienced the 503 HTTP Service Unavailable error? What was the cause? And how did you solve it? Share your solutions in the comments below!

Join 635,020 Subscribers

Get exclusive access to new tips, articles, guides, updates, and more.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
Now choose your preferred
page builder addon
Choose your preferred page builder addon

Download is Just A Click Away!

Be among the first to try the beta version of Astra’s Header Footer Builder. Filling the form will ensure you’ll be the first to learn about updates and features.

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.