how to fix 503 service temporarily unavailable

How To Fix  “503 Service Temporarily Unavailable” On WordPress?

Imagine somebody skimming through Google comes across a link to your WordPress website, clicks on it, but ends up reading the following line instead of landing on your site: “503 Service Temporarily Unavailable.”

How to fix 503 Service Temporarily Unavailable On WordPress

 

If they were genuinely anxious to visit your website, they would attempt clicking on the link a second time. Yet, suppose they see the same error message again, in disappointment. In that case, they’ll lose faith in your brand and will lead to visit a competitor’s website instead.

To prevent such mishaps from ruining your online brand presence and impacting potential customers, it certainly helps to know everything there is to know about fixing the “503 Service Temporarily Unavailable” error on WordPress. So let’s put an end to your worries and get started!

What Does The “503 Service Temporarily Unavailable” Error Mean In WordPress?

The “503 Service Unavailable” error is an HTTP error that is a web server error, describing a situation where your server is temporarily unable to handle your request at a particular moment. Thus, contrary to what you may believe initially, this error has nothing to do with something you did yourself.

Since you get this error when you can’t reach the server while your WordPress site is live, your front end and your admin dashboard become inaccessible.   

Users may have different server configurations. Hence how this WordPress error gets displayed on your screen will depend on that specific server configuration.

So that you don’t get confused, here is a list of some common ways in which the 503 Service Temporarily Unavailable error may appear:

  • 503 Service Temporarily Unavailable
  • 503 Service Unavailable
  • Error 503 Service Unavailable
  • Http/1.1 Service Unavailable
  • Service Unavailable – DNS (Domain Name Server) Failure
  • HTTP Server Error 503
  • 503 Error
  • HTTP 503
  • HTTP Error 503
  • HTTP Status Code 503
  • HTTP Status Code 503 Service Unavailable
  • 503 Server error

Furthermore, the “503 Service Unavailable” error can appear in any operating system or browser, including but not limited to macOS, Windows, Google Chrome, and Safari.

You might wonder, what then is the difference between this and some other 5xx errors? Well, in this case, the server is running correctly, unlike in the case of the “500 Internal Server Error” or the “502 Bad Gateway Error”.

This leads us to the next big question: What are the causes of the “503 Service Temporarily Unavailable” error? There are various causes, and each has an easy fix, so read on to learn about each.

What Causes The “503 Service Temporarily Unavailable” Error In WordPress?

The error happens due to various reasons, all of which can be broadly categorized as either faulty coding or server issues. Common reasons for the error propping up include problems with your WordPress plugins and theme, improper custom scripts, insufficient server resources due to server maintenance, or sudden spikes of website traffic (experiencing an overload).

Two of the most common causes of the “503 Service Temporarily Unavailable” error in WordPress include server maintenance and high website traffic. Server maintenance involves things like updating software, testing hardware, and other general upgrades and routine check-ups. The error also occurs when website traffic may be too high (an overload) for the specific hosting package opted for, especially in situations where you’ve gone in for a cheap shared hosting plan.

Such regular maintenance check-ups and phases of high-traffic typically last a few hours. Yet, during such occasional events, the error code ‘503’ will occur. Another common reason for the error code ‘503’ is an unreachable external server resulting in an improper DNS server configuration.  

The error “503 Service Unavailable” is crucial from an SEO (search engine optimization) point of view. If you ignore the error by leaving it unfixed, search engines will be registered as a permanent issue and lead them to de-index the page.

How To Fix The Error “503 Service Temporarily Unavailable” On WordPress?

Let’s take a look at all the available approaches to resolving the ‘503’ error. These tips, tricks, and steps to follow will help you know the exact reason behind the error and how to fix it.

1. Deactivate and Remove All Problematic Plugins from WordPress

A typical WordPress site has many plugins. There’s a high likelihood that incompatibility issues between the plugins would give rise to the ‘503’ error.

It is difficult to tell which Plugin is causing the issue, which is why the first and easiest step for troubleshooting the issue is to deactivate all plugins. Next, each Plugin should be enabled again one by one.

When you encounter the ‘503’ error, you won’t have access to your admin dashboard.

1.1 To deactivate all WordPress plugins, follow these steps:

Step 1 – Connect to the server via your FTP credentials.

Step 2 – Once you’ve established the server’s connection, navigate to the root WordPress directory called public_html.

Step 3 – Open the wp-content subdirectory and right-click on the plugins folder there.

Step 4 – Click on the Rename option in the dropdown list.

503 service temporarily unavailable

Step 5 – Rename the plugins folder to plugins_disable or plugins_deactivated to deactivate all plugins in one go.

what causes 503 service temporarily unavailable error

Step 6 – Rename the plugins_disable folder back to its original name “plugins.” Then refresh your WordPress site and access your wp-admin area.

Step 7 – Check to see if the Error 503 is gone.

If the error no longer persists after the above steps, we know a faulty plugin was the culprit. To know which Plugin is at blame leading to the error, you have to find and delete the problematic Plugin from your admin dashboard.

By restoring the plugin folder’s name to “plugins” (see step 6 above), you will now be able to activate the plugins within your dashboard manually.

1.2 Steps to follow for finding and deleting the problematic Plugin: 

Step 1 – Navigate to ‘Plugins’> ‘Installed Plugins’ to manually activate all your plugins.

Step 2 – Log out of your admin dashboard.

Step 3 – Connect to the server via your FTP credentials.

Step 4  – Open the wp-content subdirectory and right-click on the ‘plugins’ folder there. Your plugins folder should be at the location of your-site/wp-content/plugins.

Step 5 – Select a plugin and right-click on its folder, then click on the ‘Rename’ option.

Step 6 – Rename the selected Plugin folder, for instance, plugin-name.old or plugin-name.deactivated.

how to deactivate plugins from WordPress

Step 7 – Log in to your dashboard again. If, after deactivating the previously selected Plugin, you can log in to your dashboard, then it’s confirmed the Plugin you just disabled by changing its folder name is the culprit. However, if you aren’t able to log in to your dashboard again, then move on to step 8.

Step 8 – Deactivate the rest of the plugins one by one and reload your site each time to find out the lousy Plugin.

Suppose the error “503 Service Unavailable” doesn’t appear again, and you’re able to log in to your dashboard after you’ve just deactivated a particular plugin. In that case, conforming that Plugin is the culprit.

Step 9 – Permanently delete the confirmed bad Plugin by accessing the public_html/wp-content/plugins folder from your File Manager.

After performing all of the above steps, the Error 503 should be fixed, and you should be able to reaccess your website.

2. Switch Back To The Default WordPress Theme

Suppose none of your plugins has been the root cause of the “503 Service Temporarily Unavailable” issue. In that case, it’s time to check if your WordPress theme is to blame. If you’ve faced an occurrence of the error after a recent installation of a new theme, then you have all the more reason to suspect a buggy theme as the culprit.

Fixing the issue is simple. All you have to do is deactivate the current WordPress theme and switch back to any default WordPress theme like the ‘Twenty Nineteen or the ‘Twenty Twenty’ theme.

# Here are the steps to follow for deactivating a WordPress theme using the File Manager:

Step 1 – Connect to the server via your FTP credentials.

Step 2 – Once you’ve established the server’s connection, navigate to the root WordPress directory called public_html.

Step 3 – Navigate to the /wp-content/themes/ directory, right-click on your current theme’s folder and select the ‘Rename’ option.

service temporary unavailable

Step 4 – Rename the theme directory as “name.deactivated”; for example, if the name is ‘bridge,’ then name it bridge.deactivated, and then try logging into your dashboard.

Deactivating the theme will automatically activate the default WordPress theme. If you don’t have a default WordPress theme installed, then move on to step 5.

Step 5 – If there is no default WordPress theme installed, download one from the WordPress default theme repository and upload it to your WordPress installation. Once done, then deactivate your current theme, as shown in the preceding steps.

Switch Back To The Default WordPress Theme

# Next, here’s how you can locate the downloaded file and then upload it to your WordPress Installation:

Step 1 – Look for a zipped folder of the chosen theme you’ve downloaded in your ‘Downloads’ folder.

Step 2 – Extract the .zip file.

Step 3 – Connect to the server via your FTP credentials and navigate to the path: your-site-url/wp-content/themes/.

Step 4 – Upload the unzipped theme folder by dragging and dropping it. In the process, ensure you haven’t made the mistake of putting the new theme’s folder inside the folder(s) of an existing theme.

how to fix 503 Service Temporarily Unavailable error

Step 5 – Now, follow the steps of deactivating a currently used WordPress theme using the ‘File Manager’ to see if the theme is the error source.

Your website stops showing the ‘503’ error while using a default WordPress theme in the eventuality. Then you can rest assured your original theme was the culprit. Whether you’ve been able to pinpoint the exact Plugin causing the bug or the theme, you should contact its developers for assistance.

3. Inspect Custom PHP Code (Turn On Debugging And Review Your Error Log)

If the first two methods don’t reveal the cause of the 503 error, then it’s recommended to inspect any custom PHP code you might have added over time. Since keeping track of all the custom code added over time can be a daunting task, it’s a lot easier to look for clues by turning on debugging and reviewing your error log instead.

Reviewing your error log helps you find the exact line of faulty code, which is why it serves as an incredibly quick step in solving the 503 error.

# Here’s how to turn on error logging:

Step 1 – Connect to the server via your FTP credentials.

Step 2 – Once you’ve established the server’s connection, navigate to the root WordPress directory called ‘public_html.’

Step 3 – Right-click on the ‘wp-config.php’ file and click on the ‘View/Edit’ option.

Step 4 – Open the file with a text editor and and insert the following code above the line that reads: /* That’s all, stop editing! Happy blogging. */ :

define (‘WP_DEBUG’, true);

define (‘WP_DEBUG_LOG’, true);

define (‘WP_DEBUG_DISPLAY’, false);

@ini_set (‘display_errors’, 0);

Inspect Custom PHP Code

Here’s what the above four lines of code are doing:

  • The first two lines enable the debugging mode and store the error messages in a file named debug.log. The path to that file is your-site/wp-content/debug.log.
  • The remaining two lines of code deter error messages from appearing and printing on your screen.

Step 5 – Once done, save the changes and upload the edited file back into your root directory.

Step 6 – This step needs to be performed if you cannot edit the wp-config.php file. In such a case, you will have to make temporary changes to the file’s permissions by locating your wp-config.php file once more, right-clicking it, and selecting the ‘File permissions’ option.

Next, In the Numeric value field, type in either the number 644 or 666 and press the OK button.

how to turn on error logging

Step 7 – Once you’re done adjusting the permissions temporarily, change the permissions on your wp-config.php file back to the file’s recommended permissions as either 440 or 400.

Now you’ll be able to retrieve and review the error messages in the debug.log file. Since there would be no direct mention of the 503 error, the reviewing process can be rather time-consuming.

4. Check For Server Related Issues

If the above three methods haven’t resolved the “503 Service Temporarily Unavailable” error, there’s a high chance the problem could lie in your web server. In WordPress, the following three server-side methods can resolve the issue:

  1. Limit WordPress Heartbeat
  2. Limit Googlebot Crawl Rate
  3. Increase Your Server Resources

 Now let’s take a look at each in turn.

4.1 Limit WordPress Heartbeat

‘Heartbeat’ is a built-in WordPress API introduced in version 3.6. Its practical uses include:

  • Allowing your site to have an autosave posts feature by creating periodical autosaves of your posts while you’re editing them. 
  • Showing notifications in your admin dashboard, and displaying the notification that another user is editing the post on multiple author sites.
  • You are managing real-time sales dates of your e-commerce plugins.

Due to the above functionality, ‘Heartbeat’ consumes much of your server resources. Yet you can limit such consumption with the Heartbeat Control WordPress plugin, or by disabling it altogether.

# How do you know if WordPress Heartbeat is causing “503 Service Temporarily Unavailable”?

The simple answer is: Disable Heartbeat to see if the error disappears:

Step 1 – After the opening <?php tag, add the following lines of code to your theme’s functions.php file, for Heartbeat API deactivation:

function stop_heartbeat(){

wp_deregister_script(‘heartbeat’);

}

add_action(‘init’, ‘stop_heartbeat’, 1);

Step 2 – Save your changes and then refresh your website to see if the error’s gone.

Did that fix the error? If not, then the WordPress Heartbeat API is not the root cause of the error. At this stage, you would want to troubleshoot the error using yet another method, but before moving on, make sure to remove the code from your functions.php file.

4.2 Limit Googlebot Maximum Crawl Rate

The maximum number of requests per second that Googlebot sends to your site for crawling purposes is known as Google’s maximum crawl rate. The reason Google and the other search engines crawl your website is for indexing your content. Virtually, these search engines regularly visit your website to gather ranking metrics and content.

This crawling process plays havoc on your server resources, which are often limited. As a result, not only does your site slow down, but it also returns the Error 503.

The solution is to limit Google’s maximum crawl rate by following the link to the legacy version of Google Search Console, which is in ‘Google Webmaster Tools’ and performing the following steps:

Step 1 – Log in with your Google Search Console credentials and select a verified property for which you wish to change the maximum crawl rate.

Step 2 – Go to Site Settings and find the crawl rate option, then click on the Limit Google’s maximum crawl rate radio button.

Step 3 – Drag the slider to the Lowest end and then press the Save button.

Limit Googlebot Maximum Crawl Rate

Step 4 – Try to visit your site. If the error persists, try another method. Before moving on to another process, you will have to reverse the changes you just made to the maximum crawl rate. For the reversal, choose the “Let Google optimize for my site” option and press the Save button.

4.3 Enhance Your Server Resources

Are you still getting the error 503 Service Unavailable message? If all else fails in fixing the issue, it’s time to check your Google Analytics page. More than usual, traffic may have led to insufficient server resources leading to the error. On the flip side, having low traffic and still noticing the 503 error in WordPress is a likely consequence of having inadequate server memory.

5. Consult Your Host Provider For Further Assistance

 

If none of the above methods have resolved the error, contact your hosting provider. There are many ways in which they can be of assistance:

  • Your hosting provider can help troubleshoot the error message from the log. A recent update in WordPress, theme, or plugin update could have triggered the error. Your host provider can be requested to restore the pre-update backup of your site.
  • Suppose the error is due to the relatively rare scenario of server downtime. In that case, you could make an inquiry regarding the same to your hosting provider. If the cause of the downtime is determined to be because of a DDOS attack, you should probe the need for higher security measures.
  • Exponential increases in traffic are often a cause of 503 errors. Thus, you must have a powerful server to deal with daily traffic growth. It might be time to upgrade to a better hosting plan or even a better hosting provider.

Final Thoughts

In this article, we have mentioned five ways in which you can try to fix the “503 Service Temporarily Unavailable” error in WordPress. The most common root causes of the error are a bug in either a plugin or a theme.

Debugging and reviewing your error log and resolving server-related issues can also lead to an end to the issue.

If nothing else works, we’ve pointed out how contacting your hosting provider can be of great help.

If you know other great methods or tricks that have worked for you, please use the comment section to enlighten our readers.

Leave a Comment

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