How to Fix a 502 Bad Gateway Error on Your WordPress Site.
The most baffling parts of operating a site are in scrutinizing an error when you don’t have the foggiest idea of why it’s arising. A few cases, the 502 awful gateway error, have innumerable probable causes. This implies you may need to strive on varied strides before you arrive on the valid one. We’ll explain to you the best way to assess this dubious error and unravel it.
To get on the work, let’s begin with, what is this error, and what induces the 502 bad gateway error that comes our way on the screen of WordPress.
What do you think of 502 gateway errors?
The rapport between a browser and a server is straightforward. Whenever you commune to browse a website, the browser sends multiple requests to the server which hosts this website. If the server responds to you usually, you can view the website with no errors. Otherwise, you likely can expect the 502 gateway error.
Meaning, the server not responding to your request can be one of the dilemmas, but the cause may also be due to various other elements.
Also read about fixing of [pii_email_aef67573025b785e8ee2] error
What results in the WordPress 502 gateway error?
- A server that is coordinated out, as of now inaccessible, or only not functioning as expected.
2. An issue with the reverse intermediary server.
3. Errors in the database to establish a connection.
4. The server is over-burden with such a large number of proposals. Maybe a white screen of death attack, or even bigger than-proposed claw in a rush due to traffic.
5. Defective PHP scripts, either with the plugins or themes.
If the errors are arriving due to the server, the service providers will dive in to resolve the issue of 502 gateway errors. It is advisable to contact them as soon as you confront this error. Otherwise, there is always a comprehensive way to deal with the issues. Let’s work on those strides.
How to fix the 502 gateway errors?
One of the simple steps that can be carried out to scan on the error before troubleshooting is to reset the router and check on the DNS settings. If this doesn’t do any help, then follow the troubleshooting strides.
Stride 1
Clearing browser cache!
The website relies either on the cache or the latest rendition of the site from the server to load the results for you.
If relying on the latest rendition is what it’s doing then,
- Try reloading the page, couple of times.
- Or force the reload by pressing Shift+ ctrl+R
Otherwise, it’s evident that it depends on the cache then do the following,
- Navigate to the settings on the chrome and move ahead to view the options in the Advanced menu.
- Here one can see the “Clear browsing data” preference.
- Look upon the cached images and files in the Basic tab.
- Disable deleting the browsing history if you want the browsing history.
- Hover upon to click on the Clear data button. This clears the cache successfully.
- Reload the page again.
If no changes are noticeable, then let’s move ahead.
” 500 internal server error WordPress is one of the most common errors that users face whenever they use WordPress. Know how to fix it.”
Stride 2
Disable CDN!
CDN simply stands for Content Delivery Networks. Why does this come into the picture is that proxy servers are like a gateway between the browser and the server? Simply, an intermediary server between the browser and website server. Due to this, the requests sent by the browser must go through this middleman and then to the website server. Now the problem arriving may be because the proxy servers are causing some issues to reach your request to the website server. CDN hosts these proxy servers and they use reverse proxy technology to handle the traffic effectively and sometimes this itself can cause issues.
So let’s just temporarily disable it to check if that’s inducing the issue in the first place. The CDN will vary from person to person as they count on the service. Browse for the instructions given by each service to disable the CDN temporarily.
Stride 3
Themes and plugins!
If CDN is not the offender, then either themes or plugins can be. Let’s see how to interpret if they are causing real trouble. So far, we checked on the server-side, browser-side, and intermediary service side. These all still contributed to the problems from another end. Now is to check on our end and that’s where plugin and themes come into play.
Only one plugin or theme can be activated at a time. To check on all the active themes and plugins to see which one of them is inflicting difficulty is the question here. The method is a manual process to set the website to a default theme or plugin, and reactivating them later takes just a few moments. On the safer side, let’s take a backup for it not to alter the performance of the website. Let’s check on it by a simple troubleshooting method that holds suitable for both the themes as well as plugins.
Follow the below steps to evade the issue and to do so,
- Open WordPress through an FTP client.
- Now look for the public_html – wp-content – plugins or public_html – wp-content – themes folder as here will be a list of folders for all the active and inactive plugins or themes.
- Right-click on the folder to locate the Rename option and now rename the folder disabled. Plugin or disabled.theme.
- Now the WordPress doesn’t identify this plugin and reloads the page.
- But before it loads, hit ctrl+f5 to delete the cache of the browser forcefully.
- If it doesn’t resolve the error from one folder, then restore the folder name to the original one.
- Similarly, check for each folder as mentioned above to see if any of them inflicts the 502 gateway.
All the plugins and themes must be checked one at a time. Don’t rename every folder altogether. By the end of this process, one would have checked for all the plugins and themes. And also note that while checking on the plugins gets the website back to normal then no need to check for themes. Only if plugins don’t resolve the conflict of 502 gateway error then check for the themes as well. If this couldn’t fix it, then hover upon the last stride.
Stride 4
Other potential remedies!
The WordPress website might have saved a few logs. These logs can be useful to enhance the site. If you are on WordPress 5 or using higher versions than that, you can see a site health tool that would be embedded in the dashboard. Make sure to read what the tool has got for you.
Cache and cookie being different, you can try to clear the cookies in the browser similarly by going to the Advanced Search. This may remove all the saved information on the browser.
If your site needs long execution time to resolve the issue if it’s still not leaving your way, then change the execution time by updating the functions.php file.
Look upon the DNS servers to see if the meetings are excellent. As sometimes configurations can lead to crises. Go to Cpanel or dashboard and check the settings for the host, domain registrar, and site strings. And in the worst-case scenario try manually clearing the DNS cache.
And if it persists contact your web host provider to get away with this if you are unaware of the problem being on your end or not.
Conclusion:
502 gateway error isn’t any hard if it seems so. This can be dealt with quickly if the issues were on the website, that is our end, then following the strides would lead you to the solution in no time. The