Site icon Hip-Hop Website Design and Development

How to Fix the 504 Gateway Timeout Error in WordPress

Your internet browsing session has just been interrupted by an untimely 504 Gateway Timeout error. Most likely, you’ve seen this error from time to time, since it happens when a browser fails to connect to the website you’re attempting to visit. It’s a nuisance for web users who are simply trying to navigate to their site of choice.

If you’re a website owner, this error is more than an annoyance. Getting a 504 Gateway Timeout error on your WordPress website could actually be costly for your business, resulting in a high rate of lost traffic, conversions, and ultimately, income.

Thankfully, troubleshooting a 504 error is both common and fairly straightforward. This article will explain why 504 errors occur, and a few approaches to fixing them.

Let’s dive in!

What Is A 504 Gateway Timeout Error?

Chances are, you’ve seen 504 Gateway Timeout errors multiple times. It tends to be confused with error 404, which appears when a page is not available or no longer exists. However, a 504 error means that the page exists, but your browser just can’t connect to it in a timely manner.

In order for a user to be able to access a website, it must be hosted on a web server that has external access. When you access that site’s domain, your browser establishes a connection to the server, then waits for a response. On the occasion that a server fails to respond, the website won’t load. That’s why you see the 504 error.

A 504 error may look different, depending on what browser you’re using. Each web browser displays its own unique 504 Gateway Timeout error screen. Additionally, individual sites can also customize their own error screens. Take a look at ours:

What Causes The “504 Gateway Timeout” Error?

Internet connections route through multiple servers, or gateways, before they reach their destination. When you visit a website, the connection moves through servers that must all respond properly in order for the website to display. If any of the servers fails to respond, you’ll see a 504 Gateway Timeout error.

Unless those servers are actually down, they should technically respond at some point. Still, internet browsers are configured to stop connection attempts after a certain time period. It’s a feature that keeps your computer from getting stuck in a perpetual connection attempt to an unresponsive server.

Here are a few reasons why a server might not respond:

Oftentimes, 504 Gateway Timeout errors will resolve without any action on your part. However, you should still take notice when they appear. If the problem is coming from your hosting provider, it isn’t likely to persist for a long time. A solid hosting provider should take care of the issue promptly.

On the other hand, sometimes a 504 error persists. If it continues for over an hour, that’s when you need to take action.

How To Fix The “504 Gateway Timeout” Error (6 Ways)

First off, if your 504 Gateway Timeout error persists, you can always contact your web host. It never hurts to check on your system’s status. If they let you know that everything looks good on their end, that means you’ll need to troubleshoot on yours.

Thankfully, there are several ways to approach fixing a 504 error on your WordPress site. Let’s take a look at your options. Keep in mind that you should create a backup of your website before you attempt any of the more involved fixes.

1. Reload and Reboot

Before you dive into the more in-depth options for fixing a 504 Gateway Timeout error, there are a few simple steps you can take. First, attempt to reload your browser. Wait for a few minutes after you receive a 504 error, then click the Reload icon.

In addition to reloading your browser window, you can attempt to:

2. Check Your WordPress Plugins and Theme

Sometimes, an issue with your theme or one of your plugins can cause a 504 error to appear on your site. Ensuring both are updated correctly is your first step toward a potential fix–if, in fact, your plugins or your theme happen to be causing the problem. Additionally, you’ll want to make sure that the backbone of your WordPress install is up to date and that the server is running the right PHP version.

Disabling your WordPress plugins could possibly clear up your 504 Gateway Timeout issue. Access your main website directory via an FTP client (we’re using FileZilla in this example), then open your wp-content folder. From there, you’ll see a folder named “plugins.”

To quickly deactivate your plugins, just rename the folder. You can call it plugins.deactivated or plugins.old if you want.

Then, head back over to your browser and reload. If your site displays without a problem, that means a plugin is causing your 504 error. To pinpoint which plugin was causing the error, you’ll need to re-enable your plugins folder (just rename it to “plugins”), then manually deactivate each individual plugin, reloading the site as you go. That should help you identify which plugin you need to remove.

If you’re interested in exploring whether there’s an issue with your theme, make doubly sure you’ve backed up your website. For those who are experienced in working with WordPress themes, you might consider switching themes to see whether the problem persists. Otherwise, check in with your domain host or a WordPress developer for assistance.

3. Test Your Local Proxy And/Or VPN Settings

Is your internet connection configured to utilize a proxy server? This could be causing your 504 Gateway Timeout error. If you want to test the theory out, you will want to access the settings of the browser you’re currently using. From there, you’ll be able to find out whether you have enabled a proxy server for your local network.

Accessing the settings will be slightly different, depending on the browser and operating system (OS) you’re using right now. I’m using Google Chrome, so I’ll show you what it looks like to locate and access the Settings menu. Simply head over to Settings > Advanced, where you’ll see a link labeled System.

From there, click “Open your computer’s proxy settings.”

I’m using Mac OS, so from here, I would want to uncheck the boxes under “Select a protocol to configure.” Then, go back and reload your browser window to see if that corrected the problem.

If you’re using a PC, head over to Settings > Network & Internet Connection, then click Proxy. You’ll see a button beside “Automatically detect settings.” Go ahead and turn that off. Then, turn off the option to “Use a proxy server.” Go back to your browser and reload to test the results.

Using a VPN can also cause occasional 504 errors. If you’re a VPN user, consider disabling your VPN and reloading to see if that’s causing your 504 Gateway Timeout error to display. (If you’d like to know more about using a proxy server vs VPN, we’ve written about that here.)

Attempt to regain access to your website. If your proxy server or VPN caused the 504 error, then wait a few hours before you re-enable. Chances are, the issue will correct itself.

4. Check Your Domain’s “Propagation” Status

In the past, we’ve covered how the Domain Name System (DNS) works. Essentially, when you purchase, register, connect, or move a domain name, the information needs to propagate (or spread) across a server network that makes up the DNS. This process can take a day or two (up to 48 hours), so your site will likely experience a brief downtime if you’re in the middle of registering or transitioning your domain name.

Some people, including you, may not be able to access your website if the domain hasn’t fully propagated. In that case, you might see a 504 Gateway Timeout error.

You can use a tool such as DNSMap to check your site’s domain propagation status. From the home page, type your domain name into the search box and click Check DNS Propagation. Here are the results for one of my websites:

You’ll notice that two of the nameservers don’t have my site on record, and that’s normally not a reason to be concerned. However, if I had gotten a negative result (which would be highlighted in red), I’d assume my domain hadn’t fully propagated. If you do get a negative result, particularly from multiple nameservers, then you probably just need to give it a little more time.

You can also log into your site host’s portal to see your domain’s status. If the issue persists, check in with your host’s customer support team.

5. Temporarily Disable Your Website’s Content Delivery Network (CDN)

If you’re using a CDN, it could be causing your site to display a 504 Gateway Timeout error. A CDN is a network of servers that each hold a duplicate of your website, which makes it easier for more users to access worldwide. Sometimes, though, the CDN can cause issues.

It’s fairly rare for a CDN to cause a 504 error, since CDN’s act as an additional gateway between your site server and end users. A CDN can handle a large traffic load, but there are times when they glitch. When a CDN is causing a 504 Gateway Timeout, your provider will display the error, which will indicate what the problem is. If you’re using Cloudflare, for example, this is the error screen you’ll see:

If you’re able to access and disable your own CDN (some site owners cannot), try temporarily doing so to see if that resolves your 504 error. Leave it disabled for at least a few hours, then try to access your site again. If you can’t disable your CDN but want to give it a try, contact your site host.

6. Ask Your Website Host To Evaluate The Server For Problems

Depending on the cause of your 504 Gateway Timeout error in WordPress, you probably won’t experience much downtime on your site. However, take note of how long the error displays. If it remains unresolved for longer than a few hours, then you may need to contact your domain host.

There are a number of more in-depth issues that could be causing your WordPress site to show a 504 error. Having your website host to evaluate your server could help you gain further insight into what might be causing the problem. Some possibilities include:

If you need help, your domain provider should be able to assist you with evaluating your server’s error logs and any further issues that could be causing the 504 Gateway Timeout error. From there, they can help to identify and resolve the problem.

Conclusion

Most of the time, a 504 Gateway Timeout error shouldn’t be a cause for alarm. At the same time, it definitely shouldn’t be ignored. If you’re seeing a 504 error on your WordPress website, it’s time to take action and figure out what the issue is.

As a quick recap, here are some of the steps you can try to troubleshoot a 504 error:

  1. Reloading your browser, rebooting your devices, or even rebooting your router
  2. Checking to ensure that your WordPress plugins or theme aren’t causing the 504 error
  3. Disabling your proxy server or VPN
  4. Checking your domain’s propagation status
  5. Disabling your CDN temporarily
  6. Checking in with your domain host to evaluate error logs and identify other potential issues

Do you have any tips or tricks for identifying and correcting a 504 Gateway Timeout error? Let us know in the comments!

Article image thumbnail by M.IWA / shutterstock.com

The post How to Fix the 504 Gateway Timeout Error in WordPress appeared first on Elegant Themes Blog.