7 Quick Ways to Fix a 504 Gateway Timeout Error in WordPress

504 Gateway Timeout error

Are you getting a 504 gateway timeout error on your WordPress site? 

This error is an HTTP status code that are usually caused when a server is unable to connect to an upstream server to complete a request. 

In simple terms, when someone visits a website, a request is sent to web servers that contain the requested elements. Then the server sends back an HTTP status code with the requested resource. This code is displayed when a server does not get a timely response from another server that acts as a gateway or proxy.

You are likely to encounter this WordPress errors more than other errors. In most cases, it will go away once you refresh your website. Also, you can also clear your website’s cache.

Some of the common messages you will get for 504 gateway timeout error are:  

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

HTTP 504 is one of the server-side errors and they occur when there is something wrong between the servers on the internet. But here are a few things you can try to troubleshoot 504 Gateway Timeout error: 

  1. Disable Proxy Settings
  2. Deactivate WordPress plugins
  3. Turn off VPN
  4. Clean Database
  5. Disable Content Delivery Network (CDN)
  6. Check Logs
  7. DNS Propagation
  8. Server Issue

1. Disable Proxy Settings

A proxy server acts as a mediator for requests from clients seeking resources from other servers. There is a chance your browser is usng a proxy which is failing to connect to your server. 

If you are using Chrome as your browser, simply navigate to Settings. Scroll to the very last and click on Advanced. 

Locate the System tab and click on”Open proxy settings option, then click on it:

504 Gateway Timeout error

Locate the System tab and click on “Proxy settings”. In the next window click on LAN settings. 

Now all you have to do is disable the following options: 

  • Automatically detect settings
  • Use a proxy server for your LAN

Save the changes and refresh the tab. 

2. Deactivate WordPress plugins

It is very rare that 504 Gateway Timeout error is caused due to a plugin. But sometimes when there is a slow uncached request from a plugin it can result in delays. 

To be sure that the problem lies with one of the plugins, you will simply have to deactivate your plugins. Remember not to delete but deactivate them, this will ensure you don’t lose any data. 

To deactivate the plugins go to Plugins in your WordPress dashboard and click on “Deactivate”, next to the plugins name.

504 Gateway Timeout error

Disable the plugins one by one and reload the website after every deactivation. If the error is fixed after deactivating a specific plugin, that will be the cause of your problem. 

Reach out to the developer or support team of that plugin.

3. Turn Off VPN

Sometimes VPN servers are unable to get a response from your WordPress hosting provider, which results in 504 Gateway Timeout error. 

Try to disable VPN service on your browser and see if the error persists. If VPN is the culprit you can try to either switch to a different VPN server or contact the VPN service provider. 

4. Clean Database

In some cases, a corrupt WordPress database can also lead to 504 Gateway Timeout error. You can clean your database using the WP-Optimize plugin. 

This will not affect your WordPress data saved in the database. But to be on a safer side, take backup of the database before performing any action.

5. Disable Content Delivery Network (CDN)

CDN helps load a site faster by storing static content on data centers around the world. Sometimes, there can be some issues with the CDN, which will result in a Gateway Timeout error. 

If you are using a third-party CDN provider an easy way to troubleshoot 504 Error is to simply disable your CDN temporarily. You can consult the official documentation for specific instructions as every CDN works differently.

For example in Cloudflare CDN, just go to the Overview tab and locate Advanced Actions. Here you can Pause your website to disable the CDN.

504 Gateway Timeout error

Then check for 504 Gateway Timeout error in a new tab. If you are still seeing the error, re-activate your CDN again.

6. Check Logs

Many hosting providers offer an Error log to their customers. These will help you to figure out the issues, especially if it’s resulting from a plugin on your site.

To view your error logs on the Breeze dashboard, simply go to “Manage” next to your website name. Select logs from the above toolbar. This is how your error logs will look:

504 Gateway Timeout error

If in case your host doesn’t offer a logging tool, just add the following code to your wp-config.php file to enable logging:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

7. DNS Propagation

DNS Propagation is the time taken by Internet service providers across the world to update their caches with your new DNS information. If you have recently migrated to a new host, you will have to wait for almost 24 hours for your DNS to fully propagate. 

This time can result in hours of downtime. You can check for this issue from a site called DNSMap. Similarly, enter your domain name and click on “Check DNS Propagation”.

504 Gateway Timeout error

If you see many red results, you will have to wait for your domain to finish propagating.

Although you can migrate from one host to another with zero downtime with our Managed WordPress hosting. 

8. Server Issues

Server issues can be caused when Nginx or Apache is waiting on a response from something and it timed out. Other reasons that can cause server issues are:

  • Slow Server
  • Less no. of PHP worker
  • Firewall issues
  • Network connectivity issues
  • HTTP timeout

All you can do is reach out to your hosting provider for support. If you are a client at Breeze.io simply contact us on support chat and our team will reach out to you in no time.

In future you can also use tools like updown.io, to monitor and notify you immediately when an error like this occurs. 

Wrapping Up

It’s scary when you see an error on your WordPress site. Try not to lose your calm.

Simply follow all the steps we mentioned above and you will be able to fix the 504 Gateway Timeout error. 

If your website is still showing 504 errors reach out to us for better support.

Latest Magento Tips, Guides, & News

Stay updated with new stuff in the Magento ecosystem including exclusive deals, how-to articles, new plugins, and more. 100% Magento Goodness, a promise!

1 thought on “7 Quick Ways to Fix a 504 Gateway Timeout Error in WordPress”

  1. Hi Pooja, looking for the same content on the internet, and your content helped me a lot. No doubt, DNS propagation is a little bit time taking process. I used the tool you mentioned in the article. I Googled for the same tools and came across a useful tool https://dnschecker.org/, and I just wanted to share to help readers get better propagation results.

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.

Scroll to Top

Talk to a sales representative

USA / Worldwide




We can help you. Right now.

Fast growing merchants choose Breeze for high-performance hosting. Experience counts. Let's get started.

Request demo

Please fill in the details below and we’ll reach out to you with a customized demo of our product!


75% OFF on

Receive the coupon as soon as you
submit the email address. 🚀