{"id":14413,"date":"2020-10-17T17:00:18","date_gmt":"2020-10-17T15:00:18","guid":{"rendered":"https:\/\/qodeinteractive.com\/magazine\/?p=14413"},"modified":"2021-01-25T00:06:44","modified_gmt":"2021-01-24T23:06:44","slug":"fix-502-bad-gateway-error","status":"publish","type":"post","link":"https:\/\/qodeinteractive.com\/magazine\/fix-502-bad-gateway-error\/","title":{"rendered":"How to Fix the &#8220;502 Bad Gateway&#8221; Error in WordPress"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column][vc_column_text]Troubleshooting errors is one of the harder tasks every WordPress website owner has to face. Despite WordPress being quite an easy platform to work with, errors do happen. The more common ones are often accompanied by a catchy name or an HTTP status code.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]In this article, we will discuss the 502 Bad Gateway error. Even though it isn\u2019t as common as the <a href=\"https:\/\/qodeinteractive.com\/magazine\/http-500-internal-server-error-in-wordpress\/\">500 Internal Server error<\/a> or <a href=\"https:\/\/qodeinteractive.com\/magazine\/503-service-temporarily-unavailable\/\">503 Service Temporarily Available error<\/a>, it can be as difficult to solve as its cause can vary. In this article, we will take a close look at what the 502 Bad Gateway error is, the reasons why it happens, and all the surefire ways for solving it. If you\u2019d like to skip to any specific part of the article, just click on one of the links below:[\/vc_column_text][vc_empty_space height=&#8221;22px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#understanding-the-502-bad-gateway-error\">Understanding the 502 Bad Gateway error<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#reloading-the-website\">Reloading the website<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#clearing-browser-cache\">Clearing browser cache<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#solving-the-dns-issues\">Solving the DNS issues<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#disabling-cdn-or-firewall\">Disabling CDN or firewall<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#solving-the-timeout-issue\">Solving the timeout issue<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#deactivating-your-theme-and-plugins\">Deactivating your theme and plugins<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#inspecting-the-error-log\">Inspecting the error log<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;5px&#8221;]<ul class=\"qodef-unordered-list-item qodef-toc\">\n    <li>\n\t        <div class=\"qodef-ul-title-holder\">\n            <span class=\"qodef-ul-title-content\"><a href=\"#contacting-your-hosting-provider\">Contacting your hosting provider<\/a><\/span>        <\/div>\n            <\/li>\n<\/ul>[vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\"><a id=\"understanding-the-502-bad-gateway-error\"><\/a>Understanding the 502 Bad Gateway error<\/h2>\n<p>[\/vc_column_text][vc_column_text]When you try to access a website, your browser sends requests to the server hosting the website. The server should send the website content and an appropriate response code in return. According to <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Status\/502\" target=\"_blank\" rel=\"noopener noreferrer\">Mozilla\u2019s definition of the error<\/a>, the 502 Bad Gateway server error response code indicates that the server, while acting as a gateway or a proxy, received an invalid response from the upstream server.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]However, this is a slight simplification of the problem. Most hosting setups nowadays include multiple servers: application servers, database servers, reverse proxy servers, web servers, and CDNs. Therefore, an error that implies an invalid response from one of the servers can happen for a multitude of reasons. Those include database issues, server timeout issues, faulty plugin or theme code, issues with the proxy server, web server overload, as well as browser cache issues, and many more.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]The error messages you could encounter are as diverse as the possible reasons behind the 502 error. They include <em>502 Bad Gateway nginx<\/em>, <em>502 Proxy Error<\/em>, <em>Error 502<\/em>, <em>HTTP 502<\/em>, <em>502 Service Temporarily Overloaded<\/em>, <em>502<\/em>. <em>That\u2019s an error, 502 bad gateway Cloudflare<\/em>, and so on.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/502-Bad-Gateway-Error.jpg\" class=\"attachment-full size-full\" alt=\"502 Bad Gateway Error\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/502-Bad-Gateway-Error.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/502-Bad-Gateway-Error-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/502-Bad-Gateway-Error-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Since there are a multitude of possible reasons behind the error, it can prove challenging to solve quickly. However, speed is essential. Having this error on your website for an extended period or occurring frequently can negatively affect your SEO ratings.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;80px&#8221;][vc_widget_sidebar sidebar_id=&#8221;new-top-picks-banner&#8221;][vc_empty_space height=&#8221;81px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">How to fix the 502 Bad Gateway error<\/h2>\n<p>[\/vc_column_text][vc_column_text]The appearance of the 502 Bad Gateway error usually indicates some kind of a server-side issue. However, as it can sometimes be caused by a client-side issue, it is important to run tests to determine the real cause. In this section, we will show multiple ways to troubleshoot the error, going from the methods that are easier to implement and moving on to more complex ones.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\"><a id=\"reloading-the-website\"><\/a>Reloading the website<\/h3>\n<p>[\/vc_column_text][vc_column_text]The easiest troubleshooting step and the one you should do first when facing a 502 Bad Gateway error is to <strong>simply wait a couple of minutes and then try to reload the page<\/strong>. You can do that by pressing the Reload button in your browser or using the keyboard keys\u2014F5 for Windows and Command + R for Mac. If this solves the error, then you don\u2019t need to review the rest of the article.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]However, if you experience the 502 error frequently, we suggest reading on. Our troubleshooting steps can help you resolve any underlying issues leading to 502 errors. Before we proceed, we also suggest testing your website on <a href=\"https:\/\/downforeveryoneorjustme.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Down for Everyone or Just Me<\/a>.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To do so, <strong>you simply need to insert the website URL<\/strong> in the appropriate option and <strong>press the <em>Or just me?<\/em> button<\/strong>, as shown in the image below.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Site-Down.jpg\" class=\"attachment-full size-full\" alt=\"Site Down\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Site-Down.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Site-Down-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Site-Down-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]This will help you establish if the issue is only on your side or not.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\"><a id=\"clearing-browser-cache\"><\/a>Clearing browser cache<\/h3>\n<p>[\/vc_column_text][vc_column_text]If reloading the page didn\u2019t solve the issue, the next step is to clear your browser\u2019s cache. This helps you avoid cases where the error screen is still showing because the page is being loaded from the cache, but the error itself is resolved.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>If you are experiencing a 502 error only on a single page, we suggest performing a hard reload\/refresh of that page<\/strong>. It reloads the page while deleting the browser cache for that specific page. <strong>Windows and Linux users can do this by pressing the CTRL and F5 keys at the same time. And MacOS users can do it by pressing the CMD, Shift, and R keys simultaneously. We recommend performing a hard reload before you test your site and after trying any of the suggested troubleshooting methods.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>If this error isn\u2019t limited to a single page only, we suggest fully clearing your browser cache<\/strong>. You might already be familiar with the process, but we\u2019ll show you the steps with the Chrome browse, just in case. Keep in mind, different browsers can display the same options in different ways.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To clear your browser cache in Chrome, <strong>click on the three dots<\/strong> located in the upper-right section of your screen. Then, <strong>click on the <em>History<\/em> option<\/strong> in the menu, and click again on the <strong>newly opened <em>History<\/em> option<\/strong> in the submenu. For users who prefer keyboard shortcuts, the same can be achieved by pressing the CTRL and H keys simultaneously.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"480\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Chrome-Clear-History.jpg\" class=\"attachment-full size-full\" alt=\"Chrome Clear History\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Chrome-Clear-History.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Chrome-Clear-History-300x206.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Chrome-Clear-History-620x425.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Then,<strong> press the <em>Clear browsing data<\/em> option<\/strong> on the left which will open a new page, as well as a popup window within it.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Chrome-Clear-History-2.jpg\" class=\"attachment-full size-full\" alt=\"Chrome Clear History\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Chrome-Clear-History-2.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Chrome-Clear-History-2-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Chrome-Clear-History-2-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Within the popup window, <strong>choose what you would like to delete, and set the time range for it<\/strong>. By default, you will be placed in the<em> Basic<\/em> tab. However, you can switch to the<em> Advanced<\/em> tab if you want more control over the things you wish to delete. After choosing the appropriate options, <strong>press the <em>Clear data<\/em> button<\/strong> to clear the cache.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Chrome-Clear-History-3.jpg\" class=\"attachment-full size-full\" alt=\"Chrome Clear History\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Chrome-Clear-History-3.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Chrome-Clear-History-3-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Chrome-Clear-History-3-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]<strong>Wait until the task is completed<\/strong>. Then,<strong> reload your website<\/strong> and <strong>check if the error has disappeared. You can also check whether the issue was caused by the cache if you open the website in a different browser.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\"><a id=\"solving-the-dns-issues\"><\/a>Solving the DNS issues<\/h3>\n<p>[\/vc_column_text][vc_column_text]DNS or Domain Name System is how domain names are linked to appropriate IP addresses. If a domain isn\u2019t matched with the appropriate IP address, it leads to a 502 Bad Gateway error. This is important to keep in mind when migrating your WordPress website, as the DNS name server will need to keep up with the shift. But, processing these changes depends on the TTL setting in your DNS records, and it may take between 24 and 36 hours to propagate.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>You will need to wait for these issues to resolve automatically. After that, you should test your website to verify that the error has disappeared.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]If you keep seeing the 502 error, you should consider <strong>flushing your local DNS cache<\/strong>. This serves a similar purpose as clearing your browser cache. Windows users can flush their local DNS cache from the Command Prompt, by running the ipconfig \/flushdns command. And macOS users can flush it using the terminal window to run the dscacheutil -flushcache command.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Flush-DNS-Cache.jpg\" class=\"attachment-full size-full\" alt=\"Flush DNS Cache\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Flush-DNS-Cache.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Flush-DNS-Cache-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Flush-DNS-Cache-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;82px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\"><a id=\"disabling-cdn-or-firewall\"><\/a>Disabling CDN or firewall<\/h3>\n<p>[\/vc_column_text][vc_column_text]Most website owners use CDNs or content delivery networks to serve static website resources (images, CSS, and JS stylesheets). This makes CDNs one of the most valuable assets for improving your website speed. However, an issue on their servers or a misconfiguration can cause the 502 Bad Gateway error.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To find out if this is the underlying issue behind the 502 error, <strong>you would need to temporarily disable the CDN service<\/strong>. As most WordPress users employ a plugin for integrating the CDN service, you would need to <a href=\"#deactivating-theme-and-plugins\">disable that plugin via FTP<\/a> to disable your CDN.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]If the 502 error disappears afterward, it confirms that the error was caused by your CDN service. <strong>To solve it, you need to contact your CDN provider and ask for assistance. After the issue is resolved, you can simply re-enable your CDN service.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Additionally, sometimes hosting providers will offer protection against DDoS (Distributed Denial-of-Service) attacks in the form of a firewall. This firewall can block requests coming from the CDN server and cause the 502 Bad Gateway error. In that case, to solve the error, <strong>you need to disable the firewall or adjust its configuration not to block requests from your CDN<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\"><a id=\"solving-the-timeout-issue\"><\/a>Solving the timeout issue<\/h3>\n<p>[\/vc_column_text][vc_column_text]PHP timeout issues happen when a single PHP process runs for more than the max_execution_time setting allows it to. It usually happens when you try to import larger files in WordPress. When the issue happens, it is followed by the 502 Bad Gateway error. Luckily, <strong>these types of 502 errors can be solved quite easily by increasing the max_execution_time server resource<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]In most cases, setting the value to 300 seconds or higher will solve the issue. However, to do so, <strong>we suggest contacting your hosting provider regarding the increase<\/strong>. You might need to negotiate the <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-fix-wordpress-maximum-execution-time-exceeded-error\/\">max_execution time increase<\/a>, as it can be limited by your current hosting plan.[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\"><a id=\"deactivating-your-theme-and-plugins\"><\/a>Deactivating your theme and plugins<\/h3>\n<p>[\/vc_column_text][vc_column_text]Poor code is often the reason why scripts and queries get terminated by your server. As such, it is important to test your themes and plugins thoroughly. For example, caching plugins are a likely suspect when investigating the 502 error.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To check if this is the case for you, we will show below how you can deactivate your themes and plugins <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-use-ftp\/\">via FTP<\/a>. However, the process of deactivating a theme has an important prerequisite \u2013 you need to have <a href=\"https:\/\/wordpress.org\/themes\/\" target=\"_blank\" rel=\"noopener noreferrer\">a default theme<\/a> installed for testing purposes. When you deactivate your current theme, WordPress will need a theme to fall back on. Therefore, if you haven\u2019t done so already, make sure <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-install-wordpress-theme\/\">to install a theme<\/a> from WordPress, such as TwentyTwenty. After that, you can follow the steps below.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To deactivate your current theme,<strong> connect to your server using your FTP credentials<\/strong> and <strong>navigate to your root WordPress directory<\/strong>, often called public_html.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/FTP-Public-HTML.jpg\" class=\"attachment-full size-full\" alt=\"FTP Public HTML\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/FTP-Public-HTML.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/FTP-Public-HTML-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/FTP-Public-HTML-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Then, <strong>navigate to the \/wp-content\/themes directory<\/strong> and<strong> locate your current theme\u2019s folder. Right-click the folder<\/strong> and<strong> press the <em>Rename<\/em> option<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/FTP-Deactivate-Themes.jpg\" class=\"attachment-full size-full\" alt=\"FTP Deactivate Themes\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/FTP-Deactivate-Themes.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/FTP-Deactivate-Themes-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/FTP-Deactivate-Themes-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]<strong>Rename the folder to deactivate the theme.<\/strong> We suggest keeping the original name of the theme, to avoid further confusion. So you can <strong>add a self-explanatory suffix<\/strong> like .deactivated, .backup, or .old while renaming your folder.[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Deactivating-Themes.jpg\" class=\"attachment-full size-full\" alt=\"Deactivating Themes\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Deactivating-Themes.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Deactivating-Themes-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Deactivating-Themes-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Renaming the theme folder will deactivate your current theme. This will make your previously-uploaded default theme the active theme on your website.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>Afterward, check the website by reloading it to see if the 502 error has disappeared. If it has, then the fault lies in the theme you were using. You should contact its authors and ask for help in resolving the 502 Bad Gateway error. If the error remained after you deactivated the theme, it means your theme is not to blame and you should one of our other troubleshooting suggestions.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]In the same vein, you can test your plugins by deactivating them via FTP. To do so,<strong> find your root WordPress directory<\/strong> and <strong>open the wp-content directory. Then locate the plugins folder within, right-click on it<\/strong>, and<strong> press the <em>Rename<\/em> option.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/FTP-Finding-Plugins.jpg\" class=\"attachment-full size-full\" alt=\"FTP Finding Plugins\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/FTP-Finding-Plugins.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/FTP-Finding-Plugins-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/FTP-Finding-Plugins-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]<strong>Again, we suggest keeping the original name and only adding a suffix such as .deactivated or .old.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/FTP-Deactivate-Plugins.jpg\" class=\"attachment-full size-full\" alt=\"FTP Deactivate Plugins\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/FTP-Deactivate-Plugins.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/FTP-Deactivate-Plugins-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/FTP-Deactivate-Plugins-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]Renaming the plugins folder will deactivate all your plugins. More precisely, it will deactivate them and make them inaccessible from your admin dashboard.<br \/>\n[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]You should, then,<strong> reload your website and inspect whether the 502 Bad Gateway error is gone. If the issue is still present, then its cause doesn\u2019t lie in your plugins and you should try some of the other suggested solutions.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>But, if the error is gone, it means the culprit was one of your installed plugins. In that case, the only thing that remains is to pinpoint which one it is.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]To find the exact plugin causing the error, <strong>restore the plugins folder\u2019s original name\u2014plugins<\/strong>. This won\u2019t activate your plugins, but it will make them accessible from the dashboard.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]Then, <strong>log in to your admin dashboard<\/strong> using your WordPress credentials and <strong>navigate to Plugins &gt; Installed Plugins. You should activate your plugins one at a time. After activating each, you should reload the page where you were checking for the 502 error. Repeat the process until you find the faulty plugin. You\u2019ll know which one it is if the 502 Bad Gateway error re-appears after you activate it.<\/strong>[\/vc_column_text][vc_empty_space height=&#8221;50px&#8221;]<div class=\"qodef-single-image-holder   qodef-has-border \">\n    <div class=\"qodef-si-inner\" >\n                                    <img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"374\" src=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Activating-Plugins.jpg\" class=\"attachment-full size-full\" alt=\"Activating Plugins\" srcset=\"https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Activating-Plugins.jpg 700w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Activating-Plugins-300x160.jpg 300w, https:\/\/qodeinteractive.com\/magazine\/wp-content\/uploads\/2020\/10\/Activating-Plugins-620x331.jpg 620w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/>                        <\/div>\n<\/div>[vc_empty_space height=&#8221;38px&#8221;][vc_column_text]When you\u2019ve found the plugin that is causing the 502 Bad Gateway error, <strong>you should contact the plugin authors about solving the error<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\"><a id=\"inspecting-the-error-log\"><\/a>Inspecting the error log<\/h3>\n<p>[\/vc_column_text][vc_column_text]Sometimes, even after going through all the previously suggested solutions, the testing might be inconclusive and the true origin of the 502 error a mystery. On those occasions, <a href=\"https:\/\/qodeinteractive.com\/magazine\/how-to-turn-on-error-logs-in-wordpress\/\">examining the error log<\/a> can give you valuable insight into all the issues that happened on your website. Depending on which file paths are mentioned in the error log, you have a few options. You can contact your theme authors, the appropriate plugin authors, or your hosting provider for further help.[\/vc_column_text][vc_empty_space height=&#8221;72px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h3 class=\"qodef-h5\"><a id=\"contacting-your-hosting-provider\"><\/a>Contacting your hosting provider<\/h3>\n<p>[\/vc_column_text][vc_column_text]Contacting your hosting provider is often an integral part of solving any WordPress error. Even if you weren\u2019t able to solve the 502 Bad Gateway error with the previous troubleshooting suggestions, <strong>you should still contact your hosting provider<\/strong>.[\/vc_column_text][vc_empty_space height=&#8221;28px&#8221;][vc_column_text]<strong>Explain your issue thoroughly, as well as all the steps you\u2019ve taken<\/strong>. After exhausting all the common reasons for the error, the next most likely cause is a web server-side issue. In that case, they can let you in on what happened and help you efficiently and quickly solve the error.[\/vc_column_text][vc_empty_space height=&#8221;68px&#8221;][\/vc_column][\/vc_row][vc_row][vc_column][vc_column_text]<\/p>\n<h2 class=\"qodef-h4\">Final thoughts<\/h2>\n<p>[\/vc_column_text][vc_column_text]After reading this article, you should have a clearer understanding of what a 502 Bad Gateway error in WordPress is and the many reasons it can occur. However, if you follow our troubleshooting suggestions, we are confident you will solve it in no time. If you are concerned about the issue reoccurring, feel free to bookmark this article for future use.<br \/>\n[\/vc_column_text][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re tired of tripping over different WordPress errors on your site, then come check out our guide for troubleshooting the 502 Bad Gateway Error.<\/p>\n","protected":false},"author":11229,"featured_media":14512,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[4,52,13],"class_list":["post-14413","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-tips","tag-troubleshooting","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/14413","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/users\/11229"}],"replies":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/comments?post=14413"}],"version-history":[{"count":0,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/posts\/14413\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media\/14512"}],"wp:attachment":[{"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/media?parent=14413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/categories?post=14413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qodeinteractive.com\/magazine\/wp-json\/wp\/v2\/tags?post=14413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}