How to Fix the 504 Gateway Timeout Error in WordPress?

Have you ever received a 504 Gateway timeout error on your WordPress site? This error can make your website not available to users. The worst thing is that if the underlying issue is not fixed then it can disappear and it may appear again. In this article, we will explain you how to fix a 504 gateway timeout error in WordPress.

What are the reasons for the 504 Gateway timeout error in WordPress?

The 504 gateway timeout error usually occurs when a server is unable to connect to the another server to fulfill the request.

For example, if you are using a firewall like the Cloudflare for your website, and it is unable to connect to your WordPress server, you will see a 504 gateway timeout error.

The presence and message of the error page can be displayed separately using your WordPress hosting company, proxy server or browser. Below are some of the most common 504 gateway timeout error messages.

  • 504 Gateway Timeout
  • 504 Gateway Timeout NGINX
  • NGINX 504 Gateway Timeout
  • Gateway Timeout Error
  • Error 504
  • HTTP Error 504
  • HTTP Error 504 – Gateway Timeout
  • HTTP 504
  • 504 Error
  • Gateway Timeout (504)
  • 504 Gateway Time-out – The server didn’t respond in time

While the most common cause of error is that the proxy server is unable to access the upstream server.

Let’s see below example how to troubleshoot the problem easily and fix the 504 gateway timeout error in WordPress.

Wait and Reload web page

Sometimes the 504 gateway timeout error may be due to a temporary disturbance on your WordPress hosting server. Give it one or two minutes and then try to reload your website again.

If the problem disappears, then you do not have to take any other steps. However, if the error showing or appears after a while, continue to read and troubleshoot the problem.

Turn off VPN Service

If you are using VPN service to secure browse the web, try disabling it. Sometimes your VPN server can’t receive a response from your managed WordPress hosting server, and it will showing a 504 gateway timeout error.

If your website is visible, it means that the VPN server was occurring the problem. Now if it is important for you to use VPN, then you can try switching over to a different VPN server. If you are seeing the error again after changing the server, then you would like to contact your VPN service provider for support.

Turn off Website Firewall

If you are using a DNS level website such as Sukuri or Cloudflare firewall, disable the firewall for a time. This will allow you to connect directly to your website server.

If fixes the problem, that means your hosting server is blocking the firewall IP address which can cause this problem. Immediately contact your firewall service provider to get your IP address list, and web host to whitelist those IPs.

Disable Network Proxy

If your computer is connected to the Internet through a proxy server, that server may be incapable to receive a response from your WordPress website.

Connect your website using a different internet connection. If it is down by internet, then you need to change your network settings.

Clean up WordPress Database

A corrupted WordPress database can cause 504 gateway timeout error too. Don’t worry, your WordPress data is safe. However, your database may require some cleaning of spring. You can this by using a plugin like WP-Sweep. but make sure you backup the WordPress database first before performing any action.

Deactivate Plugins and Switch to Default Theme

WordPress plugins and themes are also cause a 504 gateway timeout error. Plugin or theme is making a lot of requests on the server, then some of these requests should be dropped and cause a 504 gateway timeout error.

You can deactivate all WordPress plugins via FTP.

Deactivate Plugins by FTP

After that, to see the error has been solved, open your website.

It means one of plugin in your WordPress website causing the issue. Now you need to activate all plugins one by one unless you reproduce the error. This will help you find the plugin responsible for the error.

If deactivating the plugin does not solve your problem, you would want to see your WordPress theme. You will need to switch WordPress Theme through phpMyAdmin.

After switching your WordPress theme to the default WordPress theme, go to your website to see if it’s working or not.

More Troubleshooting options

Finally, as a last solution, you need to contact your hosting provider for support.

I hope above listed tips helped you learn how to fix 504 gateway timeout error in WordPress. You can also read our article on how to fix WordPress post returning 404 error.

5 thoughts on “How to Fix the 504 Gateway Timeout Error in WordPress?”

  1. Thanks for the wonderful tutorial!! It really worked!!
    Anyway, i am looking for the cheap linux hosting other than redserverhost.com. Can you suggest me the one most cheapest hosting provider?

    Thank you so much.

    Reply
    • I have used 2 hosting company.
      1. Hostgator and
      2. Godaddy
      Hostgator is better but Godaddy is more cheaper than Hostgator.

      Reply

Leave a Comment