When server is unable to connect to upstream server to complete a request it will through 504 gateway timeout error.
Different types of errors message display on our server. It’s depending on WordPress hosting company, the proxy server or the browser which you are using.
Types of errors:
504 Gateway Timeout
HTTP 504
504 ERROR
Gateway Timeout (504)
HTTP Error 504 – Gateway Timeout
Gateway Timeout Error
Steps for avoiding 504 gateway timeout
Wait and Reload
Many times, 504 gateway timeout error display due to temporary glitch on your wordpress hosting servers. Need to wait few menutes and try again reloading your webpage.
If your issue is resolved, then no need to take any further action.
Turn off VPN
If you are using a VPN (Virtual Private Network) service to browse the web page, then try to disable it. Many times your VPN server is not able to get a response from your WordPress hosting server, and after it will display 504 gateway time out errors.
If your website is working after some time then, it means there is some issue on your VPN server. If this issue is frequently happening, then you need to contact your hosting provider for support.
Turn off Website Firewall
If you are using a DNS level website firewall like Sucuri or Cloudflare, then try to temporarily disable the firewall. This will allow you to connect to your WordPress hosting server directly.
If your issue is fixed, then it means there is issue on your fire wall. Your hosting server is blocking the firewall IP address which can cause the issue. You have to contact your firewall service provider to get their list of IP addresses and contact to web host for whitelist all the IPs.
Disable Your Network Proxy
If your pc is connected to the internet through a proxy server, then server may be unable to get a response from your WordPress website. You can try accessing your website using a different internet connection. If your website is working properly from different connection, then you need to change your network or contact your network administrator for troubleshoot the issue.
Change Your DNS Servers
internet connection uses called a DNS server, this server help your computer connect to the different server on the internet. If a DNS server is down or unable to connect your website, then you will see 504 gateway timeout error. The final steps are check this is by changing the DNS server which you are using.
Please review below screenshot for changing your DNS server settings.
Clean up your WordPress Database
Sometimes, corrupted database may through 504 gateway timeout error. In that case, your database data will be safe but need to repair (Optimize) your database.
For optimizing your database follow below steps:
- Connect to your hosting provider
- Click on PHPMYADMIN option
- Select your database which you want to optimize
- Select all the tables and select “Optimize table” from the dropdown.
Once click on that option, your WordPress tables are repaired. It will perform WordPress queries run faster and reduce the size of database.
Tips:
Before taking any action, you should have to take a database backup in local computer and then after optimize your database.
Deactivate WordPress Plugins and Switch to Default Theme
If all above steps are not resolving your issue, then you should have to deactivate all WordPress plugins from admin and also set default WordPress theme instead of your custom theme.
If you have already customization in default theme then you has to upload default theme from fresh WordPress.