You are currently viewing What is HTTP 503 error and how do you fix it?

What is HTTP 503 error and how do you fix it?

  • Post author:
  • Post category:Blog
  • Post comments:0 Comments

If you’re facing a 503 error in the WordPress website, then this tutorial is for you. WordPress 503 error is a very common error, and you can fix this error by following the few steps that we’ve covered in this tutorial. 

Some steps are quite difficult in this tutorial, but you don’t need any deep technical knowledge.

In today’s tutorial, firstly, we discuss why the 503 error happened in WordPress, then we will show you the best solution for solving this problem and hope you can’t face this problem again with your WordPress website.

Let’s jump into our tutorial.

What is the 503 error? What causes it?

The 503 occurs when your website server can’t be reached, i.e., the server when fully unavailable. The main reason for this problem can be a badly coded theme or plugin, a wrong snippet going rogue, a server glitch, DDos attract, or an unexpected error happening with your hosting services. 

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

Most of the time 503 errors happen when you install a plugin from an unknown source or nonverified company. That plugin can’t be fully comfortable with wordpress then this problem occurs.

When you’re trying to add some custom code and if there’s any problem with that code then this problem also happens. 

Sometimes hosting can be the behind cases of this problem. Hosing down time you can face this problem.

Some theme or plugins maintenance problem is the cases of this problem.

DDoS attacks are the cases of this problem. So I suggest you use WordPress security plugins.

These are the typical reason that causes the 503 error in your WordPress website.

There are some different variations of this error in WordPress.

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

We’re fully covered in how to fix the wordpress 503 error in the wordpress website.

How to fix the 503 error in WordPress

The exact work for this work depends on your root cause. This 503 error can’t give you lots of information to fix this. So in this section, we’ll show you a few important steps that can be helpful for you, and you can fix this error.

Before we jump into your solution, make sure that you’re carrying out the following steps:

Usually, the 503 error behind cases is updating a theme or a plugin. You might want to check your website again that is a permanent issue or a temporary issue for your website. Make sure that clear your website caches before you check your website. 

As I mentioned earlier, sometimes, the 503 error happens for your hosting server maintenance work. It would be best if you had to be alert by reading your hosting provider’s mail. In this maintenance alert, you;r informed about how long the server is down, So you check your mailbox.

bluehost 503 error

Bluehost scheduled maintenance email

If the 503 error appears when you add some code snippet to your website, you know who the culprit is. In this case, remove the code you added before on your website and then your website back again, But if you’ve lost your full access to your dashboard, I suggest you restore your full website backup. Your hosting provider should be able to help you with this problem.

Did nothing work? Then let’s try these few steps below this.

1. Deactivate plugins temporarily

503 error are common cases when trying to install a plugin on your website. To determine if this case happens for a plugin, you’ve to disable all the plugins only temporarily. 

503 error prevents you from accessing your WordPress, so you need to go with your pannel to access all install plugins and themes on your website.

Open your hosting cPanel, and go to the public_html root directory. Then open the folder and navigate to the wp-content. Inside this folder, you’ll find another file called plugins. This folder contains all your active and inactive site plugins. Then rename the plugin folder name like plugins-old or whatever you want. This method will deactivate your all-install plugin.

503 error

After doing this, go to your website and check if the 503 error is gone or not. If the 503 error removes or is gone, you’ve to be sure that your problem was happening to a plugin.

Now, it’s time to find the plugin causing the issues.

Now go to your wp_conent folder and rename your plugins folder plugins-old to plugins. After opening the plugins folder, then do the same method with all your plugins one by one.

  1. First of all changes the name of your all plugins like AMP-old
  2. After any single changes check your website.
  3. If the problem is solved then you find the culprit, and you don’t need to change any plugin’s name just delete the plugins. If the problem is not solved then do this again.
  4. Repeat until you find the plugin that’s causing the problems.

Once you find the plugin, you just delete the plugins and hope your problem will be solved. After deleting the plugin, look for an alternative plugin. If your plugins are not causing the 503 error, then you’ll be trying the next method.

2. Deactivate your theme temporarily

Deactivating the theme is a little bit difficult; you can’t simply rename the theme folder as we did with our plugins folder. This process can be lead to an error of its own.

So here’s the solution, firstly you need to log in on your hosting account, then find the phpMyAdmin option on your cPanel.

Then select the wp_optionn and go to search. Under option_name, write the template and click on the Go button.

503 error

Finding your current theme in PHPMyAdmin

Then the system will be run a search, and it shows you your current then under the option_value. Then select edit and then change your current theme to a default theme or twenty-twenty theme.

503 error

Editing current theme in PHPMyAdmin

If this method fixes the error, then you might want to try to get an earlier version of the theme and install the updated version and wait for the theme’s developer to update the theme. If you’ve another option on your hand, then you can switch the theme.

3. Disable your CDN temporarily

Occasionally, 503 errors happen for CDNs, so disable it. Then check your website. If CDNs can fix this, then you can get a perfect solution. All CDNs have some options that allow you to pause this. You need to instantly log in on your Cloudflare account, then select your website and click on the pause Cloudflare on-site setting.

Next, check your website to see 503 error is gone or not; if you’re facing this problem, then jump to the next solution.

4. Limit WordPress Heartbeat API

The heartbeat API is important for several essential functions, like showing plugins notification, auto-saving posts, preventing you from accessing a post modified by someone, etc.

The API uses your server resources for these kinds of functions. If your server can’t handle the API demand, it throws the 503 error results. To determine the heartbeat API error, you need to disable it briefly.

Doing this, open your hosting cPanel and o to public_html → wp-content → themes. Then open the current theme directory and download a copy of the functions. File and then edit the file.

503 error

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')

}
503 error

Inserting code snippet in function.php file

After this process, save the file and check your website. If the problem is solved, then you’ve bought the problem.

But remember that, The heartbeat API is essential for your website, so you can’t keep it disabled for a long process. You can slow the frequency by installing a plugin called the Heartbeat Control plugin. Just make sure that before setting the plugin, you delete the code from the snippet.

5. Enable WP_DEBUG

When all your process fails, you can go with the debug mode to answer.

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

Since you’re facing a 503 error, accessing your dashboard and installing a plugin is out of the question. So you have to modify the wp-config file manually. 

Open your hosting cable and go to ublic_html → wp-config.php and download a copy of the file, then edit it, and lastly, insert the following code snippet into the file.

define( 'WP_DEBUG', true );

define( 'WP_DEBUG_LOG', true );

define( 'WP_DEBUG_DISPLAY', false );

Save the file and upload the file.

503 error

Inserting code snippet in wp-config.php file

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

The log file contains errors that your website has been facing. It’ll show you the causes of the error with some specific line of code that led to it.

Preventing 503 error WordPress in the future

You can prevent the 503 error from appearing on your website by following the instruction which is provided below this:

  • Use theme and plugin from trustable developers.
  • Move to a better hosting provider
  • Use a firewall to prevent DDoS attacks
  • Updating your all themes and plugins regularly.
ideatechy nesletter

Email Subscription

Join 200K+ Subscribers For Exclusive Access To Our Monthly News Letter With Insider Cloud, Hosting Discount, Free Coupon Code, WordPress Tips!

Leave a Reply