How to Fix 504 Gateway Timeout Error in WordPress

Fix 504 Gateway Timeout Error

Has your WordPress site encountered the 504 Gateway Timeout error? This error may prevent users from accessing your website. The worst part is that if this problem is not completely solved, it may appear repeatedly. This article will show how to fix the 504 Gateway Timeout Error in WordPress.

What causes 504 Gateway Timeout Error?

When the server cannot connect to the upstream server to complete a certain request, it usually results in a 504 Gateway Timeout Error.

For example, if a website uses a firewall like Sucuri and it cannot connect to the WordPress server, a Gateway Timeout Error will show up.

Depending on the WordPress hosting company, proxy server, or browser used, the error page message may vary. The following are some of the most common 504 Error messages.

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

Although the most common cause of errors is that the proxy server cannot access the upstream server, it may also be triggered by other host configuration issues. That being said, let ’s see how to easily resolve and fix 504 Gateway Timeout Error in WordPress.

1. Wait and reload

Sometimes the 504 Gateway Timeout Error may be caused by a temporary failure on the WordPress hosting server. Give it a few minutes and then try to refresh the website. If the problem disappears, no further action is required. However, if the error persists or reappears after a period of time, please continue to read.

2. Turn off VPN

If a VPN is used to browse the website, try to disable it. Sometimes VPN server may not be able to get a response from the WordPress server, which will cause 504 Gateway Timeout Error. If the website loads properly, the VPN server is the culprit. If a VPN must be used, try switching to another VPN server. If 504 Timeout Error is still encountered after changing the server, then try to contact the VPN service provider for support.

3. Turn off the website firewall

If making use of DNS-level website firewalls like Sucuri or Cloudflare, try temporarily disabling the firewall. This allows the browser to connect directly to the WordPress server. If this solves the problem, then the hosting server has blocked the firewall’s IP address. Contact the firewall service provider to obtain a list of their IP addresses, and then contact the web hosting service provider to whitelist these IPs.

4. Disable network proxy

If connected to the Internet through a proxy server, the server may not be able to get a response from the WordPress website. Try to use another Internet connection to visit the website or use an online service to check the status of the website. If the error occurs only when you visit, then change your network settings. Or contact the Internet service provider or network administrator to solve this problem.

5. Change the DNS server

Internet connection uses something called “DNS server”. These servers allow a remote computer to connect to other different servers on the Internet. If the DNS server a remote computer is using is down or unable to connect to the website, then a 504 Gateway Timeout Error will be displayed. The easiest way to check this issue is to change the DNS server used by the device.

On a Windows computer, this option is under Control Panel »Network and Sharing Center.

504 Gateway Timeout error resolve with DNS server

On Mac computers, this option is under Settings »Network. Click the “Advanced” button and select the “DNS” tab. Change the DNS server addresses to 8.8.8.8 and 8.8.4.4, and then try to access the website. If the problem is solved, it means that the problem lies with the network connection, and it has now been fixed.

6. Clean up the WordPress database

A damaged WordPress database may also cause 504 Gateway Timeout Error. Don’t worry, the  WordPress database is definitely safe, just need to do some clean-up work. This can be easily done by using phpMyAdmin or using plugins such as WP-Sweep to optimize the WordPress database. Make sure to back up the WordPress database before performing any operation.

7. Deactivate the WordPress plugin and switch to the default theme

Although the possibility of 504 Gateway Timeout Error due to WordPress plugins and themes is small, if the plugin or theme makes too many requests to the server, it is likely that some of these requests may be lost and trigger Gateway Timeout Error.

To test this, disable all WordPress plugins via FTP. Then, visit the website to see if the error has been resolved. If it is resolved, the problem is caused by a plug-in. Then activate all the plugins one by one until the error reappears. This can help find the plugin that caused the error. If disabling the plugin does not solve the problem, then you check the WordPress theme. Switch WordPress themes through phpMyAdmin. After switching the theme to the default WordPress theme, visit the website to see if it opens normally.

8. Other methods

If none of the above methods solve the 504 Gateway Timeout error problem, as a last resort, contact the site hosting provider for support. They may be able to solve the problem or point you in the right direction.

You May Also Like

About the Author: BW

Leave a Reply

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