Placeholder canvas

The Easy Guide To Fix 504 Gateway Timeout Error In WordPress

Mistakes are about as welcome as receiving a traffic violation. Both entail potential costs, but the consequences will leave you with regret. In the context of your WordPress website in 2023, encountering an issue like the 504 Gateway Timeout can be quite distressing. 

This error can disrupt your ability to access your webpage, and at first, it may seem like there’s no immediate solution. However, there are several troubleshooting steps you can explore. This informative guide offers assistance in resolving the 504 Gateway Timeout issue for your WordPress site.

What is the 504 Gateway Timeout Error?

A 504 Gateway Timeout Error signifies that a server failed to receive a prompt response from another server. In this scenario, one of these servers functions as a gateway and was unable to complete your request within a specified time window.

The manifestation of this error may take on diverse forms, including the following:

1. 504 Gateway Timeout nginx

2. 504 Gateway Timeout

3. 504 Error

4. Gateway Timeout Error

5. HTTP Error 504

6. 504 Gateway Timeout – the server did not respond within the allotted time

7. HTTP Error 504 – Gateway Timeout

8. Gateway Timeout (504)

9. NGINX 504 Gateway Timeout

Let’s explore the solutions for resolving this issue.

1. Wait and Refresh

At times, we tend to overestimate the permanence of certain situations, including errors. The 504 Gateway Timeout error you’re currently encountering could be a transient issue. It might be caused by a sudden surge in website traffic or the server using more resources than usual, making it difficult to predict the exact cause.

The most straightforward course of action is to exercise patience and attempt to refresh the webpage after a brief waiting period. While waiting, you can navigate to a website checker to determine whether the website is experiencing downtime for everyone or if the problem is unique to your experience.
There’s a possibility that this problem is only temporary, and you’ll regain access to the webpage shortly. If not, you can address the issue if you follow the steps for troubleshooting mentioned in this guide.

2. Check if the issue is Browser Related

At times, your web browser might encounter an error. To confirm the source of the issue, the best course of action is to switch to a different browser and check if the error is still there. If the error doesn’t occur when using other browsers, you can reasonably conclude that the problem lies with the specific browser you were initially using.

Another step that can be taken to troubleshoot this is clearing your browser’s cache. To learn how to do this, refer to a concise guide on clearing browser cache.

You might also consider utilizing incognito mode as an alternative.

Furthermore, deleting cookies associated with the website you are currently visiting can help resolve issues. If you’re using Google Chrome and want to delete site-specific cookies, follow these steps:

1. Navigate to the Settings.

2. Go to the Advanced section.

3. Find the Privacy and Security category.

4. Select the “Site Settings” option.

By following these steps, you can address common browser-related issues and improve your browsing experience.

In the Site Settings screen, click on “Cookies.”

The Cookies screen will appear. Select “See all cookies and site data.”

Once you click the option, a list of sites will appear. Select your site and delete cookies.

3. Reboot Network Equipment

At times, a malfunction in your hardware can trigger the occurrence of an error. Issues may arise with your modem, router, switches, or other networking devices. To troubleshoot this, restart all your network equipment to see if it resolves the problem.

4. Deactivate VPN

In certain cases, VPN servers might not be able to establish a connection with the server hosting your website, leading to a 504 Gateway Timeout Error. If you’re utilizing a VPN, consider disabling it. If you can access your website without a VPN, you can conclude that the VPN is the root cause of the problem. You can either try switching to a different VPN or discontinue its use altogether.

5. Verify Proxy Configuration

When there are discrepancies in your proxy settings, you may encounter difficulties connecting to the server. Make sure that your proxy settings are correctly configured. Additionally, you have the option to disable the proxy settings in your web browser, such as Google Chrome.

To disable proxy settings in Google Chrome:

1. Navigate to Settings.

2. Click on Advanced.

3. Under the System section, select “open proxy settings.”

4. A dialog box will appear.

5. Go to “Connections” and click on “LAN settings.”

6. You will find a checkbox for “Proxy server.” Uncheck it and click OK.

6. Flush DNS Cache

Perform the following steps to clear the DNS cache on Windows as an administrator:

1. Open the Command Prompt containing the administrative privileges.

2. Execute the following commands one by one, pressing Enter after each one:

 a. `ipconfig/release`

 b. `ipconfig/all`

 c. `ipconfig /flushdns`

 d. `ipconfig/renew`

 e. `netsh int ip set dns`

 f. `netsh winsock reset`

This process renews your IP address and may help resolve the 504 Gateway Timeout error.

On Mac, follow these steps:

1. Open the Terminal App, which is located in Applications >> Utilities >> Terminal.

2. Copy (Ctrl+c) the following command mentioned below and paste (Ctrl+V) it into the Terminal and press Enter:

  `sudo killall -HUP mDNSResponder; sleep 2;`

3. Next, you will be asked to type your password. After providing your password, the DNS cache will be cleared, potentially resolving the 504 Gateway Timeout error.

7. Use Google’s DNS

At times, you may encounter a 504 error due to your DNS configuration. To address this issue, consider switching to Google’s DNS service. The steps below outline how to achieve this on both Windows and Mac operating systems.

A) For Windows

If your current DNS settings are causing issues, you can switch to Google’s DNS using the following steps:

1. Press the Windows button + R button at once (Win+R combination). This will open the Run Program.

2. Type “Control Panel” and press “OK” to access the Control Panel.

3. In the Control Panel, select “View” and then choose “Small Icons.”

4. On the next screen, click “Network and Sharing Center.”

5. Navigate to “Change adapter settings.”

6. Press the right click button on the network you are using and select “Properties.”

7. Click on “Internet Protocol Version 4 (TCP/IPv4)” and then click on “Properties.”

8. In the “Use the following DNS addresses” section, input the following values:

   Preferred DNS Server:

   Alternate DNS Server:

9. Click “OK” to apply these changes. You are now using Google’s DNS, which should resolve the problem in most cases. If the issue persists, proceed to the next step in this guide.

B) For Mac

  1. In System Preferences, go to “Network.”

2. Select the network for which you want to modify the DNS settings and click on “Advanced.”

3. To add a DNS server, click on the “+” button.

4. Enter and as Google’s DNS servers.

By following these steps, you can switch to Google’s DNS, which should help resolve the 504 Gateway Timeout Error. Enjoy uninterrupted browsing, and if the issue persists, continue with the next troubleshooting steps.

8. Deactivate Plugins

Should a plugin excessively request the server, it could lead you to a 504 Gateway Timeout error. In such a situation, you can attempt to resolve this issue by disabling all plugins.

If you can log in to the administration section of your WordPress website, you can manually deactivate individual plugins.

However, if you cannot access the WordPress admin area, an alternative approach is to connect to your site using an FTP client.

Once connected, navigate to the “wp-content” directory. Within this directory, you’ll find a folder labeled “Plugins.” To deactivate the plugins on your site, simply change the folder’s name to something different, like “Plugins_old.”

Once your plugins are deactivated, assess the site for any remaining errors. If the error is resolved, it indicates that one of the plugins was responsible for the issue. To pinpoint the problematic plugin, reactivate each one individually and monitor for the error.

In the event that your web hosting service supports WP CLI, you can deactivate all plugins without needing to access the plugins folder. Nestify’s Managed WordPress Hosting is compatible with WP-CLI.

9. Tweak VPS Settings

If you are utilizing a Virtual Private Server (VPS), you have the option to adjust server configurations to increase specific resource limits, which can help resolve the occurrence of a 504 Gateway Timeout Error. This can be performed on both Apache and Nginx Servers.

For Apache:

1. Locate and open the httpd.conf file.

2. Insert the subsequent line within the file: `Timeout 600`

3. In the php.ini file, append the subsequent line: `max_execution_time 300`

For Nginx:

1. Navigate to the `/etc/nginx/conf.d/timeout.conf` file.

2. Modify the values to the following:

   – `proxy_connect_timeout 600;`

   – `proxy_send_timeout 600;`

   – `proxy_read_timeout 600;`

   – `send_timeout 600;`

3. Additionally, access the php.ini file and add the following line: `max_execution_time 300`

Please note that it’s crucial to adjust these settings judiciously to match your specific server requirements and to ensure you have the necessary permissions to make these changes.

10. Server Issue

Web servers may experience timeouts as a result of high server load, among other potential server-related issues. Some of these issues in 2023 include:

1. Insufficient PHP Workers: PHP workers are responsible for executing code on your WordPress website. During times of increased load, more PHP workers may be needed than originally allocated.

2. Firewall Complications: The server’s firewall may be misconfigured or contain errors in its rules, hindering the establishment of proper connections.

3. Network Connectivity Problems: Network connectivity issues can lead to delays in responding to HTTP requests, potentially resulting in 504 Gateway Timeout errors.

4. Server Sluggishness: The server itself may operate at a slower pace, making it unable to respond within the required timeframe.

When confronted with server issues, there is limited action you can take on your own. It is advisable to get in touch with your web hosting provider to address and resolve the problem. Depending on the response and the severity of the issue, you might want to consider switching to a different hosting service for improved performance.

11. Cloudflare Errors

When employing a Content Delivery Network (CDN) service such as Cloudflare in 2023, you may encounter a 504 Gateway Timeout error in specific situations. This particular error could manifest in one of two distinct forms.

The first type of error page signifies that the problem lies with Cloudflare’s infrastructure. If you come across this error, it is advisable to reach out to Cloudflare’s support team for assistance.

On the other hand, the second type of error page indicates that the issue is relevant to your web hosting provider rather than Cloudflare. Should you encounter this error, it is recommended that you get in touch with your web hosting service to address the problem.

In summary, when using a CDN solution like Cloudflare in 2023, encountering a 504 Gateway Timeout error can occur in different scenarios. The specific error page you see will guide you on whether the issue is tied to Cloudflare or your hosting provider, prompting you to contact the relevant support team accordingly.

12. Reach Out To Your Web Host

If you’ve tried all the previously mentioned solutions without success, it’s essential to contact your hosting provider. You’re investing in hosting services, and it’s your right to expect timely resolution of any issues from your web hosting company.


These are the standard methods to address the 504 Gateway Timeout error. We sincerely hope that some of these solutions have proven effective for your situation. If you’ve discovered an alternative fix, we encourage you to share it in the comments section. We greatly value constructive discussions.


What is a 504 Gateway Timeout Error in WordPress, and why does it occur?

A 504 Gateway Timeout Error in WordPress is an HTTP status code that indicates that the server didn’t receive a response on time from another server while trying to load a webpage. This error can be a result of various factors, such as slow server response times, inadequate server resources, or issues with third-party services.

How can I identify the cause of a 504 Gateway Timeout Error on my WordPress site?

To identify the cause of a 504 Gateway Timeout Error, you should check your server logs for more specific error information. Look for any spikes in traffic, server resource limitations, or issues with external services that your site relies on. It’s essential to pinpoint the root cause to apply the right fix.

What are some common methods that can fix a 504 Gateway Timeout Error in WordPress?

There are several methods to fix this error, including:

– Optimizing your website’s performance by reducing resource-heavy plugins or themes.

– Increasing server resources, like CPU and memory.

– Adjusting timeout settings in your server or proxy.

– Check and optimize your database for efficiency.

– Identifying and addressing issues with third-party services or APIs your site depends on.

How can I prevent 504 Gateway Timeout Errors from occurring in the future?

To prevent 504 errors, you can:

– Regularly monitor your server’s performance and allocate more resources as needed.

– To distribute website content efficiently, use a Content Delivery Network (CDN).

– Update your WordPress themes and plugins to their latest versions.

– Optimize images and content for faster loading.

– Implement caching to reduce server load and improve response times.

When should I seek professional help while fixing a 504 Gateway Timeout Error in WordPress?

If you’re unable to resolve the error on your own or if it’s causing significant downtime for your website, it’s advisable to seek professional assistance. Web hosting providers, WordPress experts, and developers can diagnose the issue and implement solutions tailored to your specific situation. It’s important to address the problem promptly to minimize disruptions to your site’s visitors.

Want faster WordPress?

WordPress Speed Optimization

Try our AWS powered WordPress hosting for free and see the difference for yourself.

No Credit Card Required.

Whitelabel Web Hosting Portal Demo

Launching WordPress on AWS takes just one minute with Nestify.

Launching WooCommerce on AWS takes just one minute with Nestify.