Faced the 504 Gateway Timeout error instead of the page you expected? It happened because the server you tried to contact could not fulfill the request. But why? The reason could be a plethora of things, hence why there are so many solutions. Luckily, this error, while terrifying when it does, happens much less often than you’d expect. Even better, it might be temporary and go away on its own. Even if it doesn’t, it will disappear immediately as soon as find out why the server could not send the HTTP status code as normal. With that said, here’s how to fix the 504 Gateway Timeout error in WordPress.
Variations of the 504 Gateway Timeout error in WordPress
Based on the browser, your hosting company, the webserver, 504 Gateway Timeout error can also look like this:
- HTTP Error 504 – Gateway Timeout
- Gateway Timeout (504)
- 504 ERROR
- 504 Gateway Timeout
- HTTP 504
- HTTP Error 504 – Gateway Timeout
- This page isn’t working – Domain took too long to respond
- 504 Gateway Time-out – The server didn’t respond in time
- WordPress white screen of death
1. Reload the page
Reloading the page can solve the problem if it was a webserver glitch or a temporary downtime. To do so, press F5 on your keyboard or click the rotating arrow in the top left corner. If it works, it would be wise to check again in a few minutes to make sure the error doesn’t re-emerge.
2. Reset your network devices
Next up, use a resource such as DownForEveryoneorJustMe.com to check its status. Afterward, you can reset your modem or router, then try again. You can also unplug the router or modem from power for a few minutes before turning it back on.
3. Clear cache or try a different browser
To clear browser cache, check method 1 in our WordPress keeps logging out problem fix guide. You can also try visiting the same page from a different browser or consider manually clearing the cache in WordPress. Don’t worry if you’re using a different plugin – they all store cache in the same folder. For practical application, look at our clear WP Rocket cache guide.
4. Turn a VPN or proxy on or off
If you’re actively using a proxy or a VPN, turn it off and see if you can solve the 504 Gateway Timeout error in WordPress. Alternatively, connect to the page via proxy or enable a VPN and try again. Make sure that the country you chose isn’t blocked by WordPress.
Should I turn off proxies completely?
It’s worth a shot. Do this to disable automatic proxy setup from Google Chrome:
- Click on the three-dot menu in the top right corner.
- Select Settings, then click on Advanced to expand the list.
- Under System, click on the Open your computer’s proxy settings.
- This will open a window based on your operating system:
1. Windows
In the Proxy window, find Automatic proxy setup, then toggle Automatically detect settings to off. Scroll down and under Manual proxy setup, toggle Use a proxy server to off.
2. Mac
In the Network Settings window, find the Proxies tab. Remove a checkmark from all boxes in the Select a protocol to configure: list. Click on OK.
5. Disable Firewall or CDN services
Using any security plugins for WordPress? Disable them temporarily and see what happens. Additionally, CDN (Content Delivery Network) service you’re using (Cloudflare, KeyCDN, etc.) can cause the 504 Gateway Timeout error in WordPress. Try disabling the service from the account panel on the CDN provider’s website. Additionally, consider contacting their Customer Support for help.
6. Flush DNS settings or change DNS server
This is a common problem, especially with 5XX error codes in WordPress, which is why this is a method 4 to solve the 502 Bad Gateway error in WordPress. For Mac, you can also try entering this into the Terminal:
sudo killall -HUP mDNSResponder
Should I change the DNS server?
It doesn’t hurt to try, it could end up solving the 504 Gateway Timeout error in WordPress. By default, you’re using the DNS your ISP (Internet Service Provider) supplied. There are many to choose from, but we’d suggest Quad9 DNS, Cisco OpenDNS, Google Public DNS, or Cloudflare 1.1.1.1. They also have step-by-step guides on their websites suitable for first-time users.
7. Check WP Debug logs
Fixing the 504 Gateway Timeout error in WordPress might be easy if you know PHP or at least some patience and software such as Notepad++. Since this can also fix the “This site is experiencing technical difficulties“ error, check the headline titled How to use WordPress Debug Mode.
8. Increase execution time
This could work. After all, the solution to the 504 Gateway Timeout error in WordPress is making sure that the communication between two servers is finished within a given time frame. We’ve already talked about a similar error code: the Fatal error: Maximum execution time exceeded. Consequently, the steps are identical to the ones described in method 2.
9. Disable all WordPress plugins and active theme
In the error code solution mentioned above, we’ve mentioned deactivating the latest WordPress plugin you installed. Or, disabling all plugins and the active theme in WordPress. To do so, follow the instructions in method 1. To disable all plugins at once, rename the plugins folder inside wp-content. Was the theme a culprit? Consider hiring someone to fix it, or deleting the WordPress theme and replacing it.
10. Contact your hosting Customer Support
Reaching out to your hosting is important. They can reset the server cache, analyze your website, and give suggestions. Moreover, you might have exceeded your server resources, which you can’t fix without a payment plan upgrade or hosting change.