• Categories
    • Tutorials
    • Beginners Guide
    • WordPress News
    • WordPress Security
    • Best WordPress Plugins
    • WordPress Themes
    • Product Reviews
    • WP Tips & Tricks
  • Guides
    • Start a Blog
    • Make a Website
    • WordPress Hosting
  • WordPress Hosting
    • A2 Hosting
    • HostGator
    • Bluehost
    • Cloudways
  • Managed Hosting
    • WPEngine
    • Rocket.net
    • WPX
    • Kinsta
  • Coupons
    • WPEngine
    • Flywheel
    • Cloudways
    • A2 Hosting
    • WPX Hosting
Beginners Guide

What Is 502 Bad Gateway Error & How To Fix It In WordPress

Last Updated on: September 9, 2018 Editorial Staff Leave a Comment

What Is 502 Bad Gateway Error & How To Fix It In WordPress

WordPress is a solid software that provides a smooth experience for website users. Well, at least most of the times. Like most other software, WordPress also has some flaws that cause certain errors and malfunctions.

The 502 Bad Gateway error is one of the terrible errors that often frustrates WordPress users. Mainly because this is an error that’s quite difficult to troubleshoot. You need to go through several steps to figure out what’s causing this error and fix it.

If you’ve been getting a 502 Bad Gateway error and have trouble using your WordPress site, don’t worry. It can be fixed. You just need a little bit of patience and follow the step-by-step instructions below.

What Is 502 Bad Gateway Error?

502-bad-gateway-error

A 502 Bad Gateway error can be caused by many different things, but it mostly means there’s something wrong with your web server. And to explain what causes a 502 Bad Gateway error, you need to understand how websites work.

Whenever you visit a website, your browser sends a coded message to your server requesting the resources related to that specific page. Then the server sends back all the requested resources like the website design, layouts, images, etc, to show the webpage on your browser.

HTTP Status Codes are also included in this response sent from your web server. These codes aren’t shown to you unless there’s something wrong with the exchange process. The 502 Bad Gateway is one of the errors that show you the status code when the server discovers an invalid response while fulfilling a request.

What Causes This Error?

Unlike most other server errors, finding the cause of a 502 Bad Gateway error is difficult. There can be various causes from issues in your browser to incompatible plugins.

In most cases, the 502 error is shown when your web host takes too long to process an HTTP request. This usually happens when a server has to process too many requests for different websites, it’s especially common for shared hosting servers.

To figure out the real cause of the error, you need to go through a list of causes and see if it gets fixed.

How To Fix 502 Bad Gateway Error

Almost all of the methods for fixing the 502 error are beginner-friendly. You can even fix the error by yourself without any help from an expert.

Before making any changes to your website, always remember to backup your website.

Method 1: Hard Refresh The Webpage

502-bad-gateway-error-fix-2

As we’ve explained earlier, the 502 Bad Gateway error is mostly caused by server issues. But, oftentimes your browser may show this error even when the web host fixes the issue. To see if this error persists, try doing a hard refresh of the website.

To do a hard refresh (reload) of your website, simply press SHIFT + F5 for Chrome or CTRL + F5 for Firefox. This will reload the website from scratch by sending a fresh batch of the HTTP requests to your server.

Method 2: Clear Browser Cache

502-bad-gateway-error-fix-1

If reloading the website didn’t fix the 502 error, you can try deleting the browser cache. This will clear out all the saved data on a browser, such as cookies, cached images, and other bits of data related to websites and make your browser work like brand new.

To clear browser cache, press CTRL + SHIFT + DELETE on Chrome or Firefox to access the clear browser history window. Choose a time range and delete the cache.

See if this fixes your issue. If not, proceed to the next methods.

Method 3: Double Check Your Plugins & Themes

In rare cases, WordPress plugins could also cause your website to malfunction and send bad HTTP requests to your web server. This can happen when you install a new plugin or update a plugin to a new version.

To see if the 502 error is caused by a plugin or a theme, try resetting and disabling all of your plugins and then activating them one by one to see if the issue comes back. You can check the theme by switching to the default WordPress theme.

If you can’t access the WordPress admin area, you can reset and deactivate the plugins using an FTP client. Access the website files in your server using an FTP client. Browse to the WP-Content folder and then rename the Plugins folder. Just change the name from Plugins to something else.

This will deactivate the plugins on your WordPress website. Do the same for your themes. Except, don’t rename the Themes folder. Just rename the folder related to your active theme found inside the Themes folder. It will automatically revert your website to use the default WordPress theme.

Method 4: Disable The CDN

If you’re using a CDN (content delivery network) like Cloudflare, you should also try disabling your CDN to see if the issue is caused by the CDN service.

A CDN re-routes your website traffic through its own network of servers to reduce webpage load times. By disabling the CDN, you can send HTTP requests directly to your web server without any interference. See if this fixes the error.

Method 5: Check Your Web Hosting Provider

If none of the above methods worked, then it’s time to check with your web hosting provider. Before contacting the web host, check the Twitter and Facebook pages of your web hosting company to see if they’ve made any announcements related to server issues.

If not, use the support section to submit a support ticket or use live chat to reach your web host and ask what’s causing this issue.

In Conclusion

Most of the time, the 502 error is caused by issues with your web host, especially if your web host has recently moved servers to a different location. But, it’s always best to check things on your side before contacting your web host to save time.

If the methods we’ve described didn’t work, it’s probably the time for you to move your website to a better web hosting provider, preferably to a managed WordPress hosting platform.

+ Share
Disclosure

Editorial Staff

Related Posts

Back to all articles
  • Managed WordPress Hosting Options 2016

    8 Best Managed WordPress Hosting Providers for 2023 Compared

  • 10 Best WordPress Hosting Options for 2023 (Pros & Cons)

  • Best Cheap WordPress Hosting

    8 Best Cheap WordPress Hosting Providers in 2023 (From $1.99)

Coupons

View more deals
  • Recipe Card Blocks Coupon
    15% OFF

    Recipe Card Blocks Coupon

    Running a cooking or food website can be fun (and tasty) – but
    Get This Deal
  • WP 2FA Coupon
    20% OFF

    WP 2FA Coupon

    Security should be at the forefront of all site owner’s min
    Get This Deal
  • Themskingdom Coupon
    20% OFF

    ThemesKingdom Coupon

    First impressions count. As such, you’ll want a WordPress t
    Get This Deal

Leave a Reply Cancel reply

Full Disclosure This post may contain affiliate links, meaning that if you click on one of the links and purchase an item, we may receive a commission (at no additional cost to you). All opinions are our own and we do not accept payments for positive reviews.

THE BEST OF WPKUBE

Some of the best content we have published so far.

BEGINNER GUIDES & REVIEWS

18 Best Cheap WordPress Hosting Providers in 2023 (From $1.99)
210 Best WordPress Hosting Options for 2023 (Pros & Cons)
38 Best Managed WordPress Hosting Providers for 2023 Compared
45 Best WooCommerce Hosting Providers Compared in 2023 (All Budgets)
5Top 9 Landing Page Plugins for WordPress (2023)
69 Best List Building Plugins for WordPress In 2023
7How to Fix the 500 Internal Server Error on Your WordPress Website
8Thrive Themes Review: A Look At The Full Membership
9Beaver Builder Review: Is it The Best Page Builder Plugin for WordPress (2023)?
10OptimizePress Review: Create Landing Pages with Ease
11How to Make a Website: Complete Beginner’s Guide
12Top 22 Best Free Stock Photo Resources For Your Site
1317 of the Best Google Fonts for 2023 (And How to Use Them in WordPress)
14How to Start a Blog in 2022 (Step by Step Guide)
15How To Fix ‘503 Service Unavailable’ WordPress Error
1611 Best Contact Form Plugins for WordPress in 2023
17How to Add a Custom Logo to Your WordPress Site
18How to Fix Error Establishing a Database Connection in WordPress

WPX Hosting: 50% OFF

Save 50% on WPX Hosting using our exclusive coupon code.

Get this Deal

Flywheel(our review)

Our Newsletter

Get awesome content delivered straight to your inbox.

Thank you!

You have successfully joined our subscriber list.

.
Featured In Forbes Huffpost Entrepreneur SEJ

About WPKube

WPKube is an online WordPress resource which focuses on WordPress tutorials, How-to’s, guides, plugins, news, and more. We aim to provide the most comprehensive beginner’s guides to anything about WordPress — from installing plugins, themes, automated installs and setups, to creating and setting up pages for your website.

We have over 500+ tutorials, guides, product reviews, tips, and tricks about WordPress. Founded by Devesh Sharma, the main goal of this site is to provide useful information on anything and everything WordPress.

Twitter Facebook

Useful Links

  • Behind the Scenes
  • Beginner Guides
  • WordPress Hosting
  • WooCommerce Themes
  • MeridianThemes
  • Exclusive WordPress Deals
View All Guides »

Reviews

  • WPEngine 33% OFF
  • Thrive Leads
  • Flywheel 33% OFF
  • Divi Theme 20% OFF
  • Thrive Architect
  • Elegant Themes
Reviews »

Deals

  • InMotion Hosting
  • LifterLMS Coupon
  • LiquidWeb Coupon
  • WPEngine Coupon
  • A2 Hosting
  • FloThemes
More Deals »
© Copyright 2023 WPKube ® All Rights Reserved.
  • Contact
  • Site Terms
  • Disclosure
  • Privacy Policy