WordPress ошибка 503

Themeisle content is free. When you purchase through referral links on our site, we earn a commission. Learn More

Have you encountered the 503 error on your WordPress site? It’s a common WordPress error that can be fixed by following the steps we have covered in today’s tutorial.

Some of these steps may look technical, but they actually don’t require any deep technical knowledge.

In this article, we will first discuss what caused the 503 error in WordPress, then we will show you all potential solutions and how you can prevent encountering the 503 error in the future.

Let’s dive in!

What is the 503 error? What causes it?

The 503 error occurs when your website server cannot be reached – i.e., the server is unavailable. The reasons for unavailability can be a badly coded plugin or theme, a code snippet gone rogue, a glitch in the server, a DDoS attack, or quality issues with your hosting service overall.

Let’s take a deeper look at each of the causes:

Badly coded plugin or theme:

Commonly, the 503 error appears when you install or update a badly coded plugin or theme. When the plugin or theme cannot function properly, it causes WordPress to throw the 503 error.

Code snippet gone rogue:

Customizing a WordPress site is super easy. You can add some CSS code here, upload a PHP script there, and modify the site based on your needs. But, a piece of bad custom code can cause a lot of trouble. The 503 error you are experiencing could be due to such a bad code snippet.

Technical issues of the server:

Your server could be down because it’s under maintenance, or because of some other scheduled work. Usually, any issues resulting from these reasons disappear after a couple of hours. That said, hosting providers should have mirror servers to ensure that the sites are up and running during maintenance.

A DDoS attack :

Although this does not happen very frequently, the 503 error might have been produced due to an attack made on your website. DDoS attacks, in particular, are often associated with 503 errors. That’s because, in these types of attacks, hackers send a ton of traffic to your website so that the server gets overloaded and crashes your site. Read more about DDoS attacks on WordPress sites and how to mitigate the risk here.

These are the typical reasons that cause the 503 error on WordPress sites.

It’s worth noting that there are a few different variations of the error:

  • “503 Service Unavailable”
  • “503 Service Temporarily Unavailable”
  • “HTTP Server Error 503”
  • “HTTP Error 503”
  • “Error 503 Service Unavailable”
  • “The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.”

👉 The solutions that we have covered below should fix any 503 error on a WordPress website.

The exact fix that is going to work for you depends on the root cause. The 503 error itself does not give you much information to go on. So in this section, we will show you a number of steps to follow in order to pinpoint the cause and then fix it.

Before we dive into the solutions, make sure you are carrying out the following preliminary steps:

The 503 error WordPress also occurs when you are updating a plugin or a theme. You might want to check your website again to see if it was a temporary issue. Just make sure you cleared the cache before checking the site.

As I mentioned earlier, sometimes the 503 error occurs because of maintenance work on your web server. You must have been alerted about it via email by your hosting provider. In a typical maintenance alert, you are informed about how long the server is expected to be down. So check your email.

bluehost scheduled maintenance email
Bluehost scheduled maintenance email

If the error appeared right after you added a code snippet to your website, then you know who the culprit is. Remove the code and your website should go back to normal. But if you’ve lost access to your dashboard, then we suggest restoring a backup of your website. Your hosting provider should be able to help you out with this.

Nothing worked? Then let’s try the steps below.

1. Deactivate plugins temporarily

503 errors are commonly caused by plugins that you have installed on your site. To determine if a plugin caused the error, you will need to disable all the plugins only temporarily.

The 503 error prevents you from accessing the dashboard, so you will have to use an FTP client like FileZilla.

Open FileZilla, connect with your site, and navigate to the public_html directory. Open the folder and navigate to the wp-content. Inside this directory, you’ll find another one called plugins. It contains all your site’s plugins (active and inactive). Rename the plugins directory to plugins_ or whatever else. This will deactivate every plugin on your site.

editing plugins folder
Disabling all plugins by renaming the main plugin directory

Go back to your site again and see if the 503 error is gone. If it is, then it’s safe to assume that a plugin was causing the error.

Now, it’s time to pinpoint the exact plugin that’s causing the issues.

Go back to FileZilla, change back the name of your plugins directory to the original (“plugins”). Go inside and start working through all your plugins one by one. Do this:

  1. Change the name of the first plugin in the directory to something else.
  2. Check the website to see if the error is gone.
  3. If it is indeed gone, you’ve found your culprit. If not, change back the name of that first plugin and proceed to test the next one the same way.
  4. Repeat until you find the plugin that’s causing the problems.

Once you find the plugin causing the error, it’s best to just delete it and look for an alternative. If none of your plugins is causing the 503 error, then try the next solution.

2. Deactivate your theme temporarily

Deactivating the theme is a bit tricky because you can’t simply rename the theme folder as we did with the plugins folder. It would lead to an error of its own.

So here’s what you need to do: log into your hosting account, go to the cPanel section and open the phpMyAdmin.

Select wp_options and go to Search. Under option_name, write template and click on Go.

changing wordpress theme in phpmyadmin
Finding your current theme in PHPMyAdmin

The system will run a search and then show you your current theme under option_value. Select Edit and change the current theme to twentytwentyone.

editing option value in phpmyadmin
Editing current theme in PHPMyAdmin

If this fixes the error, then you might want to try getting an earlier version of the theme (one that worked), installing it, and waiting for the theme’s developer to release an update. Or, you can switch to a different theme altogether if that’s an option.

3. Disable your CDN temporarily

Occasionally, CDNs are known to cause 503 errors, so disabling it – if you have one working on your site – can be a quick solution. All CDNs have some option that allows you to pause them manually. For instance, on Cloudflare, you need to log into your account, select your website, and click on the Pause Cloudflare on site option.

Next, check your website and if the 503 error persists, then unpause the CDN and try the next solution.

4. Limit WordPress Heartbeat API

The Heartbeat API is responsible for several essential functions, like auto-saving posts, showing plugin notifications, preventing you from accessing a post when someone else is modifying it, etc.

The API uses your server resources to carry out these functions. If your server can’t handle the API’s demands, it will throw a 503 error. To determine if the Heartbeat API is causing the error, you need to disable it temporarily.

Open your FTP client (FileZilla), connect to your website and go to public_html → wp-content → themes. Open the current theme directory and download a copy of the functions.php file, then edit it.

function.php file location -  503 error fix
Locating function.php file

Add the following code snippet right after the opening <?php tag:

add_action( 'init', 'stop_heartbeat', 1 );
function stop_heartbeat() {
wp_deregister_script('heartbeat')
}
editing function.php file to fix 503 error
Inserting code snippet in function.php file

Save the file, reupload it, and check your website. If the error disappears, then you’ve caught the culprit.

But remember, the Heartbeat API is essential, so you can’t keep it disabled long term. You can slow down its frequency if you feel like it by installing the Heartbeat control plugin. Just make sure to delete the code snippet from the functions.php file before setting up the plugin.

5. Enable WP_DEBUG

When all other solutions fail, enabling the debug mode could give you answers.

You can enable the debug mode using a plugin or by modifying the wp-config file.

Since the 503 error prevents you from accessing the dashboard, installing a plugin is out of the question. So you have to modify the wp-config file manually.

Open your FTP client (FileZilla), go to public_html → wp-config.php and download a copy of the file, then edit it. Insert the following code snippet into it:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

Save the file and reupload it.

editing wpconfig file to fix 503 error
Inserting code snippet in wp-config.php file

Now go to the wp-content directory, and you should find a debug.log file in there.

The log file contains errors that your website has been experiencing. It’ll show you the causes of the error along with specific lines of code that led to it. You are not going to find a direct indication of the 503 error, so we suggest showing the log to your hosting provider and seeking help with them.

👉 By now, you should have a solution to the 503 WordPress error. However, you should ensure that it never occurs on your site in the future again.

Preventing 503 error WordPress in the future

You can prevent the 503 error from appearing on your website by following the instructions below:

  • Use themes and plugins from the WordPress repository or trusted developers (like Themeisle). Read how to choose a theme and how to choose a plugin for more information.
  • Move to a better hosting plan if your site requires more resources to function properly.
  • Use a firewall to prevent DDoS attacks.
  • Install or update plugins on a staging site before carrying them out on the live site.

That’s it folks! With that, we have come to the end of this article.

I hope that you found this guide easy to follow and helpful. If you have any questions, let us know in the comments below.

Free guide

4 Essential Steps to Speed Up
Your WordPress Website

Follow the simple steps in our 4-part mini series
and reduce your loading times by 50-80%. 🚀

Free Access

Updated on

 How to Fix 503 Service Unavailable Error WordPress

HTTP 503 Error WordPress

Table of Contents [TOC]

  • HTTP 503 Error WordPress
    • What Is 503 the Service is Unavailable error?
    • http error 503. the service is unavailable Error Causes
      • By incorrect configuration
  • How to Fix the HTTP error 503 Service Unavailable in WordPress?
    • Disable WordPress plugins
    • Remove and deactivate WP theme
    • Enable WP_DEBUG
    • Faulty PHP CODE
    • Limit Google’s Crawl Rate (Server-Related)
    • Limit WordPress Heartbeat
  • How To Prevent HTTP 503 error in WordPress
    • Upgrade to a Better Hosting Plan
    • Use a Content Delivery Network (CDN)
    • Summary: http error 503. the service is unavailable.
    • Like this:
    • Related

WordPress is the most popular and used CMS in the world, has a super simple interface and also does not require much technical knowledge so we can get it going. However, there are situations in which we can find several errors that are not easy to solve, as in the case of ⚠️ 503 service unavailable WordPress error.

We are going to dedicate this article to this particular error, so that you will learn how to fix 503 service unavailable error in WordPress and you will also discover why it happens.

What Is 503 the Service is Unavailable error?

On the Internet, there are different codes to designate the different types of errors with which we can cross in certain situations. For example, a 404 error indicates that the requested content has not been found, just as a 403 error indicates that there is a File and Folder Permissions Error in WordPress site, an error 500 means internal server error.

In the world of hosting, error 503 ⚠️ means that the server has received our request but has not been able to process it.

503-service-unavailable-error-example-wordpress

When you encounter 503 error with WordPress, it means that the server in question is unavailable. Most of the time, it just shows up with a “Service temporarily unavailable” message.If you’re lucky, the 503 error code will have occurred because your WordPress website is under maintenance.

WordPress very briefly sets your site to maintenance mode when you’re updating a plugin, a theme, or the core software. ?[Fix WordPress Stuck in Maintenance Mode – Tutorial]

To understand it, we must know how a server works. To stop beating around the bush, our basic explanation is that the browser sends a request or number of requests to the server.

This responds with a code and dispatching the site, the mentioned code is usually 200 to indicate that the request was successfully dispatched. In case of any problem, the response code will change and a 503 error⚠️ indicates that there was indeed a problem.

For example, you can see these error codes instead:

  • ⚠️ 503 Service Unavailable
  • ⚠️ Http/1.1 Service Unavailable
  • ⚠️ HTTP Server Error 503
  • ⚠️ 503 Error
  • ⚠️ HTTP 503
  • ⚠️ HTTP Error 503

In this tutorial, we will show how to debug and fix http 503 service error in WordPress sites. Firstly, you need to understand what are the most common causes of Error 503 (Service Temporarily Unavailable) . After that, you’ll need to follow several steps in order to locate the root cause and fix HTTP 503 Service Unavailable Error in WordPress.

http error 503. the service is unavailable Error Causes

The 503 error is a distribution server error that occurs when your server cannot distribute a file to another server. It means there is a problem with the file or with your hosting provider. Sometimes, this error can occur if you have made changes to your website but forgot to update some plugins or themes. Or, if you were trying to access files on your website, but they were not uploaded correctly.

In most cases, this error occurs when there is a problem with your web host’s server or network connection. You may also see this message if someone else has tried to access your site at the same time as you (this happens often).

A 503 Service Unavailable on Fresh Install or on an already running site can be caused by  a number of things including (but not limited to):

  • Infected plugins or themes – [Read How to scan Malware in WordPress Themes ]
  • A misbehaving custom PHP script – [Read Web Shell PHP Exploit]
  • Insufficient server resources – [Read This Account Has Been Suspended – WordPress Down ]
  • Server glitches – [Read Error Establishing a Database Connection in WordPress, File Type Is Not Permitted For Security Reasons ]
  • WordPress Malware attack/hack – [Also Read ?How To Remove Malware in WordPress site]
  • You may be doing some maintenance at that time. For example, if you are making a backup of your website or if you are optimizing WordPress images with a plugin, this implies a normally high resource consumption, which can lead to a 503 error.
  • It could also be a configuration problem. If you have manually entered rules in the .htaccess file or some code in a php file (for example, to do a redirect or to configure Google Analytics) and you have made a mistake, the file may behave incorrectly and this may lead to an error 503 (although the most normal thing is that it results in a 500 error).
  • The interactions between plugins and templates can also affect. Each WordPress component is usually programmed by a different development team, which may cause incompatibilities not known to each other. These incompatibilities will result in high consumption of resources and, as a consequence, ends up in an error 503.
  • A peak in website traffic can cause a 503 error if you have not taken the appropriate measures.
  • The most common is that your website has just grown and you need to buy bigger hosting or with better maintenance.

As you can see, there are many possible causes for a 503 error. Therefore, you have to go step by step, testing and discarding possibilities until you find the origin of your specific problem.

“Through error 503, the server is telling you: “Right now I am very busy. Please come back later.”

As we have been saying, error 503 is telling us that the web server at this time cannot send the requested resources. This can be a temporary error or it can be a fixed error, that is to say, it will not go “by itself”

There are several causes behind a 503 error, among which we can find problems at the level of the network, an error in the configuration of the DNS or the DNS zone of the domain in question, or even a problem of resources to dispatch the request (due to an overload, for example).

As we said, the causes of a 503 error can be several, and obviously, WordPress is not the only system that can present an error of this type, in fact, it can happen to virtually any kind of site.

Leaving aside already mentioned causes such as overloads, DNS problems or network failures, most of the 503 errors in WordPress have their origin in the use of their own scripts. Here, we are talking about those scripts that are not part of the default structure of WordPress, as well as it can also be given by problems generated at the level of plugins or even the side of the theme that we are using.

The causes of 503 service error in WordPress can be; problems at the server level as well as by some conflict on the site itself. This means that there is no universal solution for this error, but must be resolved according to each case.

By incorrect configuration

If modifying WordPress files you have caused a 503 service unavailable error, you have to restore the backup you have made of the files before modifying them. But what if you do not have a backup? Well, you have to do several things:

  • If it is a file of a plugin or theme, you can download it again from the official repository.
  • If this is not possible, you can see if your hosting provider has a recent copy of the file.
  • In both cases, you should go to the nearest tattoo studio to have the word ” BACKUP ” written on Comic Sans on the back of your hand. So surely for the next, you do not forget. 🙂

There will be situations in which you simply cannot know the origin of error 503. Especially, if your hosting plan is shared, you will not have access to some important logs for diagnosis; and anyway, some checks are very technical and you can escape.

That’s where the importance of the technical service of your hosting comes into play. If after following the guidelines of this article you are not clear about the problem, you should not hesitate to contact the experts of your hosting company.

Although sometimes they cannot give you a direct solution to the problem, surely they can help you to have a clearer picture of the situation and propose some solutions to the 503 error.

How to Fix the HTTP error 503 Service Unavailable in WordPress?

Fortunately, in general, this error is easy to solve, although reaching this solution may take some time depending on where the problem originates.

Based on the client-server model, several of the causes may be on the server side, in which case the one who will be responsible for resolving it will be the administrator of the server. If you have a good hosting provider, then it should not take long to solve a problem of this type that is originating at the server level.

But what happens if the error arises from our site? In that case, we must get down to work and first of all, examine the sources. We have mentioned some of the fixes you can implement in order to Fix ‘503 Service Unavailable’ WordPress Error

Disable WordPress plugins

In the case of plugins, the best thing we can do is start disabling them one by one.

This can be done directly from the WordPress administration panel, just enter there and you are deactivating the plugins one by one and testing the site, until you find the problematic one. What if you cannot access the panel because it also gives an error?

In that case, we have to put on gloves and get down to work, since we are going to deactivate the plugins from an FTP manager, although the cPanel file manager also works.

By means of an FTP manager, we will have to enter the wp-content/plugins folder of our site, and there we will see the folders of each plugin. What we will do is to remove permits (that is, assign permissions 000) one by one and testing the site.

Below are the steps in details to follow:

  • Access your server using an FTP client
  • Locate a file which is often named public_html WordPress root folder
  • Navigate to the wp-content directory from the root folder
  • Look for “plugins” folder, right-click on it, and choose the Rename option. Rename plugins folder with FileZilla

  • 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.

This process is similar to what we would do from the WordPress administrator, just keep in mind that you may need to reconfigure your plugins later. If you hit the problematic plugin, you can return the permissions to the previous ones, using the following setting should be enough:

  • 755 for all folders and sub-folders.
  • 644 for all files.

Great, you’ve found the problematic plugin but you have to leave it disabled because it breaks your site, what to do in that case?

In that situation, the help should come from the plugin programmer, which is the team or person who developed it, so get in touch with the developer of the problematic plugin and report the situation.

Remove and deactivate WP theme

If you have performed these procedures and do not find a problematic plugin, then there is a possibility that the error is caused by the theme or template you are using.

If so, you will have to perform the same process that you did with the plugins, but this time deactivating the theme.

You can do it from the WordPress administrator or, if it is not available, through FTP or a file manager. Remember that templates in WordPress are stored within wp-content/themes. Search your active theme there and put 000 permissions on it or change its name, and then test your site.

  • Get access to your cPanel using an FTP client.
  • Locate the wp-content/themes from the root directory.
  • Navigate to a folder that shares a similar name to your active theme.
  • Right-click on the theme’s folder and choose the Rename option.
  • Change your theme name to mytheme-deactivated
  • Go to your WordPress website and review it as a visitor.

If the web starts working then the 503 error is caused by your theme. You can try to download it again, maybe only one file is missing and that causes the error, or you will have to contact its creator and present the case. If you cannot get a solution on that side, then surely you have no choice but to change the theme of your site.

Enable WP_DEBUG

Finally, the other possible cause of our nightmares maybe some script we have on the site. In that case, the best option we can take is to enable the sample of errors, otherwise, it will be very difficult to find the problem by doing a manual search between scripts.

  • Enable WordPress Debug Feature

But since the 503 error often locks you out of your WordPress admin, we shall use WP_DEBUG and WP_DEBUG_LOG, WP_DEBUG_DISPLAY and @ini_set constants available to WordPress.

To enable debug mode in WordPress and write errors to a log file,  follow these steps:

  1. Open your WordPress directory via FTP or File Manager.
  2. Open the wp-config.php file
  3. Scroll down to where WP_DEBUG is defined. It looks like this define ('WP_DEBUG', false);. If it is missing, we will add it just above the line that says /*That's all, stop editing! Happy blogging.*/
  4. Insert the DEBUG magic codes. Just change the above define ('WP_DEBUG', false); code to:
    define ('WP_DEBUG', true);
    define ('WP_DEBUG_LOG', true);
    define ('WP_DEBUG_DISPLAY', false);
    @ini_set ('display_errors', 0);
  5. Save changes

enable-debug-in-wp-config

This file contains all the errors on your website. If your 503 service unavailable error is caused by a custom code snippet, it will show up somewhere with details of the error.

Faulty PHP CODE

To enable the sample of errors in PHP there are several options, perhaps the simplest is to open our file wp-config.php (located at the root of the site) and add near the end of the following line:

  • ini_set(‘display_errors’, 0);
  • We must place it in the position indicated in the image, not in the last line of the file.
  • We save the change, we test the site and we should see where the source of the error is located.
  • If for some reason, we cannot access this method to show PHP errors, then we can choose to do it through our user’s PHP, as long as we can customize it clearly.
  • This should not be a problem if your hosting provides a modern server (such as LiteSpeed ​​or Nginx ) with customizable PHP, for example, if you have cPanel it is 99% sure that you can configure the variable display_errors at ease, ask your provider to turn in on/off.
  • In the image below, we can see where to make this change in the infrastructure servers through the PHP Selector available in cPanel.

 errors in PHP using display_errors

Another way to activate the display of errors in PHP using display_errors is directly editing the php.ini of the server, but we must bear in mind that for this it is necessary that we have root access to the server, and it is also essential that we know how to use the console.

In case you activate PHP’s display_errors, regardless of whether you did it through wp-config.php or with one of the other described methods, remember to deactivate it when you no longer need it, since having it active permanently is a serious failure to the security level.

Keep in mind that leaving the variable display_errors status “On” may cause part of your code, file and folder structure to be shown, and that can be used by third parties to hack your site, upload malicious content, etc.

Related – WordPress HTTP Image Upload Error

Specifically, Google’s crawl is a software whose main mission is to explore the Web to analyze the content of documents visited and store them organized in an index.

The crawler, therefore, travels continuously, autonomously and automatically, the various sites and Internet pages in search of new content or possible updates of content already explored in the past.

Google’s maximum crawl rate can be another reason that causes 503 error in WordPress, which can be fixed by following 3 tips:

  • Increase the hosting packages so you will have more resources.
  • Slow down the work and do not update anything for awhile. Obviously, you’re going to miss visits, but sometimes it’s the only option. When the traffic normalizes you will recover the normal use of the web.
  • Optimize WordPress so that, in case of an avalanche of visits, it doesn’t consume so many resources and not cause an error 503. [Also Read – Optimize WordPress – Repair Corrupted Tables]

Login to Google Search Console and select your website.

Next, click the gear icon and select site settings as shown below:

On the next screen, adjust the Google crawl rate by dragging the slider to the left side:

fix-503-service-unavailable-error-in-wordpress-site-settings

503-service-unavailable-error-in-wordpress-crawl-rate-search-console

Limit WordPress Heartbeat

It’s responsible for features such as post autosaving and so on.

The WordPress Heartbeat API fires a file known as admin-ajax.php among other queries at regular intervals when you’re logged into your site.To determine if WordPress Heartbeat is the cause of the 503 service unavailable error on your WordPress site, add the following code into your theme’s functions.php file right after the opening <?php tag:

Save your changes and reload your site. If the 503 error is gone, take a breather. But if the 503 service unavailable error is still there, it means the WordPress Heartbeat API is the least of your troubles.

If the below code didn’t fix the 503 error, don’t forget to remove the code from your functions.php file.

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

How To Prevent HTTP 503 error in WordPress

Before we start the problem-solving strategy, we talked about how spikes in traffic can cause 503 errors. If you want to avoid encountering this problem in the future, there are two things you can do to be proactive.

Upgrade to a Better Hosting Plan

The fact that WordPress is one of the most used CMS worldwide makes it the main target of hackers. When a security hole is detected in a plugin or at the core level, many malicious users take advantage of these common wordpress security vulnerabilities to take control of many websites.

With improved security in Managed WordPress Hosting plans by Host & Protect (Recommended), you can rest assured of security updates, backups and protection against WordPress brute force attack & WordPress DDoS attacks so you can sleep peacefully.

Use a Content Delivery Network (CDN)

We use the acronym CDN, but the real name is Content Delivery Network.

If we decipher the name, we quickly understand that the CDN is a network server for the distribution of content.

This network server is connected to the 4 corners of the world for two reasons:

  • Distribute content faster to the user: The closer you are to it, the faster the content will arrive. We are talking about a hundredth, a thousandth of a second, but it is HUGE when we know that a site should ideally load in 3 seconds MAXIMUM.
  • Securing the content of your website: Because your site is accessible from all over the world, it is “almost” impossible to discover, what is the real server that hosts your website and attacking it.

Some of the top WordPress CDN services are MaxCDN, Cloudflare & Rackspace.

Summary: http error 503. the service is unavailable.

As we have already seen, the 503 service unavailable error in WordPress can be quite annoying, but its solution is usually simple.

The problem can be presented by an error on the server side as well as originate from the WordPress site, in which case it is advisable to check our plugins and themes to find the cause, as well as activate the display of errors in PHP temporarily, with all this It should be more than enough to locate the origin.

Once we have found the origin of the 503 service error, we will have to evaluate how to solve it, and that depends on where the problem lies. Tracking user activity in WordPress can also help you in this case.

If it is a conflict of a plugin or a theme we should usually contact the developer of the plugin or the theme, while if it is a problem of our own script, we will have to see it on our own or with the help of our programmer or hosting provider.

Have you ever encountered the 503 service is unavailable error? How did you fix it? Please share with us in the comments below. Thanks in advance!

Scanning and Fixing Your WordPress Site for MalwareWe have created a custom search engine where you can find other WordPress errors, tips & tutorials – Visit Here

Other Popular Topics You Might Want To Read:

  • WordPress Theme Security
  • WordPress Malware Removal Checklist
  • WordPress .htaccess hacked
  • WordPress Stuck in Maintenance Mode
  • WordPress Security Checklist
  • WordPress Maintenance Checklist

Check Out Our In-depth Guides

  • Best WordPress Image Optimization Plugins 2023
  • How to Add Security Headers in WordPress
  • WordPress CSRF Protection – Prevent CSRF Attack
  • How To Restore WordPress Site From Backup
  • How to Password Protect A WordPress Site/Post
  • How to Block Countries In WordPress Using IP Address?
  • Best WordPress Staging Plugins To Create A Test Site
  • How to Fix ERR_SSL_PROTOCOL_ERROR on Google Chrome

fix 503 service unavailable error in wordpress

It’s never great to see your website down and unreachable. That said, error messages help us understand the cause of the issue so we can fix it.

Unfortunately, that is not the case with errors from the 50x family. Those error messages are pretty generic and don’t tell us much about the cause.

So how can you find the root cause of the 503 Service Unavailable Error in WordPress?

  • What Is the “503 Service Unavailable” Error?
  • Why Does “503 Service Unavailable” Occur?
  • Fix “503 Service Unavailable Error” in WordPress
  • What if the Culprit Is the Theme?
  • What Else Can You Do to Fix 503 Error?

What Is the “503 Service Unavailable” Error?

Well, here’s one definition of the error from the Mozilla Foundation.

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 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.

Caching-related headers that are sent along with this response should be taken care of, as a 503 status is often a temporary condition, and responses shouldn’t usually be cached.

How Is 503 Error Displayed in a Browser?

There are display variations depending on the server configuration and browser itself, but sadly, none of the messages will tell you more about the cause.

Some possible variations include:

  • 503 Service Unavailable
  • Error 503 Service Unavailable
  • The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
  • 503 Service Temporarily Unavailable
  • HTTP Server Error 503
  • HTTP Error 503

Whatever the display variation, the debugging and fixing involve the same steps.

Why Does 503 Error Occur?

Since it’s quite generic, there is no magic wand you can wave to detect the culprit. But you should take the following steps.

While some advice immediately deactivating all plugins, my suggestion is to check the error.log first. If you have WP Debug Log, check that file as well for the latest errors.

These files can be found in the public_html folder on your WordPress installation.

To log in by using SFTP, check our tutorial on how to create and connect to the SFTP user.

access site via ftp

If you see a fresh error message that looks like…

/public_html/wp-content/plugins/plugin-name/classes/requests/post/class.php(31): Logger::format_log(NULL, ‘POST’, ‘Create Sessi…’, Array, Object(WP_Error), ”)

…you have probably found the culprit.

Fix “503 Service Unavailable Error” in WordPress

Since we know it’s a plugin-name causing issues, it should be deactivated.

Navigate to wp-content/plugins/plugin-name and rename the folder to plugin-name-new. This will automatically deactivate the plugin so you will have access to the WordPress dashboard. The website should now be functioning properly.

wp contents plugins

If this is still not working for you because of a conflict with some other plugin or a theme, it’s time to do what everyone suggests.

Rename the wp-content/plugins/plugin-name-new back to wp-content/plugins/plugin-name. Then rename wp-content/plugins to wp-content/plugins-new. This will deactivate all plugins, and the website should start working, even though it’ll probably be broken and non-functional. But at least you can access the dashboard and start the rest of the debugging process.

To continue debugging, rename the folder wp-content/plugins-new back to wp-content/plugins to show all the deactivated plugins.

Activate plugins one by one until you get the error message again. Good job! You have found the culprit. You can rename or delete that plugin again from SFTP, and you’re done. Now you just need to find a replacement for the plugin in question. Or you could contact their support and see if they can fix it. Maybe it’s a known issue with a common solution (Google helps a lot here.)

What if the Culprit Is the Theme?

If the theme is the culprit and you cannot access the WP dashboard to test that, you’ll have trouble switching to one of the WP default themes. Deactivating an active theme by changing the folder name will not result in activating another theme but in a broken website. It’s easier with plugins since they’re not a requirement like themes are.

To change the theme, use phpMyAdmin or Cloudways’ database manager. For the latter option, follow these simple steps.

Go to your application dashboard and Launch Database Manager.

launch database manager

In DB click on wp_options table in the left-hand sidebar.

wp tables option

Find the row named template to see the name of your activated theme, and click on edit on the left side next to the checkbox.

template in wp tables

Change the name to one of the default WP themes you have installed on WP and save changes.

default wp themes

This will activate the default WP theme, and the site should be functional. However, if the theme is the culprit, you obviously need it. Contact their support and ask for a fix.

What Else Can You Do to Fix 503 Error?

Resources

While it could be possible to increase your resources, the website would be hampered by long loading times for a while. You’ll need a bigger server with more RAM and CPU.

If that is the case and you really need more resources, you can easily scale up the server from your server management dashboard in Cloudways. Cloudways’ WordPress hosting makes this task efficient and hassle-free.

cloudways vertical scaling

CDN

If you have CDN activated, try to deactivate it temporarily to see if that will resolve the issue. It’s not the most common culprit, but the fix is worth a try.

Limit WordPress Heartbeat API

The WordPress Heartbeat API tracks the vital aspects of WordPress in the server, consuming some resources in that process. Those resources are not insignificant, so limiting this can help. That said, if performance depends on this fraction of resources, you have more WordPress to take care of.

To limit WordPress Heartbeat API in this situation:

Log in to your server via SFTP client and find the folder of your activated theme.

Inside that folder, you will find the functions.php file. Right-click on it and select edit.

In the editor, add this piece of code to it at the bottom of the file.

add_action( 'init', 'stop_heartbeat', 1 );

function stop_heartbeat() {

wp_deregister_script('heartbeat');

}

Save the file and you’re done.

funtions php file

Summary

All error messages from the 500 family are the most generic and the hardest to fix since there are many possible reasons and many possible solutions. One of the reasons can be that your site is hacked, and the injected code is eating resources. My suggestion is to hire a professional to take care of the problem, instead of doing it on your own.

Share your opinion in the comment section.
COMMENT NOW

Share This Article

Aleksandar Savkovic

WordPress Developer, Lecturer, the product guy interested in Agile product development. WordCamp and WP/Woo Meetup speaker and Organizer, and Community Manager at Cloudways. Also, a Formula 1 and MotoGP freak.

×

Get Our Newsletter
Be the first to get the latest updates and tutorials.

Thankyou for Subscribing Us!

Are you seeing a 503 service unavailable error in WordPress? The problem with the 503 error is that it gives no clues about what’s causing it which makes it extremely frustrating for beginners. In this article, we will show you how to fix the 503 service unavailable error in WordPress.

Fixing 503 service unavailable error in WordPress

What Causes 503 Service Unavailable Error in WordPress?

All WordPress hosting companies offer fixed amount of resources for each hosting account. For websites on shared hosting, this limit cannot handle heavy usage of server resources.

The 503 service unavailable error occurs when your web server is unable to get a proper response from a PHP script. This PHP script could be a WordPress plugin, a theme, or a misbehaving custom code snippet.

If the error is caused by heavy usage, a server glitch, or a DDoS attack, then it could automatically disappear in a few minutes.

However, if it is caused by bad code on your website, then it will keep occurring unless you find and disable the code that’s causing it.

That being said, let’s take a look at how to easily fix 503 service unavailable error in WordPress.

Fixing 503 Service Unavailable Error in WordPress

As we mentioned above that this error is caused when your web server is unable to get a proper response from a PHP script running in the background.

To fix it, we will disable all unnecessary PHP scripts one by one until the error is resolved.

Let’s get started.

Deactivate All WordPress Plugins

All your WordPress plugins are PHP scripts, so first you need to deactivate all your WordPress plugins.

Since you cannot login to your WordPress dashboard due to the 503 error, you will need to connect to your website using a FTP client or File Manager in cPanel. Once connected, go to /wp-content/ folder and rename the plugins folder to plugins-old.

Rename plugins folder

Next, you need to create a new folder and name it plugins.

Now you need to visit your WordPress site to see if this resolved the error.

If it did, then this means a plugin installed on your website was causing the error. The above steps have deactivated all WordPress plugins.

To figure out which plugin was causing the issue, you need to switch back to your FTP client or file manager in cPanel. Next, you need to go to /wp-content/ folder and delete the empty plugins folder.

Delete empty plugins folder

After that you need to rename the plugins-old folder to plugins. This will make all your previously installed plugins available to WordPress. However, these plugins will remain deactivated.

You need to visit the WordPress admin area and then go to the plugins page. You can activate your plugins one by one and visit different pages on your website after activating each plugin. Keep doing that until you find the plugin causing the 503 error.

If this step resolved your issue, then you don’t need to follow rest of the instructions on this page. Otherwise, you can move on to the next step.

Switch to a Default WordPress Theme

If deactivating plugins didn’t resolve the issue, then the next step would be to switch to a default WordPress theme. This will deactivate your current WordPress theme.

First, you need to connect to your WordPress site using an FTP client or File Manager in cPanel. Once connected, go to /wp-content/themes/ folder.

Download your current WordPress theme

Locate your currently active WordPress theme and download it to your computer as backup.

After downloading your theme, you can go ahead and delete it from your website

Now, if you already have a default theme like Twenty Seventeen or Twenty Sixteen installed, then it will be automatically activated. If you don’t, then you can go ahead and install a default theme on your website.

Thoroughly check your website to make sure that 503 service unavailable error is resolved.

Troubleshooting

If both methods fail to resolve the error, then you can take the following steps:

  • Contact your WordPress hosting company because they may be able to pin-point what’s causing the issue.
  • As a last resort, you can reinstall WordPress with a fresh copy.

We hope this article helped you learn how to fix 503 service unavailable error in WordPress. You may also want to see our ultimate list of the most common WordPress errors and how to fix them.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us. Here’s our editorial process.

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

What’s the HTTP 503 Service Unavailable Error?

The HTTP 503 Service Unavailable error means that a website can’t be reached at the moment because the server is not ready to handle the request. This could happen because it’s too busy, under maintenance, or something else which requires a deeper analysis.

Running into errors on your site can be intimidating. However, most errors give you some clue as to what caused them, which can make troubleshooting these common issues a lot easier. The 503 error is not as polite, unfortunately, and doesn’t give you much information to go on.

It helps to understand what the most common causes are for the 503 error. After that, you’ll need to be methodical when it comes to troubleshooting the error, which means following several steps in order to locate the root cause.

In this article, we’ll cover what the 503 error is and how it typically manifests. Then we’ll guide you through six steps in order to troubleshoot it. Let’s get to work!

Check Out Our Video Guide To Fixing Different Types of 500 Errors

What Is an HTTP Error 503?

The Internet Engineering Task Force (IETF) defines the 503 Service Unavailable as:

The 503 (Service Unavailable) status code indicates that the server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. The server MAY send a Retry-After header field to suggest an appropriate amount of time for the client to wait before retrying the request.

When you encounter the 503 error, it means that the server in question is unavailable. That could be because it’s too busy, for example, or it’s under maintenance. Unlike other similar error codes, 503 signifies that your website is online and running, but can’t be reached at the present moment.

What’s so vexing about this particular error is that it barely gives you any information to go on. Most of the time, it just shows up with a “Service temporarily unavailable” message. That’s the equivalent of calling a restaurant via phone, only to have them tell you that they’re closed but refuse to let you know when they’ll be open again.

If you’re lucky, the 503 error code will have occurred because your website is under maintenance. WordPress very briefly sets your site to maintenance mode when you’re updating a plugin, a theme, or the core software:

HTTP 503 Error in WordPress

Maintenance mode

Usually, this timeout is so brief that no one will notice it. However, in those cases where the 503 error persists, you’ll have a bigger problem to deal with. After all, not only will users be unable to visit your site, but you’ll lose access to your WordPress admin area as well. That means you can’t update your site in any way, and in order to troubleshoot it, you’ll need to dig into its files.

Error Code 503 service unavailable error
Error Type Server-side error
Error Variations 503 Service Unavailable
503 Service Temporarily Unavailable
HTTP Server Error 503
HTTP Error 503
Error Causes Unexpected traffic spikes
Server communication problems
Resource usage exhaustion
DDoS attack
Plugin or theme incompatibility

503 Error Variations

The 503 error can show up in a lot of ways. However, almost every variation comes accompanied by that 503 code, making it easy to identify.

Here are some of the variations you might encounter, depending on your server configuration and browser:

  • 503 Service Unavailable
  • 503 Service Temporarily Unavailable
  • HTTP Server Error 503
  • HTTP Error 503
  • Error 503 Service Unavailable
  • The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.

Whatever the code you run into might look like, it means you need to get to work fast before it affects your users negatively.

Have you ever run into the 503 error? That’s a bummer! 😱Follow these 6 steps to fix it and get your site back online in no seconds!Click to Tweet

What Causes an HTTP Error 503?

These are the most common reasons why a server is temporarily unable to handle a request:

  • There is a high number of requests being sent to the server, exhausting all the available resources.
  • The server is experiencing technical issues or maintenance work.
  • The server could be under a Denial of Service (DDoS) attack.

There are also other technical issues triggering the 503 error, like problems with your plugins or theme. More on that below.

How to Fix the 503 Error?

Since you often can’t be sure what caused the 503 error in any given situation, you’ll need to go about troubleshooting it methodically. The following six sections each cover a potential fix, aimed at resolving the different potential root causes.

After each step, take a moment to return to your website and see if the 503 error is gone. If it is, you’ve successfully fixed the issue. If not, continue on to the next step in the process.

1. Temporarily Deactivate Your Plugins

One of the most common causes of the 503 error in WordPress is plugin compatibility issues. To determine if that’s what’s happening, you’ll need to disable all of your site’s plugins.

Since the 503 error prevents you from accessing the admin area, you’ll need to use an FTP client for this step. If you don’t have one set up, we recommend FileZilla.

Once your FTP client is ready, connect to your website through it and navigate to your root folder. In case you can’t find it, it’s usually called public_html, html, public, www, or your site’s name. If you’re a Kinsta client, it’s your public folder.

WordPress root folder SFTP

WordPress root folder SFTP

Open that folder, and navigate to the wp-content directory. Inside, you’ll see a folder called plugins, which contains individual subdirectories for each of the plugins installed on your site (both active and inactive).

What you’re going to do now is right-click on the plugins folder, and rename it to something else. We recommend plugins.old or plugins.deactivated, so you can easily recognize it later.

WordPress plugins folder renamed

WordPress plugins folder renamed

WordPress will now not be able to find any of your plugins. When that happens, it will automatically disable those plugins.

Now, try accessing your dashboard. If the 503 error is gone, then you can assume that one of your plugins was the culprit. All you have to do is figure out which one was at fault.

Return to the wp-content directory, and rename your original plugins folder correctly. Then, you’ll need to disable each of your plugins one by one, until you find the culprit.

To do this, open the wp-content/plugins directory. Inside, you’ll find one folder for each of your plugins. The process you’re going to follow is much the same as before:

  1. Start with the first folder, and rename it to anything you like.
  2. Check your website to see if the error is gone.
  3. If it isn’t, return the plugin folder from the previous step to its original name.
  4. Move on to the next plugin on your list, repeating the above steps.

This process can take a while if you have a lot of plugins, but it’s vital to check each plugin in turn. If at any point you identify the plugin that’s causing the error, you can uninstall it or replace it with another tool.

If you make it to the end of these steps without finding a solution, you can move on to the next stage of troubleshooting.

2. Deactivate Your Website Theme

Now that you’ve ruled out your plugins as the cause of the 503 error, it’s time to do the same with your active theme. In fact, your theme could also be creating compatibility issues.

Unfortunately, the process doesn’t work the same as above. WordPress won’t revert to the default theme if simply rename the theme folder, you would end up with an error like “The theme directory “theme name” does not exist.” Or if you try to rename the entire theme directory folder, you end up with “ERROR: The themes directory is either empty or doesn’t exist. Please check your installation.”

The theme directory does not exist error

The theme directory does not exist error

Therefore, you need to access your WordPress database by logging into phpMyAdmin. If you’re a Kinsta client, this can be found within the “Info” section of the MyKinsta dashboard.

Open phpMyAdmin from MyKinsta.

Opening phpMyAdmin in MyKinsta.

Once in phpMyAdmin, click into the “wp_options” table, then click on the “Search” tab. You will want to search under the “option_name” for template.

phpMyAdmin wp_options table

phpMyAdmin wp_options table

Under the “option_value” column you will see the current name of your theme. Change this to one of the default themes, such as “twentynineteen.”

wp_options template name

wp_options template name

Check your website again to see if this has fixed the error. If it did, it simply means it’s a problem with your website theme and you might want to try reinstalling it or reverting to your most recent backup.

3. Temporarily Disable Your Content Delivery Network (CDN)

Sometimes, the 503 error will show up not because of a problem on your website, but because of your Content Delivery Network (CDN). If you’re using a CDN, a quick way to figure out if that’s the case is to temporarily disable it.

Every CDN should include some feature that enables you to pause its services. If you’re on Kinsta, you can disable your Kinsta CDN by navigating to CDN → “Disable CDN” inside your MyKinsta dashboard:

MyKinsta CDN enable/disable option

MyKinsta CDN enable/disable option

The process you need to follow may be different depending on which CDN you’re using. Cloudflare has also been known to cause 503 errors sometimes. If you can’t find the option to pause yours, check out your service’s knowledge base, which will usually contain detailed instructions.

If you don’t use a CDN or find that pausing your service doesn’t help with your issue, there are still a few more fixes to try. Do remember to reactivate your CDN before moving on.

4. Limit the WordPress ‘Heartbeat’ API

The WordPress Heartbeat is an API built into WordPress, which the platform uses for auto-saving content, showing you plugin notifications, letting you know when someone else is working on a post you’re trying to access, and more.

Just like a regular heartbeat, the API works in the background with a high frequency so that it doesn’t miss anything. As you might imagine, this API consumes server resources. Usually, that’s not a problem but in some cases, it may lead to a 503 error if your server can’t handle the load.

The quickest way to determine if the Heartbeat API is at the center of your problems is to temporarily disable it. To do that, connect to your WordPress website via FTP once more, and then open your current themes folder and look for the functions.php file within:

WordPress theme functions.php file

WordPress theme functions.php file

Right-click on the file and select the View/Edit option, which will open it using your local text editor. Once it’s open, you’ll need to add the following code snippet within:

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

Those three lines of code tell WordPress to disable the Heartbeat API. Save the changes to the functions.php file, close it, and try to access your website again.

If the 503 error is gone, you’ll know that the API was the problem. Disabling it altogether removes a lot of useful functionality, however. Instead, we recommend that you ‘slow down’ the Heartbeat, so that it doesn’t cause problems.

The easiest way to do that is by installing the Heartbeat Control plugin. Activate the plugin and navigate to the Settings > Heartbeat Control section. Look for the Modify Heartbeat options, and drop the frequency to the lowest possible number:

Heartbeat Control plugin frequency

Heartbeat Control plugin frequency

Save the changes to your settings and return to the functions.php file you tweaked a while back. For the above changes to work, you’ll need to remove the string of code you added before and save your changes to the file.

At this stage, the 503 error should be gone if the Heartbeat API was the problem. If it isn’t, then it’s time to try something different.

5. Increase Your Server’s Resources

If the 503 error is still occurring despite all your attempts to fix it so far, then there’s a good chance the problem might be due to a lack of server resources. That is to say, you’ll need to upgrade your hosting plan to see if that fixes the issue. This is especially true if you’re using cheap WordPress hosting, as they tend to throttle resources.

We don’t do this at Kinsta. We offer great Managed WordPress Hosting (as well as Application Hosting and Database Hosting).

Upgrading your plan is a big decision, however. The smart move is to first contact your web hosting support service and discuss the 503 error with them, as well as the steps you’ve taken so far to try and solve it. The support team should be able to help you work out the cause and advise you on whether you need to upgrade your plan or not.

6. Review Your Logs and Enable WP_DEBUG

You should also take advantage of your error logs. If you’re a Kinsta client, you can easily see errors in the log viewer and enable WordPress debug mode in the MyKinsta dashboard. This can help you quickly narrow down the issue, especially if it’s resulting from a plugin on your site.

Viewing the error.log file in MyKinsta Log viewer.

Viewing the error.log file within the MyKinsta dashboard.

If your host doesn’t have a logging tool, you can also add the following code to your wp-config.php file to enable logging:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

The logs are typically located in the /wp-content directory. Inside it, look for a file called debug.log and open it up.

Others, like here at Kinsta might have a dedicated folder called “logs”.

WordPress error logs folder (SFTP)

WordPress error logs folder (SFTP)

Interpreting your debug log can be a bit intimidating but it’s not as hard to read as you might imagine. In a nutshell, the log contains each error that pops up on your site in chronological order. It shows which file caused each error, as well as which specific lines of code were involved.

Beware: you’re not going to find direct references to the 503 error within your log. Even so, if all else fails, it can point you in the right direction by showing you what files are causing problems. That way, you’ll know where to focus your efforts next. As we mentioned in the previous step, now is a good time to get in touch with your hosting provider if you need further assistance resolving this error.

You can also check the log files in Apache and Nginx, which are commonly located here:

  • Apache: /var/log/apache2/error.log
  • Nginx: /var/log/nginx/error.log

To learn more, please check out our web server showdown: Nginx vs Apache.

If you’re a Kinsta client you can also take advantage of our analytics tool to get a breakdown of the total number of 503 errors and see how often and when they are occurring. This can help you troubleshoot if this is an ongoing issue, or perhaps something that has resolved itself.

If the 503 error is displaying because of a fatal PHP error, you can also try enabling PHP error reporting. Simply add the following code to the file throwing the error. Typically you can narrow down the file in the console tab of Google Chrome DevTools.

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

And you might need to also modify your php.ini file with the following:

display_errors = on

Summary

If you’re lucky, the 503 error will only show up when you put your website into maintenance mode. However, if it appears without warning, then you’ll have to roll up your sleeves and do some troubleshooting.

To get at the root cause of the 503 error, you’ll need to follow these steps to fix it:

  • Temporarily Deactivate Your Plugins.
  • Deactivate Your Website Theme.
  • Temporarily Disable Your Content Delivery Network (CDN).
  • Limit the WordPress ‘Heartbeat’ API.
  • Increase Your Server’s Resources.
  • Review Your Logs and Enable WP_DEBUG.

Have you ever run into the HTTP 503 error? Share your experiences with us in the comments section below!

Kinsta company logo

Понравилась статья? Поделить с друзьями:
  • World произошла ошибка во время последнего запуска
  • World ошибка при направлении команды приложению
  • World ошибка закладка не определена
  • World war z ошибка подключения к сервисам wwz
  • World не выделяет ошибки красным