13 Ways to Fix the 502 Bad Gateway Error on Your WordPress Site in 2020

Table of Contents

You often have encountered a 502 Bad Gateway error while surfing the web. It’s unfortunate, isn’t it? But it’s even more unfortunate if it happens with the website you own. Think about the user experience, the impact it will have on your traffic and how it will affect your search engine ranking. Most of the time this issue is on the server-side and it isn’t much you can do in that case. But there are some steps you can take to resolve this. Let’s dive into it.

What is 502 Bad Gateway Error?

When a browser sends a request to a website, the server responds with requested resources and an HTTP header. An HTTP status code accompanies this. When something goes wrong, the system helps identify the error. 502 Bad Gateway is an HTTP status code. This means that one of the servers on the internet has received an invalid response from another server.

This error has nothing to do with what kind of setup you are using, the browser or device. It can occur on any browser, on any device or any operating system.

One particular feature of this error is that it can be customized by each website. Here are some of the variations of the 502 Bad Gateway Error:

Variations of 502 Bad Gateway Error

  • 502 Bad Gateway
  • 502 Service Temporarily Overloaded
  • 502. That’s an Error
  • Error 502
  • HTTP Error 502 – Bad Gateway
  • 502 Server Error: The Server encountered a temporary error and could not complete your request
  • 502 Proxy Error
  • HTTP 502
  • Temporary Error (502)

This error is displayed in the same fashion the web pages are displayed in the browser window. One of the examples of customized 502 Bad Gateway Error is the famous Twitter error page that displays “Twitter is over capacity”.

 How to Fix a 502 Bad Gateway Error - The error message reads: "Twitter is temporarily over capacity. Please try again later."

What is the cause of this error?

This error occurs mostly because of the issues between the online servers that handle your traffic. Thus, there is nothing much you can do as the problem is not on your side. But sometimes, this problem occurs even if there is no real issue. There may be a fault with your browser, your system or your router. In any case, it is better to check all possible scenarios to do what you can do

How to Fix a 502 Bad Gateway Error

The 502 Bad Gateway Error can definitely be irritating. Confused about how to tackle this awkward situation? Don’t worry. This step by step guide will help you fix this error in no time.

1. Reload the page:

Press CTRL-R or F5 on your keyboard to reload the page. You can also right click with the mouse and select refresh or reload. This can be the easiest step to solve this error.

2. Reload the Browser:

Try closing all the tabs and closing the browser. Then restart the browser and start the new session. Now, visit the page again. The error may have caused by the use of your browser. A restart might solve the problem.

3. Clear Browser Cache

A Browser stores important information in the cache. Sometimes this information becomes outdated and corrupt. This might cause the 502 Bad Gateway Error. Clearing the browser cache will resolve the problem. Here is how you can clear the browser cache for all the latest browsers.

4. Clear Browser Cookies:

Cookies are stored to retain certain data that is required to access a webpage. As is the case with browser cache, cookies can be outdated. It is best to try clearing cookies if clearing cache does not solve the problem. You can also delete specific cookies for each site instead of deleting all of them. It is better to delete all the cookies but you can try deleting specific cookies if that solves the problem.

5. Try Safe Mode:

You can start the browser in Safe Mode. This will disable the extensions and run the browser with default settings. Now, you can check if the error is occurring. If it is solved, then the problem is definitely with one of the extensions. Select each extension and try reloading the webpage. Search which extension is causing the error and then take action.

6. Try a Different Browser:

If all the above steps do not work, then try changing the browser itself. If you are using Google Chrome then try switching to Firefox, Safari or Microsoft Edge etc. If this solves the problem, then you can conclude that the problem was with your earlier browser. You can try reinstalling that browser and see if the problem is solved. Trying a different browser is definitely a good idea.

7. Restart Your Computer:

There can be some temporary problem with the system you are using, the way it connects to the network could cause the 502 Bad Gateway error. Restarting your computer will reset the situation and might fix the error if it is associated with the system.

8. Restart your Networking Gear:

Check your modem, router, switches and other networking devices. These might be causing the error. Restarting them might solve the problem.

9. Change DNS Server:

DNS servers are assigned by ISPs by default. These work most of the time. But you can try changing them on your device, router or computer. You can use public DNS servers such as the ones provided by Google. A problem with DNS can cause a 502 error.

10. Check Plugins at your WordPress site:

Sometimes a bad code in a plugin can interfere with the functioning of your website. This can cause a 502 error. To resolve this, simply go to the dashboard of your website. Select Bulk Actions. Choose Deactivate for all plugins. This will disable all the plugins. Now, you can check if the problem is resolved. If it is solved, then the source of the problem is definitely with one of the plugins. Find it by activating the plugins one by one.

11. Contact your Host:

The 502 error may be on the server-side. Contact the web host or administrator and let them know about the problem you are facing. In shared hosting, scripts like kill scripts can cause errors while accessing the website as the resources are shared.

12. Contact Your Internet Service Provider

In the rare instance when there is no problem with your browser, computer, networking equipment, or website and if you are still getting the 502 error, then it might be a network issue caused by your ISP.

13. Wait

After trying all these steps, you can only hope that the issue gets solved by your ISP or website’s network. The only thing that is remaining to be done is to wait. If you have contacted your ISP and website administrator, they will let you know when the issue gets resolved at their end.

We have seen many ways in which we can try to fix the 502 error. Yet, this is typically a server-side issue on which we have little or no control. The above steps help you to do everything you can at your side. Is there a better way you have tried? Please share in the comments so others in the community will also know. Thanks for reading. Have a Happy Day!

Fully Managed WordPress Hosting

Nestify’s AWS powered dedicated CPU servers keep your sites fast, secure, and always up to date.

Want faster WordPress?

WordPress Speed Optimization

Try our AWS powered WordPress hosting for free and see the difference for yourself.

No Credit Card Required.