We are a team of results-driven creative geniuses at PMGS Digital Agency that are enthusiastic about expanding your business and have the skills to do it.


How to Fix the 502 Bad Gateway error in WordPress.

How to Fix the 502 Bad Gateway error in WordPress.

Struggling to fix the 502 bad gateway issue on your website? This error can be brought on by a wide variety of factors, which makes it highly frustrating. This implies it may take some time to fix the 502 bad gateway problem. We’ll teach you how to quickly solve the 502 bad gateway problem in WordPress in this article.

What is a 502 Bad Gateway Error?

When your WordPress hosting server receives an improper answer for the requested page, a 502 bad gateway error is generated.

One of the frequent WordPress mistakes you could have on your website is the bad gateway error. The error message may also appear somewhat differently depending on your server, which is one of several possible causes.

502 bad gateway browser

Your browser makes a request to the hosting server whenever you visit a website. Following that, the hosting server locates the page and relays it to your browser along with the status code.

This status code would not often be shown. However, a status code and error message are provided in the event of a problem. Such errors include those with the status codes 404 Not Found, 503 Service Unavailable, 403 Forbidden, and others.

The most frequent cause of a 502 bad gateway error is when the server takes too long to respond to your request. High traffic volumes may be the source of this blip in time.

It can potentially be a bug brought on by a WordPress theme or plugin with inadequate coding. Last but not least, a server configuration error may also be to blame.

In light of this, let’s look at a simple cure for the 502 bad gateway issue in WordPress.

Fixing the 502 Bad Gateway Error

When your server is unable to determine the reason for the faulty answer, this error frequently results. This implies that until the issue is resolved, we will test various troubleshooting techniques.

All set? Let’s begin.

  1. Reload the site

Due to heavy traffic or inadequate server capacity, your server could occasionally take longer to reply. In that instance, the issue can just go away on its own after a short while. To determine whether this was the issue, try refreshing the page you are currently reading.

You don’t need to keep reading if this solved your issue. But if this problem keeps happening, you should keep reading since there could be another issue that has to be resolved.

  1. Clear browser cache

It’s possible that your browser is displaying the error page from its cache. You would still experience the 502 error since the browser was loading your page from cache even after the problem was resolved.


Try loading the webpage again after clearing the WordPress cache.

If the issue is being caused by browser cache, you might investigate using a different browser. Continue reading if the problem can be seen in all browsers.

       3. Turn off the firewall or CDN

It’s conceivable that their servers are malfunctioning if your website uses a CDN service or a website firewall. You will need to temporarily turn off CDN in order to verify this.

After being turned off, it will eliminate the extra barrier that was put in place between your browser and the hosting server. Your website will now load solely from your server, and if the CDN or firewall service was the root of the problem, it will now be fixed.

After that, you can ask for assistance from your CDN service provider. You can proceed and enable the CDN after the problem has been fixed.

  1. Update WordPress themes and plugins

The next step is to examine your theme or plugins whether the problem is still present.

You must first use FTP to disable every WordPress plugin. Visit your website later to see whether the issue has been fixed.

If so, one of your plugins was the root of the problem. Now, you must turn on each plugin one at a time until you can duplicate the issue. This will assist you in identifying the plugin that caused the problem.

You can search for an alternative plugin or get assistance from the plugin’s creator.

You should review your WordPress theme if disabling plugins didn’t resolve the problem. You must use phpMyAdmin to change the WordPress theme.

Visit your website to check on its functionality after changing your theme to the default WordPress theme. Continue reading if you’re still getting the error.

  1. Check the Hosting Server

If all of the troubleshooting techniques listed above were unsuccessful, the problem is probably with your hosting server.

You must get in touch with the support staff of your hosting company and inform them of the problem. You may also list every step you took in troubleshooting

If the problem is due to a server setup error, all reputable WordPress hosting companies will be able to resolve it right away.

Just that. Our goal in writing this tutorial was to teach you how to resolve the 502 bad gateway problem in WordPress.

If you think this article was useful to you, then stay tuned with us and subscribe to receive our blogs. If you wish to stay connected with us on social media, you can find us on Facebook, Instagram and LinkedIn