How to Fix the 504 Gateway Timeout Error? – WordPress

  • Try Reloading the Webpage

If you see a 504 Gateway Timeout error, wait a bit and then try refreshing the page. To refresh the page, you can press F5 on your keyboard, or press CTRL+F5 to refresh without using saved data.

  • Reboot Your Network Devices

At times, issues with your modem or router might cause a 504 Gateway Timeout error. Restarting these devices might solve the problem for you.

  • Check Your Proxy Settings


A proxy server stands between your device and the internet, often used to protect privacy by hiding personal details from websites. Although it’s uncommon, wrong proxy settings can lead to a 504 error. To check, you can turn off the proxy and refresh the page to see if the error gets fixed.

Changing the ‘Proxy’ settings in Windows 10
  • Check for DNS Issues

A 504 Gateway Timeout error might happen due to problems with DNS on the server or your device (or both).

If the server has a DNS problem, it could be because the full website address (FQDN) doesn’t find the right IP or the DNS server doesn’t respond. This often occurs when you move your website to a new server or hosting. So, it’s best to wait about 24 hours for the website’s DNS information to spread everywhere.

To check if your DNS is working globally, you can use free tools like whatsmydns.net DNS Checker or DNSMap.

Checking DNS propagation for your domain on whatsmydns.net
  • Disable Your Site’s CDN Temporarily

Occasionally, the problem might be with your content delivery network (CDN). When the main website server can’t be reached, many CDNs attempt to show the complete webpage from their stored data.

However, this isn’t usually turned on automatically because it’s hard to save changing parts of websites, like the WordPress admin dashboard, on most sites.

  • Check Server Issues With Your Host


One of the main reasons for a 504 Gateway Timeout error is server problems. Many WordPress websites use Nginx or Apache servers, and these servers might wait for a response that takes too long and causes the error. Websites with lots of visitors or online stores often face this issue because their servers get overwhelmed. But even simple blogs can have this problem. Some hosting services might suggest upgrading to a pricier plan, but usually, that’s not needed.

  • Check for Spam, Bots, or DDoS Attacks

Bad actors can slow down your web server by sending too many demanding requests. If your website is bombarded by bots or targeted by a DDoS attack, your server can become overwhelmed. This can lead to 504 Gateway Timeout errors for real users. To figure out what’s happening, start by checking the main IPs making requests. This will show who’s sending the most requests and from where. If your server suddenly uses a lot of data or gets a ton of visits, this report can help. Then, you can look at the Cache Analysis report. It tells you how many requests aren’t using the cache or are in the cache. For better performance, you’d want to store as many requests as you can, but that’s not always possible.

  • Repair Your Corrupted WordPress Database

At times, a 504 Gateway Timeout error might happen because of a broken database, especially on WordPress websites. Usually, this is caused by damaged database parts. Occasionally, it can also result from a major security problem like your website or database getting hacked.

Fixing a broken WordPress database depends on what’s wrong. Tools like WP-DBManager can help find and repair database problems. You might want to check out Kinsta’s guide on fixing WordPress database issues for more information.

  • Check Your Site’s Plugins and Themes

Usually, third-party plugins and themes don’t lead to 504 errors. However, there’s a small chance they could cause delays on the server, often by creating many uncached requests from the plugin or theme. This can use up a lot of the server’s resources and lead to 504 errors.

For example, WooCommerce, a plugin that adds online store features to WordPress sites, can cause this kind of issue.

The easiest way to solve this is by turning off all your plugins. Don’t worry, you won’t lose any data by deactivating a plugin.

If you can reach your admin dashboard, you can go to the Plugins section, choose Deactivate from the actions menu, select all plugins, and then click Apply. This will deactivate all your plugins.

  • Check Error Logs

Looking at error logs is really useful for fixing 504 errors on your website. It can quickly help you find the problem, especially if it’s caused by a resource-hungry plugin.

  • Configure Apache or Nginx Settings Properly

You can edit your server config files to increase resource limits for specific directives. This can help you resolve the 504 Gateway Timeout error.

Leave a comment

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