The Easy Guide To Fix 504 Gateway Timeout Error In WordPress

Table of Contents

Errors are as undesirable as a speeding ticket. Both can get paid for, but you will regret what they cost you. When it comes to your WordPress website, an error like 504 Gateway timeout may seem to be a nightmare. You are not able to browse your webpage. And it does seem there is nothing you can do. Well, there are a few things you can try out. This accessible guide can help you fix the 504 Gateway Timeout error for your WordPress website.

What is the 504 Gateway Timeout Error?

A 504 Gateway Timeout Error simply means that one server did not receive a timely response from another server. One of these servers acts as a gateway and could not fulfill your request within a given time frame.

The Error can be displayed in different variations like these:

504 Gateway Timeout nginx

504 Gateway Timeout

504 Error

Gateway Timeout Error

HTTP Error 504

504 Gateway Timeout – the server didn’t respond in time

HTTP Error 504 – Gateway Timeout

Gateway Timeout (504)

NGINX 504 Gateway Timeout

Let us now see how we can fix this error.

1. Wait and Refresh

wait-and-refresh-1 Fix 504 Gateway Timeout Error

Sometimes things aren’t as permanent as we think them to be. This also applies to errors. The 504 Gateway Timeout error you are facing might be a temporary one. There might be an increase in your website traffic or the server is utilizing more resources, who can predict?

The simplest solution is to wait for some time and try refreshing the web page. While you wait you can visit https://downforeveryoneorjustme.com and check if the site is down for everyone or it is just you who is facing the problem.

Sometimes it can just be a temporary issue and you will be able to access the web page if it is so. If not, you are up for troubleshooting using the following fixes in this tutorial.

2. Check if the issue is Browser Related

switch web-browser Fix 504 Gateway Timeout Error

Sometimes, the browser can give an error. The only way to be sure is to switch the browser and see if you are still getting the error. If you don’t get the error while using other browsers then you can be sure that the issue is with the particular browser.

Try clearing browser cache. Follow this quick tutorial about how to clear browser cache.

You can try using incognito mode.

Also, try deleting cookies for the website you are visiting.

Here is how you can delete site cookies in Google Chrome.

Go to Settings>> Advanced>> Privacy and Security

Select the “Site Settings” option.

Site-settings Fix 504 Gateway Timeout Error

In the Site Settings screen, click on “Cookies

Coockies-data Fix 504 Gateway Timeout Error

The Cookies screen will appear. Select “See all cookies and site data”

see-all-cookies Fix 504 Gateway Timeout Error

Once you click the option, a list of sites will appear. Select your site and delete cookies.

select-site-and-delete-cookies Fix 504 Gateway Timeout Error

3. Restart Network Devices

Sometimes a hardware issue can cause the error. There can be a problem with your modem, router, switches and other networking devices.

Restart all network devices and see if the error is resolved.

4. Disable VPN

vpn Fix 504 Gateway Timeout Error

Sometimes VPN servers are not able to get a response from the server that is hosting your site. If you are using a VPN, try disabling it.

If you are able to access your website after turning off the VPN, you can be sure that VPN was the source of the problem. You can try switching to another VPN or stop using it altogether.

5. Check Proxy Settings

When there are errors in the proxy settings, you may face problem connecting with the server. Check your proxy settings if they are correct.

You can also disable proxy.

Here is how you can do it in Google Chrome.

Go to Settings>>Advanced>>> System

Click “open proxy setting”. A dialog box will appear.

Go to “Connections” and click on “LAN settings”

You will see a checkbox for “Proxy server”. Uncheck it and hit OK.

proxy setting Fix 504 Gateway Timeout Error

6. Flush DNS Cache

A) On Windows

To flush the DNS cache, run Command Prompt as an administrator in Windows. You need to enter the following commands:

ipconfig/release

ipconfig/all

ipconfig /flushdns

ipconfig/renew

netsh int ip set dns

netsh winsock reset

These commands should be entered one at a time and press enter after each command. This process renews the IP address. This may resolve the 504 Gateway Timeout error.

B) On Mac

  1. Launch the Terminal App. You can find it in Applications>>Utilities>> Terminal
  2. Copy the following command in Terminal and hit enter
 sudo killall -HUP mDNSResponder; sleep 2; 
terminal Fix 504 Gateway Timeout Error

Once you enter your password, your DNS cache will be cleared.

7. Use Google’s DNS

Sometimes the DNS you are using may throw 504 error. You can try switching to Google’s DNS.  The following steps explain how you can do this on Windows and Mac.

A) On Windows

You can use Google’s DNS if your DNS settings are causing the problem. Here is how you can do that.

  1. Type R key while holding Win Key. (Win+R combination) This will open the Run Program.
  2. Type “Control Panel” and hit “OK” to open Control Panel
run-control-panel Fix 504 Gateway Timeout Error

3. In the Control Panel, choose View>>Small Icons

Control-Panel Fix 504 Gateway Timeout Error

4. In the next screen, Click “Network and Sharing Center

network-and-sharing-center Fix 504 Gateway Timeout Error

5. Click on “Change adapter settings”

change-adapter-setting Fix 504 Gateway Timeout Error

6.  Right click on the network you are using, and click Properties

properties Fix 504 Gateway Timeout Error

7. Click on “Internet Protocol Version 4 (TCP/IPv4)”  and click on Properties.

IPv4 Fix 504 Gateway Timeout Error

8. In the “Use the following DNS addresses” section, Enter:

Preferred DNS Server: 8.8.8.8

Alternate DNS Server: 8.8.4.4

Google-DNS Fix 504 Gateway Timeout Error

Click OK and now you are using Google’s DNS. This will solve the problem in most cases. If it does, enjoy browsing. If it doesn’t, go to the next step in this tutorial.

B) On Mac

  1. In System Preferences, Choose “Network”
System-preferences Fix 504 Gateway Timeout Error

2. Select the network for which you want to change DNS. Click on “Advanced”

wifi-mac Fix 504 Gateway Timeout Error

3. To add DNS server click on the + button.

4. Add 8.8.8.8 and 8.8.4.4 as Google’s DNS server

dns-mac Fix 504 Gateway Timeout Error

8. Deactivate Plugins

If a plugin is making too many requests to the server, it may trigger a 504 Gateway Timeout error. In such a scenario, you can try deactivating all plugins and see if the error goes away.

In case you can access the admin area of your WordPress site, you can manually deactivate each plugin.

If you are not able to access the WordPress admin area, then you can connect to your site using an FTP client.

Once you are connected, go to the wp-content folder. In that folder, there is a folder named “Plugins”. To deactivate the plugins on your site, simply rename the folder to something else. For example, you can rename the folder as “Plugins_old”.

plugin rename Fix 504 Gateway Timeout Error

Once your plugins are deactivated, you can see if the site is working without any error. If the error is resolved then you can be sure that one of the plugins was the cause of the error. You can narrow down the culprit by activating each plugin one-by-one and checking the error at the same time.

If your web host supports WP CLI then you can deactivate all the plugins without having to access the plugins folder. Nestify’s Managed WordPress Hosting supports WP-CLI.

9. Tweak VPS Settings

If you are using VPS, you can tweak server settings to increase specific resource limits. This can resolve the 504 Gateway Timeout Error.

Here you can do it on Apache and Nginx Servers.

Apache

In the httpd.conf file, add the following line

Timeout 600

In the php.ini file, add the following line

max_execution_time 300

Nginx

In /etc/nginx/conf.d/timeout.conf file changes the values to the following:

proxy_connect_timeout 600;

proxy_send_timeout 600;

proxy_read_timeout 600;

send_timeout 600;

Edit the php.ini file and add to it the following line:

max_execution_time 300

10. Server Issue

Web servers can face timeouts due to server load. There can be other issues with the server. For Example,

  • Limited PHP Workers: PHP workers execute the code on your WordPress website. When the load increases, it may require more PHP workers than assigned.
  • Firewall issues: The firewall on the server may have been misconfigured or have some errors with the rules that can prevent the connection from establishing properly
  • Network Connectivity: Problems in network connectivity can cause a delay in responding to HTTP requests. This can lead to 504 Gateway Timeout errors.
  • Slow Server: The server itself can be slow. Thus, it may not be able to respond within a specific time frame.

There is little you can do with server issues. Contact your web host to resolve the problem. Depending on the response, you might consider changing your host for a better one.

11. Cloudflare Errors

If you are using a CDN solution like Cloudflare, you may get 504 Gateway Timeout error in certain scenarios.

With Cloudflare, you may expect two kinds of error pages.

An error page like the following means that the issue is with Cloudflare side. In this case, you should contact Cloudflare support.

504-gateway-timout cloudflare Fix 504 Gateway Timeout Error

On the other hand, an error page like the following means the issue is with your hosting provider. In this case, you should contact your web host.

cloud-flare Fix 504 Gateway Timeout Error

12. Reach Out To Your Web Host

If none of the above steps work out for you then this is the time to reach out to your host. You are paying for hosting and you deserve your problems to be solved by your web host.

So these were the common ways to deal with the 504 Gateway Timeout error. We hope some of these fixes do work for you. Have you found another fix? Do let us know in the comments. We love the discussion.

Fully Managed WordPress Hosting

Nestify’s AWS powered dedicated CPU servers keep your sites fast, secure, and always up to date.

Want faster WordPress?

WordPress Speed Optimization

Try our AWS powered WordPress hosting for free and see the difference for yourself.

No Credit Card Required.

Whitelabel Web Hosting Portal Demo

Launching WordPress on AWS takes just one minute with Nestify.

Launching WooCommerce on AWS takes just one minute with Nestify.