Error 502, 502 Bad Gateway: in fact, whatever it says, it doesn’t really matter. When this kind of message appears on a page on your screen, no translation is needed.
The damage is already done. And you quickly understand that there’s a problem. The screen is (almost) completely white. You can’t view the page content. In short, you’re facing a 502 error.
It’s the kind of error every webmaster hopes not to encounter too often. When it occurs, it’s best to fix it as quickly as possible.
By the end of this article, you’ll be able to fix a 502 error on WordPress using 8 concrete, practical solutions.
And if that doesn’t solve your problem, don’t hesitate to contact our WordPress agency.
What is a 502 error?
Definition of a 502 error
HTTP 502 error, commonly called 502 Bad Gateway, is a server-side error.
When it occurs, the server cannot respond to a request sent by your web browser: an error message then appears on your screen. The page or article you want to view is unavailable and does not display.
In its official documentation, the Mozilla browser states that in the case of a 502 error, “the server, while acting as a gateway or proxy, received an invalid response from the upstream server”.
In practice, here is what happens, in order, when you encounter a 502 error:
- You want to access a web page, either by typing its URL (web address) into the search bar of your favorite browser, or by clicking on a link.
- Your browser sends a request to your site’s hosting server web. In simple terms, it asks whether it is able to display the page.
- If all goes well, the server processes the request and displays the content of the web page. It then returns a successful HTTP response code (code 200). You don’t see it on the screen; everything happens in the background.
- If there is a problem, a server error HTTP response code is displayed on the screen: the famous Bad Gateway.

What are the other types of server errors?
The 502 error belongs to the family of server errors (HTTP response codes from 500 to 599). Among them, for example, are:
- the 500 error (Internal Server Error): the server encountered a situation it does not know how to handle;
- the 501 error (Not Implemented): the server does not support the request method;
- error 503 (Service Unavailable), when the server is not ready to process the request (it is unavailable or under maintenance);
- error 504 (Gateway Timeout): the server was unable to provide a response in time;
- error 505 (HTTP Version Not Supported): the server is unable to support the version of HTTP used in the request.
Beyond that, you will also sometimes encounter:
- HTTP client errors (your web browser), such as error 404 (page unavailable);

- redirection errors, such as the 301 redirection response status code. It indicates that a page has been permanently moved to another URL.
Error 502 is not limited to WordPress. You may encounter it on other CMS (Content Management System) platforms such as Shopify, Squarespace, Wix, Drupal, Joomla, etc. But you may also encounter a 502 error on Google, or on any web server unable to forward a request to access a website.
How can a 502 bad gateway error appear on screen?
On your screen, the visual appearance of a 502 error can take different forms. For example, it may be displayed like this:

However, variations are possible, first of all in terms of form. Some hosting providers may customize its appearance to make it less austere.
Next, the wording that appears on the screen may come in different variants, with terms most often in English. Here is a non-exhaustive list:
- Temporary Error (502) or Temporary Error (502);
- 502 Error;
- HTTP Error 502;
- 502 Server Error;
- Error 502;
- 502 Service temporarily overloaded;
- Error 502 proxy error or 502 Proxy Error;
- HTTP Error 502 Bad Gateway;
- 502 Bad Gateway Nginx;
- HTTP Error 502 Bad Gateway;
- 502 Service Temporarily Overloaded;
- 502 Server Error: The server encountered a temporary error and could not complete your request.
What are the causes and consequences of a 502 error on WordPress?
What causes a 502 error?
Like most server-side errors, the 502 error provides very little information about why it occurred. From experience, however, we know that it can be caused by different types of factors:
- incorrect server configuration. This may involve problems related to the configuration of the proxy server, the PHP server, or the configuration of the web server configuration files;
- a lack of resources at the hosting server level. If it is too overloaded, for example due to a traffic spike on your website, it will not be able to process the request sent by your browser. It will crash and display a 502 error;
- a general server outage;
- errors in your web browser when displaying a web page;
- the presence of corrupted files or security vulnerabilities within your plugins or your WordPress theme;
- an incompatibility between plugins or themes after a recent installation or an update;
- a security issue on WordPress due, for example, to a DDoS attack (Distributed Denial of Service).
What is the impact of a 502 error on your WordPress site?
When it occurs, an HTTP 502 error can have negative consequences for your WordPress site, and more broadly for your online business.
If this error is not resolved quickly, you risk:
- damaging the user experience (UX), because your visitors will not be able to access your website content and find an answer or solution to their problem.
If the error occurs too often, they may turn away from your site and go to your competitors; - damaging your brand image. An unavailable website conveys an unprofessional image and may indicate a lack of reliability. You will appear less credible in the eyes of internet users.
- experience a drop in traffic. If Google’s bots repeatedly encounter 502 errors on your website, this can slow down the crawling of your pages and negatively impact your organic SEO. In addition, Google could remove the URLs of your affected pages from its index, which would lead to a significant drop in your visibility in search results.
- see your conversion rate drop. Visitors who cannot access your pages will not be able to complete the desired actions, such as purchasing a product, filling out a form, or subscribing to your newsletter. This can have a significant impact on your revenue.
- notice that some transactions are canceled. If you have a WooCommerce online store, for example, any payment transaction may be canceled if a 502 error occurs at the same time.
Unfortunately, a 502 error is inherently uncontrollable: there is no way to know when it will appear on your screen.
However, there are solutions to fix it if you ever have to deal with it. Find all our detailed explanations in the next section.
How to fix the 502 Bad Gateway error: 8 solutions
To begin, we recommend backing up your site before proceeding with technical troubleshooting. To do this, you can use a backup plugin like UpdraftPlus, or a maintenance tool like WP Umbrella. Whichever solution you choose, back up both your site files and its database.
If a problem occurs later, you will be able to easily restore your WordPress site.
Reload the page
Before diving into the source code of your WordPress website, see whether a small, very simple action can make the 502 error disappear.
Go to the “faulty” web page and reload it. To do this, press the F5 key on your keyboard, or click your web browser’s “refresh” icon:

If nothing happens immediately after this, wait a few minutes, then repeat the process again.
The server may have had a slight overload due to a spike in traffic. Giving it a few moments to catch its breath and recover can work.
There is also nothing stopping you from trying the following tips at the same time:
- try displaying the page in another browser. For example, if you are using Google Chrome, see whether that famous 502 Bad Gateway code also appears in Mozilla or Safari. If it does not, Chrome is probably to blame, for example through one of its extensions (an ad blocker you installed could be the culprit).
- use a tool to find out whether the website you want to visit is down for everyone, or whether the problem is on your end. You can try Down for Everyone or Just Me or Is It Down Right Now.

Clear your browser cache to fix a 502 error
The previous tip did not work? Let’s move on to the next solution, which is to clear your web browser’s cache.
To display a web page to a visitor as quickly as possible, a web browser caches it — basically, it keeps it in memory — after a first visit. This allows it to serve you a copy of the original page without having to download it again from the origin server.
It is an effective process. However, a 502 error will persist on the screen if the page is still cached, even though the server is no longer experiencing any problems.
To resolve this issue, clear your browser cache. Here is the method used on the Google Chrome browser, the most widely used by Internet users in France (the process is the same for competing browsers):
- Click on the 3 small dots at the top of the toolbar, on the right.
- Choose More tools > Clear browsing data. A pop-up window will open in the foreground.
- In the “General” tab, choose a time range (hours, days, weeks, or all data) and check the “Cached images and files” box.
- Click “Clear data” to clear the cache.

Is the 502 error still there? Read on.
Disable your plugins
Like any webmaster or WordPress user, you use plugins to add new features to your site.
It must be said that they are very useful, for example to strengthen your site’s security. Yes, but here’s the thing: sometimes, WordPress plugins can cause a 502 error.
This can appear after an update, due to an incompatibility or a problem in the PHP code.
To resolve it, you will need to find the culprit plugin by disabling all the plugins on your site.
Since your site may be inaccessible (making it impossible to log in to the admin area), you will need to go through either:
- an FTP client such as Filezilla (free);
- the administration interface provided by your hosting provider. One of the best known is called cPanel.
Here is the procedure to follow with FileZilla.
Rename the plugins directory to resolve a 502 error
Log in to FileZilla using the credentials provided by your hosting provider (username, password, and host).
Go to your site’s root folder (e.g., public_html), then navigate to wp-content > plugins. Change the name of this directory and recreate a new plugins folder (e.g., plugins-erreurs):

Reactivate your plugins one by one
WordPress will deactivate all your plugins. Is your website working again? Then a plugin is indeed the culprit.
If possible, log in to your site and reactivate your plugins one by one. Each time, remember to refresh your page.
When you find the plugin at fault, you have two options:
- delete it permanently and replace it with an alternative plugin;
- deactivate it until its developer releases a fix.
Finally, once all your plugins have been reactivated, don’t forget to delete the plugins-erreur folder from your FTP.
If this solution still hasn’t worked, your theme may be the cause.
Check whether your theme is causing the 502 error
To deactivate your theme, the process is the same as for your WordPress plugins. Only access to their directory changes. In detail, here is how to do it in your FTP client:
- go to the wp-content > themes folder;
- download the folder of your active theme by right-clicking and selecting “Download”.
- delete the theme you just downloaded (right-click > Delete).

Go back to your web browser and reload the page where the 502 error was displayed. If your theme was the cause, the error will have disappeared. In the meantime, WordPress will have activated one of its default themes (e.g., Twenty Twenty-Three).
If it doesn’t suit you, activate the theme you want (Astra, Kadence, Blocksy or GeneratePress are excellent choices).
Does the 502 error persist? Reinstall your theme, the one you previously downloaded to your computer, by uploading it to your FTP. Then move on to the next solution.
Deactivate your CDN and/or your firewall
Are you using a CDN on your WordPress site (for example via the WP Rocket cache plugin)? If so, deactivate it to see whether it changes anything on the screen.
CDN (Content Delivery Network) stands for Content Delivery Network. It is a group of interconnected servers located in different places around the world. These servers cache pages that do not need to be updated regularly and serve them to users more quickly by using the servers located closest to them.
As for the procedure to follow, it all depends on the service you use (Cloudflare, KeyCDN, RocketCDN, Bunny.net, etc.). Check its documentation to find out more.
Is the 502 error still causing trouble? In that case, you should check your firewall.
This is a tool capable of blocking malicious requests from your web server. Many WordPress security plugins offer this option. This is the case, for example, with one of the most famous of them, Wordfence Security.
To disable its application firewall, go to Wordfence > Firewall in your WordPress back office. In the “Web Application Firewall Status” menu, click the drop-down menu and choose the “Disabled” option (“Disabled”):

Finish by saving your changes, then reload your page. If the 502 error has disappeared, you have fixed the problem.
Otherwise, enable the firewall again to continue protecting your site. Let’s continue our investigation by taking a look at the logs.
Check your server logs
Logs are text files that record events that have occurred on your server. Access to these files is available through the interface of some hosting providers. Contact yours to see whether this is the case.
Alternatively, you can view these files using your FTP client or the file manager provided by your hosting provider (e.g., cPanel).
If a log file is already present in the root directory of your site, it will appear, for example, in this form: error.log. If you don’t have one, enable WordPress debug mode to display it.
Whenever possible, carry out this operation in a test environment (locally or on a staging site). Avoid doing this on production sites, in case your sites crash. To create a local site, we recommend the DevKinsta tool or Local. For a staging site, you can activate the WP Staging plugin or use this service through your web host, if they offer it.
To do this, access your wp-config.php file, located at the root of your site. Then manually replace the value “false” with “true”, as on the line below:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
If errors are detected, they will appear in a log file called debug.log. You will find it in wp-content > debug.log.
If you need to display your errors on screen, set the constant 'WP_DEBUG_DISPLAY’ to the value true.
Finally, don’t forget to set 'WP_DEBUG' back to false at the end of the process.
Change your PHP version
In WordPress jargon, WP_DEBUG is what is known as a PHP constant (the scripting language in which a large part of WordPress’s source code is written).
Speaking of PHP, let’s continue with it. When updating to a major version of WordPress, or simply installing new plugins, a 502 Bad Gateway error may have cropped up.
Under the hood, your site’s new configuration may no longer be compatible with the version of PHP you are using.
A version of PHP that is too outdated will prevent certain scripts or plugins from working properly. Hence the appearance of a 502 error.
For security and performance reasons, it is recommended to use one of the latest versions of PHP.
You can update it in just a few clicks from your hosting provider’s interface. But just before that, follow the recommendations in the official WordPress documentation:
- back up your site;
- update WordPress core, your themes, and plugins;
- check your site’s compatibility with the PHP version you want to use with the PHP Compatibility Checker plugin.
When you are ready, log in to your cPanel (or a similar interface provided by your hosting provider) and follow these two steps:
- In the “Software” section, click “Select PHP Version”.
- From the drop-down menu, select the PHP version you are interested in. At the time of writing, WordPress recommended a PHP version of at least 7.4. We recommend, if your site’s compatibility allows it, switching to at least PHP 8.0.

For greater peace of mind, test the new PHP version you want to enable on your site in a test environment. With KinstaDev or Local, you can choose the PHP version of your choice as soon as you create a new instance. If you don’t encounter any issues, you can make the switch to production with complete confidence.
Contact your hosting provider
Have all the solutions listed so far not worked for you? You may still be able to resolve this 502 error by contacting your hosting provider’s support team.
Clearly explain to them the situation you are experiencing and the steps you have taken so far to try to fix the error.
With a bit of luck, your hosting provider’s server may be the cause. The technical team will then take care of resolving the issue. On your side, all you will have to do is wait.
If that is not the case, ask support if they can increase the PHP execution time, that is, the maximum amount of time a PHP script can run. This technical measure can help you get rid of a recurring 502 error.
Summary
Thanks to this article, you now have an overview of the 502 error on WordPress. In summary, throughout these lines you have discovered in particular:
- what a 502 error is;
- what its variants are;
- what its causes and consequences are;
- 8 practical solutions to resolve it.
If you ever have to deal with this server error one day, don’t waste any time fixing it. As you’ve seen, the longer you wait, the more negative the consequences can be in terms of SEO, brand image, and revenue.
Would you like support in implementing our various tips to resolve a 502 error?
Available 7 days a week, our WordPress support service will offer you a tailor-made solution that meets your needs quickly, professionally, and effectively.
FAQ
What does “Bad Gateway” mean in French?
“Bad Gateway” literally translates as bad gateway in French. In practical terms, the meaning of the 502 Bad Gateway code is as follows: an intermediary server (proxy, load balancer, or CDN) received an invalid or incomplete response from the upstream server. In other words, your site is not directly at fault: the communication between two servers failed.
What is the difference between the 502 error and the 500, 503, and 504 errors?
These HTTP codes are all server errors, but they do not have the same cause. The 500 error (Internal Server Error) indicates a generic server-side problem, while 502 Bad Gateway indicates an invalid response received by an intermediary server. 503 (Service Unavailable) means the server is temporarily unavailable (overloaded or under maintenance), and 504 (Gateway Timeout) occurs when the intermediary server does not receive a response within the allotted time. In short: 502 = bad response, 504 = no response at all.
Why is my WordPress site showing a 502 Bad Gateway error?
A 502 Bad Gateway error on WordPress generally occurs when the PHP server (PHP-FPM) crashes or is overloaded, when a reverse proxy (Nginx, Cloudflare, Varnish) cannot reach the backend, or during a traffic spike that exhausts the available resources.
Poorly configured plugins, a PHP memory limit that is too low, or a blocked WordPress process can also trigger this error. In most cases, the issue is temporary and related to the hosting infrastructure.
How can you quickly fix a 502 Bad Gateway error on WordPress?
Start by reloading the page after 30 seconds: a temporary overload often resolves itself. If the error persists, clear your browser cache and your WordPress cache plugin’s cache, then check your hosting provider’s status. Temporarily disable your plugins (via FTP if the admin area is inaccessible) to isolate any potential conflict. If nothing changes, contact your hosting provider: they have the server logs needed to identify the exact cause of the 502 Bad Gateway.
How do you fix the 502 Bad Gateway error on Nginx with WordPress?
On a Bad Gateway Nginx WordPress setup, the error most often comes from a communication problem between Nginx and PHP-FPM. Check that the PHP-FPM service is running properly (systemctl status php-fpm) and that the socket or port configured in Nginx’s fastcgi_pass block matches the one PHP-FPM is listening on. If necessary, increase the fastcgi_read_timeout and fastcgi_connect_timeout values in the Nginx configuration. Restarting both services (nginx and php-fpm) is often enough to fix the 502 bad gateway nginx.
Does the 502 error come from my hosting provider or my WordPress site?
In most cases, a 502 Bad Gateway error is related to the hosting infrastructure rather than your WordPress site’s code. It may come from an intermediary proxy (such as Cloudflare or a load balancer), an overloaded PHP server at your hosting provider, or a network issue between two server layers. That said, a plugin generating excessive requests or a faulty PHP configuration (502 bad gateway php) can also be the cause on the site side. Checking the server logs will help you determine this quickly.
Can the 502 Bad Gateway error be caused by a WordPress plugin?
Yes, some plugins can indirectly cause a 502 Bad Gateway error by generating very heavy requests, consuming too much PHP memory, or triggering timeouts. This is particularly the case with poorly configured cache plugins, resource-intensive page builders, or import/export plugins processing large volumes of data. To check this, disable all your plugins, then reactivate them one by one until you identify the culprit.
How can you prevent 502 errors on WordPress in the future?
To prevent 502 Bad Gateway errors, make sure you choose hosting that is sized for your traffic and keep WordPress, your themes, and your plugins up to date. Set up a monitoring system (UptimeRobot, Jetpack Monitor) to be alerted immediately in the event of an outage.
Limit the number of active plugins, optimize your database queries, and implement an effective cache to reduce server load. In the case of a recurring 502 proxy error, a technical audit of your hosting is required.
