Thursday, 18 Apr 2024
Webmaster Skills

5 Steps to fix 504 gateway timeout error in WordPress

If you run across the 504 error, your first move should always be to reload your website. The error will often go away in a matter of seconds, so you shouldn’t panic. Just to be safe, though, try force refreshing to clear your website’s cache. Check it out and use the information to help you narrow down the source of the error.

1. Check Your Proxy Settings

To get started, let’s try to ascertain whether the problem lies with you by checking whether you’re using a proxy through your browser, which may be failing to connect to your server. Your proxy settings will vary depending on which browser you’re using. For example, Google Chrome users should navigate to their Settings screen and click on the Advanced tab at the bottom of the emerging page:

Your Chrome advanced settings.

A lot more options will show up, so scroll down until you find the System tab, look for the Open proxy settings option, then click on it:

Opening your proxy settings.

In the new window that pops up, look for the LAN settings button and click on it:

Changing your LAN settings.

Now, disable the options that read Automatically detect settings and Use a proxy server for your LAN if either of them is active:

Disabling your proxy.

Save your changes and try force refreshing your website once more. If you’re a macOS user, you’ll need to follow a different set of instructions, although the results should be the same. Should the error persist, move on to step number two.

2. Ensure Your Domain Can Be Found

When you register and assign a domain to a website, you’re telling the world Hey, this domain leads here!. This information is stored using something called the Domain Name System (DNS). This consists of servers spread across the globe that stores the information, enabling anyone to access it. This means when you try to visit any existing domain, your browser knows exactly where it needs to go.

The problem is, the information within the Domain Name System (DNS) isn’t updated instantly. It takes time for new domain registrations or assignments to ‘propagate’ across the network. In practice, it can take as little as a few hours for your domain to become accessible, although most registrars tell you to wait up to 48 hours just to be on the safe side.

When you transfer a WordPress website from one host to another, your domain might not resolve to the correct address right away. This can lead to a 504 error that should solve itself with a little patience. The easiest way to know if this is the problem is to use a tool such as DNSMap to check the status of your domain’s propagation:

The DNSMap homepage.

Just type your domain, enter its type of record, click on the Check DNS propagation button. Ideally, every result below should be green. If several of them return a red result, you need to wait until your domain finishes propagating.

With that in mind, remember there are ways to migrate a WordPress website without any downtime. Remember this if you ever want to move your site to a better web host! Speaking of which…

3. Check Whether There Are Issues With Your Hosting Provider

Having ruled out problems with your local setup and domain, the next logical step is to check if the issue lies with your hosting provider. For example, the problem might be that your server is unresponsive due to a Distributed Denial of Service (DDoS) attack, a spike in traffic, or just unscheduled downtime.

If this is the case, you’ll need to contact your web host to see if they can fix the issue on their end. Reputable hosting providers will probably detect the problem on their own and reach out to you, but it doesn’t hurt to open a ticket just to be sure.

Keep in mind – if the 504 error is caused by a spike in traffic, it might be time for you to consider upgrading to a better plan. If you’re a 000Webhost user, we recommend checking out what Hostinger has to offer:

Some of Hostinger's shared hosting plans.

4. Disable Your Content Delivery Network (CDN)

CDNs enable users to load your site faster by storing copies of it in datacenters around the world. This also has the added benefit of reducing the load your server has to shoulder. However, in some cases, your CDN might not be able to load your site as it should, leading to a 504 error, such as this one:

A Cloudflare 504 error.

The easiest way to determine if your CDN is causing your 504 Gateway Timeout Error is to temporarily disable it. Every CDN works differently, so you’ll need to check out your service’s documentation for specific instructions. If you’re using Cloudflare, for example, just go to your Overview tab and look at the Advanced settings section within:

Temporarily disabling your CDN.

There should be a big Pause button right at the top, and clicking it will disable your CDN. You can then re-activate it by returning to that same section at any time you want. Just remember to check if the 504 Gateway Timeout error is gone beforehand.

If disabling your CDN fixed the issue, we recommend keeping it turned off for a few hours. It’s usually a temporary problem, so the error shouldn’t persist once you re-activate it.

5. Disable Your WordPress Plugins

For the uninitiated, WordPress is built using PHP, which means plugins interact with the platform using the same language. The way PHP works, it can only handle a finite number of requests at a time. If you have plugins making too many requests, it can result in some of those requests getting ‘dropped’ and causing a 504 Gateway Timeout error in WordPress.

The fix for this problem is simple – you just need to disable each of your plugins until you find the culprit. However, since you can’t access your dashboard through regular means, you’ll need to interact with your plugins via File Transfer Protocol (FTP). To do this, you’ll need your FTP credentials and a client such as FileZilla, which is our top pick due to its open-source nature and active community.

To start, install the client and look for your 000Webhost credentials by logging into the portal’s dashboard, and going to the Settings > General tab. Inside, there’s a section called FTP details that includes the information you need, such as your Host NamePort, and Username:

Your FTP details.

Now, open your FTP client and type this information into the login bar at the top of the screen, then click on the Quickconnect button to the right. Remember – your password should be the same as the one you use for your 000Webhost account. When the client establishes a connection to your server, two folders will appear on the lower-right side of the screen:

The public_html folder.Click on the one reading public_html, which is also known as the WordPress root folder, where all your website’s files reside. Once you’re in, navigate to the wp-content/plugins directory. You’ll find individual folders for each plugin installed on your website, even those that aren’t active:

Your plugin folders.

To disable an active plugin via FTP, simply alter the name of its folder so WordPress doesn’t recognize it. You can do this by right-clicking it and choosing the Rename option:

Renaming your folders.

You can rename your plugin’s folders to anything you want. However, we recommend changing them to something such as disabled.pluginname, for example. That way, you’ll know which folders you’ve modified, and returning them to their original state should be simple. After disabling each plugin, try reloading your website to check if the error persists.

If the 504 Gateway Timeout error disappears, we recommend you try contacting the developer of the plugin first of all for a fix. You may also need to find an alternative it was central to your website’s functionality. Otherwise, try re-enabling it later on to see if the error re-appears.

Read more What Is 504 Gateway Timeout Error

_______________________________________________________________________________

For more details about our seo service packages, pls contact us

BIGBIGSEO Team

Email: bigbigseo@gmail.com
Skype: bigbigseo
https://www.facebook.com/bigbigseo

Thank you!