wp-config

What is 503 Service Unavailable Error and How to Fix It

Error 503 Service Unavailable indicates that the webserver is temporarily unable to process the request. This can be a web server that you are trying to access directly, or another server, which in turn is trying to access a web server. It is called error 503 because it is the HTTP status code used by the webserver to detect such an error. The error can occur for several reasons, but the two most common reasons are: the server is overloaded with requests or maintenance is being performed.

500 type errors are all somewhat similar, as the designation implies. For example, error 503 is different from Error 502 bad gateway. Error 500 occurs when something prevents the server from processing your request, and error 502 comes up when the origin server sent an invalid response to another gateway or  proxy. Here’s a guide that can teach you more about this specific error and the different  500 type errors.

As with other similar errors, website designers can configure how error 503 is displayed. Thus, on different websites, you can see different pages of error 503. Websites can also use several different names for this error. For example, you can see names such as:

  • Http / 1.1 Service Unavailable
  • 503 error
  • 503 Service Temporarily Available
  • 503 Service Unavailable
  • Service Unavailable – DNS Failure
  • HTTP Error 503
  • HTTP 503
  • Error 503 Service Unavailable

It is important to remember that error 503 is a server-side error. This means that the problem exists with the website you are trying to access, and not with the visitor’s computer or browser.

Causes of 503 Service Unavailable in WordPress

Various reasons can cause a 503 error to occur. They are as follows:

  • Errors in plugins
  • PHP script crashes
  • Not enough server resources
  • Malicious attacks, like the DDoS (Distributed Denial of Service)
  • Server errors

We will go through all these reasons and propose various solutions to resolve the 503 service unavailable error.

1. Plugin Error

An incorrectly working plugin can be the cause of most errors encountered in WordPress. By the way, broken plugins are the leading cause of error 503 in WordPress.

If you encounter error 503 after you have installed or updated a specific plugin, you will most likely already know where the issue is. All that is needed is to remove the problematic plugin, and the job is done.

However, if you are not aware of the kind of plugin that could be causing error 503, you need to start the diagnostics by deactivating the plugins.

How to Deactivate WordPress Plugins

Access your WordPress website’s files through an FTP client or using the File Manager of your hosting provider.

In your WordPress directory, look for the wp-content directory and open it. This folder contains plugins, media content, and themes.

After that, right-click on the plugins directory and rename it as plugins-old or another similar name. Doing this will help in disabling all plugins. If your site works when the plugins are disabled, then you’ve found the issue.

Rename the folder back to plugins and enter it. There do the same with each plugin installed. Every time you activate the plugin, reload the site to identify which is causing the issue. Once you have found the plugin, go to your plugins directory via FTP and delete it. If deactivating the plugins did not help in fixing the 503 services unavailable error, try other possible solutions.

2. Broken WordPress Theme

WordPress themes can be the cause of a 503 error. It is recommended to leave the default themes even after installing a new theme. This is because the default theme serves as a spare theme in case of a problem. If you suspect that your theme is causing error 503, you need to deactivate it.

Deactivating a WordPress Theme

You should create a backup before you deactivate your theme, so you can reupload it or restore your site. Connect to the WordPress website through an FTP and go to wp-content and the themes directory. Then, delete your current theme and refresh the site.

Alternatively, you can do this by accessing your  WordPress site’s dashboard and simply setting the  default theme through the Appearance tab.

If error 503 has disappeared, you need to fix or update your theme. If the 503 service unavailable error remains, a PHP code fragment with the error may be located somewhere else on your site.

Custom PHP code malfunctioning

Sometimes, a code from third-party services or a piece of code that you added to your site can cause the 503 error. But how will you determine if the problem is in the code? In normal mode, when your site is running, you can use debugging plugins such as Query Monitor and Debug Bar.

Enabling WP_DEBUG

But, since the 503 error often blocks you from entering the admin panel of your WordPress site, we will use the WP_DEBUG and WP_DEBUG_LOG, WP_DEBUG_DISPLAY, and @ini_set available in WordPress.

Follow these steps to enable debug mode in your WordPress site along with an error log:

Step 1. Open the WordPress directory through FTP or in the File Manager. Look for the wp-config.php file and open it.

Step 2. Scroll to the WP_DEBUG constant definition.

Step 3. Paste the debug magic code. Just fix the code define (‘WP_DEBUG’, false); to:

   Define, (‘WP._DEBUG,’ true.)

   define, (‘WP_DEBUG._LOG’, true.)

   define, (‘WP_DEBUG_DISPLAY’, false.)

   @ini_set (‘display._errors’, 0)

Step 4. Lastly, save changes.

Step 5. Next, find the file called debug.log inside your wp-content directory. Eliminate/replace the problem code and reload the site. If error 503 remains, the problem may be on your web server.

Server Reasons

Several server-related reasons can also cause a 503 service unavailable error. Usually, error 503 caused by server problems disappears automatically after a few minutes. If the error continues to appear, you most likely need to increase your hosting account’s resources.

Increasing Server Resources

Some shared hosting plans do not have the necessary amount of resources to work with time-consuming tasks. You might be getting more traffic than usual thanks to a successful marketing campaign or through improved SEO and organic traffic. If that’s the case, all you need to do is upgrade your hosting plan. For that, getting in touch with the provider’s support team should do the trick. Just to be sure, make sure to check resource usage statistics on your control panel, along with Google Analytics or whatever other tools you may use for gauging traffic.

Wrapping Up

There you go, you’re ready to tackle the 503 error on WordPress. We hope this article helped you get to the bottom of the issue. Good luck.

Tags: No tags

One Response