Table of Contents [TOC]
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.
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.
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:
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.
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):
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.
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:
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.
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
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:
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:
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.
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.
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.
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.
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:
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.*/
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);
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.
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:
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:
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:
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’); |
} |
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.
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.
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:
Some of the top WordPress CDN services are MaxCDN, Cloudflare & Rackspace.
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!
Other Popular Topics You Might Want To Read:
Check Out Our In-depth Guides