Jamsheer K
WRITTEN BY
Jamsheer K
Posted on Jun 09, 2023

Did you get a 504 Gateway Timeout Error on your webpage? If yes, do not worry; you can sort it out easily. Websites made on WordPress often get this error. A WordPress 504 Gateway Timeout error is a common HTTP status code that indicates the server acting as a gateway or proxy did not receive a timely response from the upstream server. 

In the context of WordPress websites, this error can occur when there is a delay in communication between the server hosting the website and another server or service it relies on to generate the requested web page. 504 Gateway Timeout error will disturb the user experience on your website and possibly harm your website’s reputation.

 In this article, we will explore all the troubleshooting ways that will help you fix the 504 Gateway Timeout error in WordPress. Join us and make sure your website visitors have a smooth browsing experience.

What does 504 gateway timeout mean?

This message appears when there is a disruption in loading the webpage due to a miscommunication between the web servers. The server carrying your request waits for the response from the upstream server to open a web page. However, if the upstream server is facing issues such as high traffic or if the server is down, it fails to complete the request, resulting in the web page not loading. 504 is the HTTP Status Code indicating the Gateway Timeout error.

The error message displayed can vary according to web browsers or websites. Here are a few error message variations ;

  • 504 Gateway Timeout
  • Gateway Timeout Error
  • Gateway Timeout (504)
  • 504 Gateway Timeout NGINX
  • NGINX 504 Gateway Timeout
  • Error 504
  • 504 Error
  • HTTP Error 504
  • HTTP Error 504 — Gateway Timeout
  • HTTP 504
site cant be reached

Troubleshooting 504 Gateway Timeout Error

Your website might be showing this Gateway Timeout Error because of several reasons. Some of the issues that might be causing it are:

  • Server Overload: When a server is overburdened with requests, it becomes unable to follow those requests on time. In this case, a Gateway Error might occur.
  • Slow Upstream Server: If your gateway server cannot access the main upstream server, the server might get slow or unresponsive; this situation is also considered a 504 Gateway Timeout WordPress error.
  • Network Issues: A timeout error might occur if the network connection between your gateway server and the upstream server fails to connect. The webpage will show you an error.
  • DNS Problems: Another cause of this error is Incorrect or misconfigured Domain Name System (DNS) settings. It will prohibit the gateway server from resolving the upstream server’s IP address. As a result, there will be a timeout error.
  • Problems with the Proxy Server: If a Network proxy server that is working in the communication between the client and the upstream server faces difficulty with the proxy server’s configuration or performance, a WordPress gateway timeout error might occur.
  • Security Reasons: Very Strict firewall rules or security settings sometimes cause interfere with communication. They disturb the connection between the gateway and the upstream server.
  • Server Misconfiguration: If your server is faulty or has issues with configuration, your website will show you the error. This is because it doesn’t have sufficient server resources.
  • Issues with the Content Delivery Network (CDN): If a CDN that is used to deliver content faces difficulty with the CDN’s infrastructure or setup, it can result in WordPress gateway timeout error messages.
  • Maintenance or Server Upgrades: The website will temporarily show a timeout error if some maintenance or upgrade is done on your server.
  • Errors in Code: If any error occurs in the code of the website or script, your website might face delays in processing requests. This will result in a WordPress 504 Gateway Timeout Error.

1. Check Your Internet Connection

Before we explore some of the complex and technical issues that might be causing errors, let us explore the simplest ones first. The first thing that might be causing an error is some issue with your internet connection. You have to make sure that the internet connection is working just fine. There should be no disturbances. It is very easy to troubleshoot and resolve these connectivity issues that might be causing a 504 Gateway Timeout error on your website.

You can try the following troubleshooting steps to fix the error. 

1.1. Restart the Router/Modem

The first thing you should do is restart your Router and Modem, whatever you are using. To restart, you should power off the Router/Modem. After that, wait for a few seconds. Turn it back on. In most cases, the issue will be sorted.

1.2. Cable/Connection Problem

If the issue is not with the router, you need to check the cables and connections. You need to make sure that all the cables are connected to the modem or router correctly. The internet connection will be disrupted if the cable is loose or damaged.

1.3. Test on Different Devices

Another way to check your internet connection is to test your website on different devices. You can test it on computers, smartphones, tablets, etc. You can also try different internet sources to identify the problem. This way, you will understand where the network is showing glitches.

1.4. Contact your Internet Service Provider (ISP)

If you continue to experience problems with your internet connection, you should reach out to your ISP’s customer support. They will help you find out the issue and resolve the connection.

2. Refresh the Page

In some cases, the 504 error can occur because of some temporary glitch or server overload. You should ensure this is not the case before you start looking for technical issues and their solutions. You should refresh your browser. The 504 server overload error code or temporary glitch will likely be resolved after refreshing your webpage.

3. Clear Browser Cache

Browser cache is one of the common causes for 504 Gateway Timeout WordPress errors. You can clear your browser cache, and it may resolve the issue. To sort out this cache issue, you can follow the given steps for each browser.

For Chrome

To clear the cache on your Chrome browser, you have to:

  1. Go to the Settings
  2. Then Select the option of Privacy and security
  3. From here, you can clear the browsing data.
  4. You can also select the desired time range.
  5. Make sure that the “Cached images and files “option is selected.
  6. At last, click on the option of “Clear data” to clear the cache.
clear cache in chrome

For Firefox

To clear the cache on your Firefox browser, you have to:

  1. You have to go to the Options section and select Privacy & Security.
  2. From here, you have to go to the Cookies and Site Data section.
  3. Then click on the option of Clear Data.
  4. You need to ensure that the Cached Web Content option is selected.
  5. At last, click on the Clear option.

For Safari

To clear the cache on your Safari browser, you have to:

  1. Go to your Safari browser.
  2. From there, choose the option for Clear History.
  3. From here, select the desired time range.
  4. Then click on the Clear History option.
  5. You can also go to the safari option and then choose preferences.
  6. Then select the option of Privacy.
  7. At last, click on the option of Manage Website Data to remove the cached data.

4. Disable Proxy Servers

Proxy servers act as intermediaries between clients (such as web browsers) and other servers. These servers can sometimes cause problems. As a result, you can face the issue of 504 errors.

Following are some easy steps to solve this problem for different operating systems:

For Windows

For the Windows operating system to disable proxy, follow these steps:

  1. Go to the Settings of the window
  2. Then select the option of Network & Internet
  3. At last, choose Proxy
  4. From here, you can disable the ‘Use a proxy server’ option
disable proxy in windows

For macOS

For the macOS operating system to disable the proxy, follow these steps:

  1. Go to your browser’s option of System Preferences
  2. From there, you have to select Network
  3. Select the option of your network connection and then click on Advanced
  4. You can move to the “Proxies” tab and disable the settings of the proxy

5. Disable WordPress Plugins and check the theme

It is possible that the WordPress timeout error is due to some issues with your WordPress plugins or themes. First of all, check for any updates and make sure everything is updated promptly. If the issue persists after updating, try disabling the plugins manually via FTP or the File Manager. 

Follow the steps given below to deactivate your plugins;

  • Connect to the site via an FTP client.
  • Open the ‘wp-content’ folder, where you will find the ‘plugins’ folder.
  • Rename the ‘plugins’ folder to ‘plugins-old’. The plugins will be deactivated immediately.
  • Check if your website is displaying normally with no error messages. If it is back to normal, the issue is with one of the plugins. If so, continue the following steps.
  • To identify the plugin which causes the error, rename the folder back to ‘plugins’. Now, the plugins will be activated.
  • Inside the ‘plugins’ folder, rename each plugin folder separately and check the website until you find the problematic plugin.

If the issue is not with the plugins, try switching the WordPress theme to the default one. Check your website to see if it is working. By following these steps systematically to deactivate and reactivate the plugins and themes, you can identify if the WordPress plugins or themes are the reason for the 504 error page.

6. DNS issues

A misconfigured DNS setting can cause miscommunication between the client and hosting servers. Check the DNS status and ensure these are correctly configured in the domain registrar’s dashboard. 

When changes are made in the DNS records, it takes up to 48 hours for the changes to be disseminated worldwide. Users might experience a WordPress 504 gateway time-out error during this time.

If the DNS servers are down, it can cause a 504 error. Contact the support team to resolve any DNS setup or server configuration issues.  

7. Change DNS servers

Switching the DNS servers to DNS 8.8.8.8 and 8.8.4.4 can resolve any internet connectivity problems due to issues with the DNS servers, which might be causing a 504 error.

Here’s how to change the DNS servers.

For Windows

  • Search and open control panel.
  • Go to Network and Internet > Network and Sharing Center > Change adapter settings.
  • Choose your connection and click properties.
  • Select Internet Protocol Version 4 (TCP/IPv4), click Properties.
  • Click on ‘Use the following DNS server addresses’ and enter 8.8.8.8 on the box provided for the Preferred DNS server and 8.8.4.4 on the box for the Alternate DNS server.
  • Click OK to save the changes.

For Mac

  • Open System Preferences > Network.
  • Select your connection and click on ‘Advanced’.
  • Go to DNS tab
  • Click on the ‘+’ sign to add new DNS server. 8.8.8.8 and 8.8.4.4 for Google DNS or 1.1.1.1 for Cloudflare DNS.
  •  Click OK > Apply.

Visit your website to see if the issue is resolved.

8. Increase PHP Memory Limit

If the memory allocated to PHP has reached its limit, there will be a 504 error. You can solve this issue by increasing the PHP memory limit in WordPress. To do that, you have to edit the wp-config.php file.

For that, you need to follow the steps below:

  1. First, you have to Access the WordPress site’s files.
  2. You can access them by using an FTP client or a file manager
  3. The file manager will be by your hosting provider
  4. You can then locate the wp-config.php file in the root directory of your WordPress installation.
  5. From there, download a copy of the wp-config.php file. Keep it as a backup
  6. After that, open up the wp-config.php file using a text editor
  7. Then add this code: define(‘WP_MEMORY_LIMIT’, ‘256M’) right before the line that says, “That’s all, stop editing! Happy blogging!”
  8. Remember that depending on your server needs, you can adjust the memory limit value (e.g., ‘256M’)
  9. Save the changes
  10. Now upload the modified wp-config.php file back to your server
  11. Ensure to replace the existing file
Increase PHP Memory Limit

9. Contact Your Hosting Provider

In case none of the solutions given above solves your problem, it is possible that there is some issue with your server. You will need the help of your hosting provider. 

  1. You should contact the customer service of your hosting provider. Give them details about your issue
  2. They will try and check the error from their side
  3. They will ask you for some relevant information that you have to share
  4. They might ask about the specific URLs or actions that trigger the 504 gateway timeout wordpress error
  5. The support team of your hosting provider will find the problem and solve the server issues that are causing that error
  6. Once done, you will be good to go

10. Optimize WordPress Performance

If you want to make sure no such error occurs in the future and you want to enhance the performance of your website, you can try a few things.


You should follow the following instructions to achieve your goal:

10.1. Use Caching Plugins

To solve cache-related issues, you can Install and configure caching plugins. Some of the good plugins are WP Super Cache or W3 Total Cache. 

They will help create static HTML files of your dynamic WordPress pages. This will reduce the server’s workload and improve the pages’ loading time. 

504 Gateway Timeout

10.2. Optimize Images And Use Lazy Loading

The large files on your website can slow it down. You should optimize these images and videos.

For optimization, you can compress them without compromising quality. You can also enable lazy loading. This will delay the loading of images till the time the user scrolls to them. It will help save bandwidth, improve the loading time of the initial page, and avoid 504 Gateway Timeout errors. 

By continuously optimizing your website performance, you can avoid such errors from occurring in the future.

10.3. Implement A Content Delivery Network (CDN)

CDN is responsible for shoring the static files of your website on multiple servers worldwide. Whenever a user accesses your website, the CDN will deliver the content from the server nearest to them. It will help reduce the latency and improve the overall performance.

10.4. Clean your WordPress Database

Optimizing the WordPress database and deleting unnecessary data helps improve the performance of the website and decreases the chances of 504 gateway time-out WordPress errors. You can use free software tools like phpMyAdmin to optimise your WordPress database.

11. Turn Off VPN Service

If there are issues with the VPN server, such as downtime or high traffic, it may result in a timeout. Try turning off the VPN service if you are using one to browse the web. If the issue persists, check if the connection is properly configured. Try reconnecting the VPN to resolve any connectivity issues. If these solutions are not working, contact your service provider for assistance or switch to a different VPN service.

12. Turn Off the Website Firewall

Firewalls provide security from untrusted external networks. The Gateway timeout error could possibly be caused by the firewall blocking the servers. Check the firewall settings to ensure that the website is not blocked or restricted by the firewall. Disabling the firewall temporarily could resolve the issue. If the issue continues, contact your firewall service provider.

Conclusion

WordPress website owners and visitors can be frustrated by the 504 Gateway Timeout error. This post provides troubleshooting strategies to fix the error quickly. Take a few first actions to troubleshoot website access issues. First, check your internet connection’s stability. Second, refreshing the page may fix any temporary issues. 

Finally, deleting the browser cache can fix website access issues. These easy measures can frequently fix the problem and provide flawless website access.

If your issue is still unresolved, don’t hesitate to get in touch with WPclerks, a WordPress support service providing company. We are available to help by taking care of your one-time tasks and WordPress Support and Maintenance quickly and easily. Forget about hours spent searching for solutions yourself.

Frequently Asked Questions (FAQs)

What does the 504 Gateway Timeout error mean?

This error means that the server that was loading a web page did not get an answer from another server in a timely manner. This can happen for a number of reasons, including server overload, proxy server conflicts, and proxy server connectivity issues.

Why is it important to fix the 504 Gateway Timeout error?

It’s important to fix the 504 error because it can make it hard for people to use your website. 
If this error keeps happening, visitors might get upset and decide to leave. Also, search engines may see frequent 504 errors as a sign of poor website performance, which can hurt your search rankings.

You refreshed the web page, but the 504 error still persists. What should you do next?

If refreshing the page doesn’t fix the error, you can try clearing your browser’s cache. Also, make sure there are no connectivity issues by checking the stability of your internet connection. If the problem keeps happening, try some of the other troubleshooting steps in this guide or get help from your hosting provider.

How can you prevent future occurrences of the 504 error?

You can improve the performance of your WordPress website to stop getting the 504 Gateway Timeout error in the future. Some ways to do this are to use caching tools, optimize images, set up lazy loading, and use a content delivery network (CDN). The WordPress 504 error is less likely to happen if you take these steps to lower server load and speed up page load times.

Is the 504 Gateway Timeout error always a result of issues on your end?

No, not always. Some reasons for the 504 error can be resolved on your end, but it could also be a server-side problem that you can’t fix. In these situations, getting in touch with the support team of your hosting provider and giving them specifics about the error can help them investigate and fix the problem.