How to Fix the 504 Gateway Timeout Error in WordPress

Categories
Fix the 504 Gateway Timeout Error

Hello buddies! How are you? Hope you all are doing fine amidst this pandemic situation. Today I am going to help you with another common WordPress error. And the title of the article is how to fix the 504 Gateway Timeout Error in WordPress.

I am pretty sure that most of you know about this error by now and some of you might have experienced it. Usually, the error message pops up when your browser is unable to establish a connection to a website. I know, that’s very troublesome. Furthermore, the 504 error can negatively affect your traffic numbers. They will be translated to lost traffic and so the conversations and income.

However, the good news is, you can fix the error very easily. And I am going to give you stepwise instructions on how to. Just stay with me!

What is the 504 Gateway Timeout Error in WordPress?

First of all, I have to advise that don’t misunderstand this 504 error as the 404 error. The 404 error pops up when a page doesn’t exist or is unavailable. In contrast, the 504 error appears when your browser knows there’s such a website but unable to establish a connection.

Still, confused? Let’s start with how the websites work. To access to a website you will need a host it in a server with external access. Once a site’s domain is accessed, browser will establish a connection to the server and waits for a response. If there is no response from the server, the website won’t load and the 504 error message pops up.

Additionally, the error can acquire various forms according to the visitors’ browsers. The below image displays a different example unlike the first image.

Up until now, the process sounds simple, isn’t it? Moreover, the modern internet connection will go through several gateways before it servers a particular website. And a failure to respond in a server will result in the 504 Gateway Timeout Error.

Theoretically, these servers should respond after some time unless they are completely down. But browsers are designed to stop trying to establish a connection after a certain amount of time. Thereby assures that your computer won’t get stuck trying to connect to a server that is unresponsive.

Next, I have listed the potential reasons for response failure in a server.

  • Issues with your proxy settings; your proxy server might be the link that fails to respond in time.
  • Inaccessible domain; your domain should propogate before everyone can access it. And attempting to enter such a domain too soon after registering might cause a 504 gateway timeout error.
  • Issue with your Content Delivery Network (CDN); rarely using a CDN for your website can cause the 504 error.
  • Problems with your hosting provider; this is the most coomon cause most of the time. And you don’t have to do anything.

Even though the 504Gateway Timeout Error will resolve without your intervention that doesn’t mean you don’t have to pay attention towards it. The error won’t last long if your web host is the cause. Most web hosting providers take care of these kinds of issues. But a persisting 504 Gateway Timeout Error, let’s say more than 1 hour needs your attention.

How to fix the 504 Gateway Timeout Error

If the gateway error lasts for more than an hour, I recommend you to contact your hosting provider for help. That should be the first step. If there is nothing wrong with their side, we can assume that the problem is on your side.

And there is another thing you have to remember. That is the 504 Gateway Timeout Error is not exclusive to WordPress sites. And amongst the solution list, there is one solution that is only for WordPress. You can use the other 3 solutions to any platform.

1. Disable your WordPress plugins

Most of the time plugins can slow down the response time of your site causing a 504 error. Unfortunately, most WordPress sites use several plugins at once so finding the culprit plugin is not that easy. And as you don’t have access to the dashboard, disabling the plugins will need some extra effort. In order to follow my instructions, you will need an FTP client like Filezilla and some skills.

  • When you are connected to the website, go to the WordPress root folder.
  • Most of the time this directory will be named public_html.
  • Or else you can use www or the name of your site.
  • Then go to the wp-content/plugins directory. You will see separate folders for each plugin installed on your website within that folder.
  • After that right click on any of the plugin folder, select the Rename option and change the name to something else. You can rename it as in the below example.
  • So you will be able to get an idea about the disabled plugins.
  • Now you just have to disable each plugin as I mentioned earlier and identify the troublemaker.
  • And if a particular plugin is not the culprit, just enable it again before moving to the next one. You can enble a disabled plugin by renaming it into the original name. But don’t activate the culprit plugin yet!
  • Fixing the culprit plugin will be different from each. Some needs just an update. Or else you might need to contact the developer or go for an alternative.

2. Test your Local Proxy Settings

If you are using a connection configured to use a proxy server, this might be another cause for the 504 error. In order to confirm that you can access your browser settings and check whether you have enabled a proxy server for the local network. However, the process is different from the browser and the operating system you have.

  • If you use Google Chrome you can navigate like this. Settings  > Advanced tab > System > Option to open local proxy settings.
  • Then click on the LAN settings buttom in the next window.
  • And find the Proxy server section in the popup window.
  • If the Use a proxy server for your Lan is enabled, just turn it off and save the changes.

After that, you can try accessing your website and look for the error. If the proxy server was the troublemaker, you will be able to use the site again later. And I advise you to not enable it until for a few hours.

3. Check the ‘Propagation’ status of your domain

As far as I remember, there is an article about Domain Name System (DNS) in our website. I’ll give a brief summary for those who didn’t read it.

When you are registering a domain the information has to propagate via a server network that makes the DNS.   On some occasions, this particular process may take even 48 hours. Some people will be able to access to your site while others cannot. Instead, they will see a 504 error.
Usually, a partially propagating domain needs a few more hours. Just sit back and give it’s time. Or else you might need a tool to check the propagation status of your domain. DNSMap is a good choice because it can check multiple types of records for any URL you enter:

class="wp-block-image">

Here’s the propagation status on Elegant Themes’ domain:

Similarly, all the major nameservers around the globe will have a record of the site existing. And most of the time there will be one or two nameservers without a record of your website, but that’s not a thing to worry about. On the other hand, if most of the nameservers give a negative result, your domain is not propagated yet. And it might be the cause for the 504 Gateway Timeout Error.

4. Temporarily Disable the Content Delivery Network  (CDN) of your website

The CDN of your website is another rare but possible cause behind the error. Because CDNs add another gateway between visitors and your website server. Usually, it is a good thing as the CDNs ease the load and handle a significant amount of traffic. But they go crazy once in a while!

So we need to confirm that the CDN is the problem. It is quite easy. The majority of CDN providers will return errors showing the exact reason. And once you are certain that the culprit is the CDN, you can temporarily disable it. The process varies depending on the service.

  1. For Cloudfare, just access the dashboard and go to the Overview tab. Then navigate like this.
  2. Advanced > Pause Website.
  3. So that the Cloudfare servies for your linked website will be disabled temporarily.
  4. I advice you to disable CDN for about a couple hours until the error is gone. Then re enable it by navigating to Overview > Advanced section > Turn On the switch

That’s all! Hope you fixed the issue.



About The Author