Are you seeing 504 gateway timeout error in your WordPress blog? When one server could not connect to another server you will see 504 gateway timeout error. In this tutorial you will learn how to fix the 504 Gateway timeout error in WordPress website.
Cause of 504 Gateway Timeout Error
This error occurs when one server such as Cloudflare could not connect to your main server. If your website is using Content Delivery Network (CDN) and unable to connect to your main web hosting server then you will see 504 gateway timeout error.
Depending on your WordPress hosting provider you may see one of the error messages when your website could not connect to the main server.
Error Message differential depending on the hosting provider
- 504 Gateway Timeout
- HTTP 504
- 504 ERROR
- Gateway Timeout (504)
- HTTP Error 504 – Gateway Timeout
- Gateway Timeout Error
How to fix 504 gateway timeout error in WordPress
- Refresh or Reload your Website
- Disable the Proxy Network
- Disable the Content Delivery Network (CDN)
- Deactivate all the Plugins
- Change your Current Themes to Default
- Clean WordPress Database
- Get Help from the Hosting Provider
Step-1: Refresh or Reload your Website
One of the first thing you should do is to wait for few minutes and reload your website or Press CTRL+F5 key to refresh. Sometime your web server may go down because of high traffic, after few minutes it will fix the error automatically. If you see the error even after refreshing your website then follow the below steps.
Step-2: Disable the Proxy Network
Other possibilities of this error can be the proxy server enabled in your web browser. When proxy server may not be able to get respond from your website then you will encounter 504 gateway timeout error. You can disable the proxy server in chrome clicking on the three dots at the top right then settings.
You will see the Google chrome setting page where you have to click on Advanced to expand then system and click on open proxy settings.
You will see the dialog box where you will find Lan Settings. Click on Lan settings then uncheck the proxy server box and click on ok button.
This will disable the proxy server. You can check the error still exists or disappear reloading your website, if the error still exists then follow the next step.
Step-3: Disable the Content Delivery Network (CDN)
If you are using Content Delivery Network (CDN) such as Cloudflare then you need to disable it temporary which will allow your website to connect directly to the main hosting server.
If you are using Cloudflare then log in to your Cloudflare dashboard then select your website. From the bottom left click on Pause Cloudflare on Site then click on confirm. This will disable the CDN and your website will run from the origin server.
If this fixes the 504 gateway timeout error then your Content Delivery Network (CDN) is not configured properly. You need to reconfigure your website in Cloudflare or if you are using other Content Delivery Network (CDN) such as Sucuri then you need to contact the service provider for help to configure your website properly.
Step-4: Deactivate all the Plugins
This error can also occur when faulty plugins installed in your blog makes too many requests to the web server. You can deactivate all the installed plugins in your WordPress site to find the faulty plugins and remove or replace it from your blog.
Once deactivated, reload your site, if you did not see 503 service unavailable error then one of the plugins is causing the error. You can find out the broken plugins activating the plugins one by one until your site breaks. You can check this guide on disabling all the WordPress plugins in your blog.
Step-5: Change your Current Themes to Default
If deactivating the plugins did not fix the issue you can try activating your current themes to WordPress default themes such as twenty fifty or twenty seventeen. You need to use FTP client such as FileZilla to access your web server then in wp-content folder you will find themes folder where all the installed themes are located.
Once you find out your current themes you need to delete it from your blog. Before deleting take a backup of your current themes Right clicking on default theme then click on download. After downloaded you can delete it from your WordPress blog.
Once you delete the current themes, WordPress will automatically activate the default theme if it is already installed. If default themes is not installed then you need to install default theme in your WordPress blog.
Step-6: Clean WordPress Database
This error can also occur because of the corrupted database. If your database has some issue that is triggering the error then you can clean your WordPress Database using WP Optimize plugin. Before you start cleaning the database make sure to take backup of your site. You can refer to this guide on how to backup WordPress site.
Step-7: Get Help from the Hosting Provider
If above troubleshooting methods did not fix the 504 gateway error then you should contact your hosting provider to fix from their end. If your website is hosted with best WordPress hosting providers then you will get immediate help to fix the error.