We are a team of results-driven creative geniuses at PMGS Digital Agency that are enthusiastic about expanding your business and have the skills to do it.


How to fix 504 Gateway Timeout error in WordPress

How to fix 504 Gateway Timeout error in WordPress

On your WordPress website, have you ever encountered a 504 gateway timeout error? Your website may become unavailable to users due to this issue. The worst part is that if the underlying problem is not resolved, it could go away and come back on its own. We will demonstrate how to resolve the 504 gateway timeout problem in WordPress in this article.

Why Do 504 Gateway Timeout Errors Occur?

The 504 gateway timeout error typically results from a server’s inability to establish a connection with an upstream server in order to finish a request.

A 504 gateway timeout error will appear, for instance, if a website firewall like Sucuri is unable to connect to your WordPress server.

Depending on the proxy server you are using, the browser you are using, or your WordPress hosting provider, the error page’s look and message may be presented differently. Some of the most typical 504 gateway timeout error messages are shown below.

  • 504 Gateway Timeout
  • HTTP 504
  • 504 ERROR
  • Gateway Timeout (504)
  • HTTP Error 504 – Gateway Timeout
  • Gateway Timeout Error

gateway time out 504

Although a proxy server’s inability to connect to the upstream server is the most frequent cause of the error, it can also be brought on by problems with the hosting settings.

So let’s examine how to quickly diagnose and resolve the 504 gateway timeout problem in WordPress.

  1. Wait and Reload

Sometimes, a momentary bug on your WordPress hosting servers may be the only thing to blame for the 504 gateway timeout issue. After some time has passed, try refreshing your webpage.

There is no need for additional action if the problem goes away. Nevertheless, if the error continues or returns after some time, keep reading to diagnose and fix the issue.

  1. Turn off VPN

turn off vpn

Try turning off your VPN if you use one to surf the internet. Your managed WordPress hosting server may occasionally be unable to respond to your VPN server, which will cause a 504 gateway timeout problem.

If your website afterwards shows, the VPN server was to blame. Now, you can attempt transferring to a new VPN server if utilising the VPN is crucial for you. If the issue persists despite switching servers, you should seek assistance from your VPN service provider.

  1. Switch the Website Firewall off

Try temporarily turning off any DNS-level website firewalls you may be utilising, such as Sucuri or Cloudflare. You will be able to directly connect to your WordPress hosting server using this method.

sucuri 504

If doing so resolves the problem, your hosting server is probably blocking the firewall IP addresses that might be the root of the problem. You will need to receive your firewall service provider’s list of IP addresses, then get in touch with your web host to add those IPs to the whitelist.

You may occasionally see the real server error notification after turning off the firewall. In that situation, you should use our list of typical WordPress problems to resolve the particular problem.

  1. Switch DNS Servers

You utilise something called DNS servers with your internet connection. Your computer can connect to these servers to access the various internet servers.

A 504 gateway timeout error could appear if your DNS servers are offline or unable to reach your website. The simplest approach to do this is to have your device use a different set of DNS servers.

You may discover them on Windows systems on the Control Panel » Network and Sharing Center screen.


On Mac computers, you can find them under Settings » Network. Click on the Advanced button, and then select the DNS tab.

dns settings mac

You may apply modifications and modify your DNS server IP to and

Try going to your website right now. You’re done if this corrects your mistake. Your internet connection was the issue, and it has been resolved.

  1. Clean up the WordPress database.

A 504 gateway timeout issue may also be brought on by a damaged WordPress database. Your WordPress data is probably safe, so don’t worry. Your database, however, would benefit from some spring cleaning.

This may be accomplished quickly by utilising phpMyAdmin to optimise your WordPress database or a plugin like WP-Sweep. Before doing anything, make sure you backup the WordPress database.

  1. Switch to WordPress’ default theme after deactivating all plugins.

Less frequently, WordPress plugins and themes result in 504 gateway timeout errors. However, if a plugin or theme sends the server too many requests, it’s possible that some of them will fail and result in a 504 gateway timeout error.

You must use FTP to disable every WordPress plugin in order to try this.


Visit your website later to see whether the issue has been fixed.

If so, one of your plugins was the root of the problem. Now, you must turn on each plugin one at a time until you can duplicate the issue. This will assist you in identifying the plugin that caused the problem.

You should review your WordPress theme if disabling plugins didn’t resolve the problem. You must use phpMyAdmin to change the WordPress theme.

Visit your website to check on its functionality after changing your theme to the default WordPress theme.

Finally, as a last resort, you need to reach out to your hosting provider for support. They may be able to fix the issue or point you in the right direction.

If you think this article was useful to you, then stay tuned with us and subscribe to receive our blogs. If you wish to stay connected with us on social media, you can find us on Facebook, Instagram and LinkedIn