Jamsheer K
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 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.

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 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 an 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 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 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 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 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. Most probably, the issue will be sorted. In case the issue was because of some temporary glitch, it will be resolved after refreshing your webpage.

3. Clear Browser Cache

Browser cache is one of the common causes for  504 Gateway Timeout 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. 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

6. 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 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

7. 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:

7.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

7.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.

7.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.


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 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.