How To Fix “502 Bad Gateway” In WordPress

How To Fix “502 Bad Gateway” In WordPress

Last modified: April 20, 2020

FAQ
Cloudways

A 502 Bad Gateway error is when a hosting server receives an invalid response for the requested page. There are numerous causes for this common error and it can display in numerous ways. One of the most common reasons why this happens is that the request for the page has taken too long for the server to respond. This is often a temporary glitch caused by a high traffic load.

It might also happen when a theme or plugin has got bad coding in it. And it can also happen when there is a server misconfiguration. Therefore, there can be lots of steps to fix this issue.

Show More

* This button will show the rest of the post and open up an offer from a vendor

Step One: Retry Your Website

Sometimes, the cause of the problem has nothing to do with the website. In fact, your website could be receiving higher than normal traffic or the server could have insufficient resources at that moment.

So, wait a few minutes and then check again. If your site loads, you know the problem. To prevent this problem happening again, you could add resources to your website, but this is rarely necessary.

Step Two: Browser Cache

Your internet browser could also be showing you the error page from the cache. So, if the issue is resolved, then you might still get the 502 error because your site is being loaded by locally stored files, not those from your website.

Clear the browser’s cache (or use a new browser) and try reloading your site again. If it appears, problem solved. Also, do this step after every fix.

Step Three: Disable Your CDN Or Firewall

Sometimes the problem is caused by a fault in a CDN or website firewall. To check if this is the case, then disable either of them (if in use). You can then try to reload your site. If it appears, it was the CDN/Firewall causing the problem.

If this is the case, contact the provider and tell them the problem. They will need to fix it on their end. Once resolved, you can re-initiate your CDN/Firewall.

Step Four: Plugins/Themes

Sometimes the error is because there is an outdated theme/plugin. So, check for updates (especially if a major WordPress update has recently been launched) on all themes and plugins.

To do this, you need to disable all plugins and switch themes. You need to go to the plugins file in your WordPress files, using an FTP client and then change the name of the plugins file to ‘plugins_disable’. Then immediately rename the file to ‘plugins’ again.

This will disable all the plugins. Check your website now. It should display, but it will not have many of the features.

You can do the same with the themes.

Now go to your WordPress plugins directory in the dashboard and install/complete any updates before re-activating any of them.

Step Five: Check With Your Host

Normally, you will have solved the problem by now. But that isn’t always the case. So sometimes you need to speak to your hosting provider. Let them know the issue. If it is a server issue, they should be able to reconfigure it so it works better.

Final Word: Don’t Suffer From A Bad Gateway

Take control of your website and apply the fixes above when you see the 502 Bad Gateway error on your WordPress website. You probably won’t need a web developer if you use the quick guide above.

Recap:
Save 4 Later
Email liked links to yourself