504 gateway timeout error

How to Fix a WordPress 504 Gateway Timeout Error

Although we might want everything to just work right on the Internet, it doesn’t always happen. Sometimes you’ll come across something in WordPress like a 504 gateway timeout error. In many cases, this is easy to fix.

However, there are so many things that can cause a 504 error to appear in your browser that it’s difficult to say with certainty what is causing the issue.

In this tutorial, I’ll show you several methods regarding how to fix a 504 gateway timeout error in WordPress.

What is a 504 Gateway Timeout Error?

504 Timeout Error

A 504 error will occur when one server did not get a response from another in a timely manner.

For example, a DNS contacts the web hosting server when delivering pages to a visitor. If there is a hiccup in the response from the hosted server and it takes too long, you might see a 504 error.

Unfortunately, an error 504 gateway timeout in WordPress is caused by a lot of things. Anything from a poorly developed HTACCESS file to incompatible plugins can cause a slow server response.

When the website is unavailable due to this problem, you may lose visitors. You can also experience a drop in search rankings if Google comes across your site as it’s throwing the 504 error.

In other words, it’s incredibly important to always ensure the stability of your site.

In most cases, the fixes for this type of problem are relatively simple. The problem is that it can take quite a long time to finally discover the issue.

A few of the things that can create a 504 gateway timeout error include:

  • DNS Problems
  • Slow Server Issues
  • Blocks from Firewalls
  • Proxy Server Connection Issues
  • Website Development Errors
  • Web Browser Problems
  • Network Connectivity Errors

So what are some things you can do to fix a WordPress 504 gateway timeout error?

1. Wait for Server Response

Sometimes the best thing you can do is nothing at all. In some instances, you may just want to wait until the server responds.

In reality, there is a vast number of devices between you and the web host. A problem at any one of these points can cause a slow response. In this case, you can just come back to the site a bit later.

It can take anywhere from a few moments to a few hours, depending on the underlying problem.

2. Disable Your VPN

Virtual private networks, or VPNs, are increasingly popular nowadays. However, these VPNs may also have problems contacting the web hosting server.

If the WordPress website is giving you a 504 gateway timeout error, try disabling the VPN. If the website starts working, you know the problem lies somewhere in the VPN itself.

You may want to contact your provider for more information.

3. Disable the Website’s Firewall

Firewalls are excellent at keeping out hackers, bots, and malicious coding. Unfortunately, it’s this awesomeness that often poses a problem. If your firewall is too strict or is having a problem, it can create errors in browsing.

This often happens from third-party firewalls outside of the WordPress environment. Try disabling it to see if the problem clears up.

Even the best security plugins for WordPress may have problems reaching your web host.

4. Verify the HTACCESS File

The HTACCESS file of your site manages how people and bots view your content. If there is a problem within the file, it could easily throw various errors including 504.

htaccess file

Take a few moments and examine the HTACCESS file for WordPress. Sometimes a plugin or improper settings can wreak havoc.

If you’re unsure about how it works, you can always create a blank file to use as a test.

5. Clean the Database for WordPress

A cluttered database can cause all kinds of problems for WordPress. The system will even save every revision of every post you create. This amount of digital debris will cause issues in a database.

It’s always a good idea to routinely clean and optimize the database. It may prevent the gateway timeout error from happening while improving the performance of the website.

clean database

6. Disable Plugins in WordPress

Plugins provide a way to expand what the website can do for visitors and admins. However, some can also promote a variety of issues including a timeout from the web server.

Deactivating all the plugins lets you identify whether one of them is giving you a problem or not. If the 504 error goes away, re-enable the plugins one by one until you come across the one causing the issue.

disable plugins

7. Switch to the Default Theme

While themes don’t often cause 504 timeout errors, it is possible. This completely depends on how the theme was developed and any of its integrated features.

Switch to one of the default WordPress themes, like Twenty Sixteen, and test the site.

See if the 504 gateway timeout error occurs on a default theme

The default themes in WordPress are often the safest when it comes to troubleshooting. This is because they are made and maintained by the developers at WordPress.org specifically for the core system.

8. Monitor for Attacks from Bots and Spam

You might also want to consider attacks from bots and spammers. A distributed denial of service attack, or DDoS, can render a server useless or incredibly slow.

Although the web host’s servers usually prevent these kinds of attacks, it’s not uncommon for them to still happen.

Check your firewall’s logs to see if your site is being attacked.

Other Solutions For the 504 Gateway Timeout Error

The 504 gateway timeout error can also be caused by a number of external things not related to your WordPress website. In fact, sometimes it’s caused by your own web browser.

Here are a few things you might want to check on your end if you see this problem persist.

  • Clear the Browser’s Cache
    The web browser’s cache can store problematic web coding. This may cause a variety of errors, and emptying is perhaps one of the easiest ways to fix the issue.
  • Turn off Network Proxy
    If you use a network proxy, you might want to consider disabling it. In some instances, proxies are unable to receive a response from the site’s server and will give you the 504 error.
  • Reboot Your Networking Devices
    It’s always a good idea to power cycle your networking equipment. This includes everything from your computer to your router or network hub. Don’t forget to reboot your Internet device as well.
  • Try a Different DNS
    Sometimes your ISP’s DNS may have a glitch in the system. You can always use the “8.8.8.8” DNS server in your device’s network settings. This is the Google Public DNS, and often solves many connection problems.
  • Contact Web Host or ISP
    Lastly, you can always contact your ISP or web hosting provider to ensure there is nothing wrong on their end. An outage can create a myriad of problems including the dreaded 504 gateway error.

There is a variety of things that will affect Internet connections and website behavior. Just remember to be patient.

It May Take a Bit of Troubleshooting to Fix

In reality, many things can cause the error 504 gateway timeout in WordPress. From the site itself to your own browser, it takes a bit of troubleshooting to really find the heart of the problem.

Start with the easiest fixes first. Sometimes all it takes is patience for the server to respond.

What kind of error codes have you seen on your website? How often do you come across errors created by WordPress plugins and themes?

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.