Fixing the error "503 Service Temporary Unavailable"

print · Время на чтение: 16мин · - · Опубликовано · Обновлено

playListen to this article

Fixing the error "503 Service Temporary Unavailable"Once your site is up and running, it can attract hundreds of thousands of visitors. The more visitors you can attract, the more income you will receive. But your site is throwing a 503 error and you don't know what to do. The visitors leave. SEO sucks. Income is falling. However, not all is lost. You can launch your site

I will show you the exact steps to take to remove this error from your website. You will also learn how to prevent the mistake from happening again.

The content of the article:

What does 503 Service Temporary Unavailable mean?

Short answer: server overload is causing your website to throw a 503 "Server Temporarily Unavailable" error.

The server is where your websites are hosted. Think of it like the piece of land your house is built on. If the house is heavy and the ground underneath is swampy, your house will collapse like a deck of cards.

Similarly, if you created your site on a server that can't handle things like traffic surge, it will throw an error. This begs the question - everything has been fine with your site so far; so why can't the server process your actions now?

Let's look at the possible reasons why your server may be overloaded:

  • Updating or installing a plugin or theme, or even the core.
  • Sudden spike in traffic.
  • Misbehaving custom code snippet.

1. Update or install a plugin, theme or core

When you update or install plugins, themes, or core on your WordPress website, you are essentially asking your server to complete a task. If your server is already busy with other tasks, it will reboot and stop responding. In doing so, it will give a 503 error.

2. Sudden spike in traffic

The server may also throw an error if your site starts getting more traffic than usual. Maybe someone somewhere has mentioned your site and that's why people are flocking to your site. Or your site is under a certain type of hacker attack called DDoS. In this type of attack, hackers send fake traffic to your website to try and overload your website.

spike in web traffic

Typically, every time a visitor comes to your site and opens a page, your server takes action and sends the page to the visitor's browser. But if the server is overloaded with tasks, then serving the page to the visitor becomes problematic. The page will take some time to load. As a result, your visitors' pages will run slowly.

When too many visitors access the site at the same time, the server will overload and throw an http 503 error.

3. Incorrectly working piece of custom code

Custom codes will help you create a website the way you want. But using the wrong custom code can result in a "503 Service Temporary Unavailable" error.

When you add custom code to your site, you are asking your server to present data on your site in a certain way. If the code is incorrect, you are giving the wrong instructions. When the server tries to understand a piece of code, it overloads and throws an error.

How to fix "503 Service Temporary Unavailable" error?

Error 503 can manifest itself in different ways. Here are some of the variants of the 503 error:

  • HTTP error 503;
  • HTTP Server Error 503;
  • 503 Service unavailable;
  • Error 503 Service unavailable WordPress;
  • 503 Service temporarily unavailable WordPress;
  • Error 503 The maximum number of threads for the service has been reached;
  • The server is temporarily unable to serve your request due to maintenance downtime or bandwidth issues. Please try again later.

It doesn't matter what the error message is, the fix is the same. Knowing the cause makes it easier to find a solution. If you know what caused the error, jump straight to the appropriate solution.

For example, if the error appears during the installation of a new plugin, then the plugin is the culprit. Jump straight to where I'll show you how to deactivate the plugin even if you can't access the admin panel.

If you know the reason for the error

1. Roll back the update that caused the error

If you started encountering an error immediately after updating a plugin, theme, or core, then the update is causing an error. If you have access to the admin panel, all you have to do is roll back the software to its previous version.

Install and activate the WP Rollback plugin. It will help you downgrade any plugin or theme to a previous version. To downgrade the core, use the WP Downgrade plugin.

If you do not have access to the admin panel, you will need to manually roll back the update. This requires you to go to the backend and access your WordPress files.

Please make sure you are using the manual methods and not the ones that involve plugins. You can't install plugins, remember?

After downgrading, open the site and check if the error is gone. If not, then clear the cache and check again. If the problem persists, the updates do not cause the error.

2. Deactivate the offending plugin or theme

If the error appeared immediately after you activated a new plugin or theme, then you need to deactivate it. If you have access to the WordPress dashboard, deactivation is easy. It is about:

⟹ Plugins > Installed Plugins > Then click the "Deactivate" button that appears right below the plugin, or
⟹ Appearance > Themes > Click a theme, and then select Delete.

If the theme is active, you need to activate another theme on your site. And then proceed to delete the previously active theme. But if you don't have access to the site, you need to manually deactivate the plugin and theme. Here's how:

Step 1: Download and install Filezilla on your local computer. Open it and connect to your website with FTP credentials.

filezilla login

Step 2: Once the connection is established, the remote site panel will start populating with folders. Using the panel, go to

  • public_html > wp-content > plugins
  • public_html > wp-content > theme

If you click on folders, you will be able to see all the plugins and themes installed on your site. Navigate to the one you want to deactivate and follow these steps:

Right-click on the plugin or theme and select the "Rename".

rename plugins

⟹ Add the text ".deactivate" to the name of the software. Close the window. The software will be deactivated.

deactivate filezilla plugin

Now check your website to make sure the error is gone. If not, then clear the cache and check again. In case the issue persists, try the solutions in the next section.

If you don't know the reason

1. Take Action to Eliminate Traffic Surges

The “503 Service is temporarily unavailable” error can be caused by a sudden increase in traffic on your site. Check Google Analytics to see if your site is getting more traffic than usual. If so, then this is the cause of the error.

Q: Why is there a sudden spike in traffic?

Placing a discount or gift

Have you put on some kind of promotion or irresistible discount that attracts a lot of people? Perhaps your site is experiencing a sudden surge in popularity due to media mentions, etc.

Amazing! But your server is failing you here. To take advantage of this surge in visitors, upgrade your hosting plan. The best server with lots of resources should be able to handle bulk traffic.

DDoS attacks and brute force attacks

There are different types of hacker attacks. In DDoS attacks, hackers send fake traffic to overload your server, which causes your site to shut down and throws a 503 error.

As a rule, DDoS attacks are carried out in order to disable large brands. But the hackers are also targeting smaller sites for ransom. Only after the site owners pay, they stop the traffic. It's worth checking to see if you've received a ransom note. This will help determine if you are under DDoS attack.

Another reason could be that hackers are trying to break into your site. They launched multiple requests on your login page to try different username/password combinations, which caused a spike in traffic. This is called a brute force attack.

2. Deactivate plugins and themes one by one

The error may be related to a plugin or theme. As a rule, a plugin or theme does not cause problems out of the blue. It's only when you update them or add a new plugin or theme to your site that you run into this issue.

If you have an activity log, you can find out if someone has installed new software or an updated one. If you don't, deactivate all plugins and themes to see if they are the culprit.

You can't access the WordPress admin area, you need to go to the site's backend to do so. Steps you need to take:

Manually disabling plugins

Step 1. Download and install Filezilla on your local computer. Connect it to your website with FTP credentials.

filezilla 2 entrance

Step 2. Once the connection is established, the remote site panel will begin to populate. In this panel navigate to ⟹

  • public_html > wp-content > plugins

Right click on the plugins folder and select "Rename". Rename the folder to plugins.deactivate. This will disable all plugins on your site.

rename plugins one by one

Step 3: Now go back to your site to check if it still gives "WordPress Error 503". If so, then clear the cache and check again. If the problem persists, move on to the next solution, which is disabling themes.

But if the problem is solved, then I recommend figuring out which plugin was to blame.

Step 4: Go back to the plugins folder and rename it back to plugins.

Step 5: Now open the folder and rename the first plugin. Just add ".deactivate" to the plugin name.

filezilla deactivation plugin

Come back and check your site. Was this plugin causing the error? If not, keep renaming plugins. At some point, the error will disappear. The last plugin you renamed caused an error. To make sure you don't encounter the error again, you can uninstall the plugin, look for a replacement, or if you can't get rid of the plugin, write to their support.

Make sure you rename the rest of the plugins to their original names, otherwise they won't work.

Disabling themes

After excluding plugins, check the themes. The debugging process with themes is different from what you would do with plugins. Disabling all themes will leave your site without a theme and cause your site to throw an error: “ERROR: Themes directory is either empty or does not exist. Please check the installation."

So here's what to do:

  • Activate the default WordPress theme on your site.
  • Disable the previously active theme.
  • Restore the previously active theme.
  • Disable all other themes on your site.

Step 1: Activate the Default WordPress Theme

⟹ Login to your hosting account

In cPanel, open PHPMyAdmin.

⟹ Select the wp_options table.

Find a template and style sheet. It will show you the currently active site theme. Write down the exact spelling and case of the subject, as you will need them later. In the image below, it is "aster".

template stylesheet in site management

⟹ Next, you need to make the default WordPress theme the current theme of the site. Double click the template and change the theme to twenty twenty. Then double click on the style sheet and change the theme to twenty twenty.

template style sheet theme

Step 2Disable the previously active theme

⟹ Now open Filezilla.

And go to public_html > wp-content > themes. The theme folder will contain the previously active theme. Deactivate it by renaming it to something like themename.deactivate.
Next, open your website and check if it still throws the error. If so, it means that the previously active theme is not the culprit.

Step 3: Activate the previous theme

⟹ Go to PHPMyAdmin and rename the theme in the templates and stylesheets section. Make sure the name is exactly what you copied. Do not make any changes to spelling or case.

Step 4: Deactivate All Themes One By One

⟹ To figure out which theme is the culprit, you need to disable one theme at a time. In Filezilla, start renaming each theme and checking out your website.

Don't forget to disable the active theme. We have already checked it. If none of the topics are causing the error, continue to the next solution.

3. Talk to your hosting provider

Your hosting provider has allocated space on one of their servers. Depending on your plan, there is an upper limit to the server resources your website can use. If your website requires more resources than your current plan allows, you need to upgrade to a higher plan.

You may be hosting your site on a shared hosting environment, then the problem is with other websites on your server. They can take all of your server resources, leaving you with very little to work with. Your site is not getting its fair share of resources.

Another possible reason for the error is that your server is undergoing proactive updates. Most hosting providers send you an email a day or two before the server goes down. It's worth checking your email account, including your spam folder, for these updates.

You need to talk to your hosting provider to find out what's going on. Try to rule out causes such as server updates and other sites consuming resources. If you need to upgrade your hosting plan, do so.

4. Limit the WordPress "Heartbeat" API

The Heartbeat API enables 3 functions on your WordPress site:

  1. Autosave posts and pages. If you are working on a post or page and your browser crashes or you accidentally close your browser, WordPress automatically saves the latest version of your work.
  2. Real time data display. E-commerce websites use plugins to display real-time data on the dashboard. This API allows them to do so.
  3. Preventing Multiple Concurrent Edits. On multi-author websites, you don't want the same posts to be edited by multiple people at the same time. If you edit a post, the Heartbeat API locks it and prevents anyone from accessing it until you're done.

The API uses your server resources to perform all the functions mentioned above. But too many API requests can overload the server. As a result, the server issues 503 Service Temporary Unavailable.

Let's find out if the API is causing an error

Step 1: Open Filezilla. And go to public_htm > wp-content > themes.

Step 2: Then open the active theme and find the file functions.php. When you find it, right click and select the option view/edit.

functions.php file view or edit

Step 3: Add the following code snippet to the file:

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

Save the files and exit.

function php file

Step 4. Check if your website is still giving the error. If so, the API is not the culprit. Go back to the function.php file and delete the code you just added. Don't forget to save the file.

But if the error is gone, the API called it. Congratulations on finding the cause!

That being said, permanently disabling the API is not a good idea, because it activates some pretty important features. However, you can reduce the number of API interactions with the server. Here's how:
Step 1: Install the Heartbeat Control plugin.
Step 2. On the dashboard, go to General Settings > Heartbeat Control.
Step 3: There are 3 options: WordPress Dashboard, frontend and post editor selection. Select Modify Heartbeat for all three options, and then reduce the frequency to the minimum.

Modify Heartbeat 

Step 4: Now open the function.php file and delete the code snippet.

That's it guys.

5. Talk to your CDN providers

In rare cases, CDNs can throw 503 errors. This happens when there is a connection error between the CDN server and your site. If none of the solutions above worked for you, it's most likely a CDN issue.

Contact CDN support and tell them that you have ruled out all other possibilities. Keep your CDN credentials at the ready. You will need them when talking to support.
We all people. I'm sure one of the above solutions will help you get rid of the error.

But there is no guarantee that this will not happen again. A 503 error could spell disaster for your site. In the next section, I'll quickly go over everything you can lose from the error, and what you can do to protect your site from this error in the future.

Impact of 503 Service Temporary Unavailable error on your website

If the 503 error persists for a long time, it could have the following effects on your site:

  • Visitors are starting to leave your site. This will be noticed by search engines such as Google/Yandex. Yandex and Google will conclude that your site does not meet user expectations and lower your ranking in search results.
  • Once rankings suffer, it will have a ripple effect. First, your traffic will drop, revenue collection will drop, and then your monthly income will be affected. This is bad news for those of you who rely on your website for income.
  • Even if you don't solely rely on your site to generate revenue, your search engine optimization efforts will be wasted. All the time, effort and money you have invested in building your website will be wasted.
  • Your brand reputation will also be undermined.

Fortunately, this will only happen when the problem is not immediately resolved. It is better not to wait for a repeat of the mistake and take preventive measures.

Protect your site from 503 errors in the future

There are several things you can do to prevent the error from appearing in the future. But before I get into them, I highly recommend setting up a backup service that will take a full backup of your website every day.

During crises like this one, a backup is your insurance. You can quickly get your site back to normal and investigate the error later.

Backups are only valuable when they are created on a regular basis. Otherwise, you may have to restore an old backup and lose any changes made to your site after that.

Check out BlogVault's WordPress backup service. It automatically backs up your entire website every day. Yes, every day. Thus, at any time, you will lose a maximum of one working day. And it will help you restore your website within seconds.

1. Update or add new plugins and themes to the trial site

As we have seen, updating or adding themes and plugins is one of the main reasons why the error occurs. You can't stop updating or trying new plugins and themes, but be careful. Try using a staging site. This is an exact copy of your live site.

The staging site has all the plugins and themes present on your original site. Update or add themes and plugins.

If everything goes well in the preparation phase, you can make updates and additions to the actual site. If an error occurs during provisioning, it does not affect the source site. Use the troubleshooting steps above on the staging site, just like you would on a live website, to find the cause and fix the issue.

2. Use a firewall to prevent DDoS attacks

Firewalls help protect websites from DDoS attacks. But not all types of firewalls are effective in this kind of attack. You need one that is cloud based.

The cloud firewall sits between your website and traffic. All incoming traffic is intercepted by the cloud firewall. It examines traffic requests. If it detects that the request is malicious, then that traffic is blocked.

So when a DDoS attack occurs, the bad traffic hits the firewall before reaching the site. The firewall bears the burden of the attack. Your site will remain intact.

3. Upgrade to a more efficient hosting plan

Server overload is the main cause of the 503 error. You may be experiencing more traffic, which is great. You need a server with lots of resources to be able to serve all your visitors. You will need to upgrade to a higher hosting plan.

However, let me ask you something: Is your website down often? Check your uptime monitoring tool for accurate data. If your hosting server is often down for one reason or another, you need to upgrade to a better hosting.

Finally

Errors are an integral part of website management. Don't let them get the better of you. My lessons will help you overcome them all.

Reading this article:

Thanks for reading: SEO HELPER | NICOLA.TOP

How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 312

No votes so far! Be the first to rate this post.

Читайте также:

Добавить комментарий

Your email address will not be published. Обязательные поля помечены *

13 + 5 =