Seeing a “504 Gateway Timeout” error on your WordPress site? Then you know how frustrating it is when your website is unreachable. An error page like that doesn’t just frustrate you, it can also scare off visitors and hurt their trust in your site. Fortunately, a 504 error is usually fixable. In this article I explain what the 504 Gateway Timeout means, why it happens, and—most importantly—how to resolve it step by step. I keep it clear and practical, without unnecessary jargon.
What is a 504 Gateway Timeout error?
A 504 Gateway Timeout is an HTTP server error that means your web server doesn’t get a timely response from another upstream server that’s needed to load the page. In other words, there’s a “link” in the chain that’s responding too slowly. Your request to view the page is left waiting, but the part of the site or server that must respond takes too long. Because the response never arrives, the first server ultimately returns a timeout error to your browser.
Example of a 504 Gateway Timeout message in Google Chrome. The exact appearance of the 504 error can vary by browser or server. In Chrome you might see “This page isn’t working – ... took too long to respond. HTTP ERROR 504”. Other systems simply show “504 Gateway Timeout” (such as a blank white page with that text, see the image) or “Gateway Timeout: The server didn’t respond in time”. In every case it means the same issue: the server didn’t respond in time.

What causes a 504 Gateway Timeout?
A 504 error is usually caused by a server-side issue, not your computer or internet connection. Common causes include:
- Server overload or maintenance: If the server your site runs on is down (for example because of maintenance or too much traffic), it can’t respond in time and you’ll see a 504 Gateway Timeout. A spike in visitors or a heavy task on the server can cause a timeout.
- DNS or server changes: Did you recently move your site to a new host or server? Then your domain’s DNS settings may still point to the old location. During that transition your site can throw a 504 error until the DNS changes propagate everywhere (usually a few hours, up to about 24 hours). In this case, patience can “solve” the issue.
- Firewall or CDN problems: Are you using a firewall or CDN (for example Cloudflare or Sucuri) for your site? A bad configuration can block legitimate requests. Sometimes a firewall wrongly flags CDN requests as an attack and refuses to pass them through, which can result in a 504 error.
- Errors in scripts or plugins: A bug in your site’s code (for example in a WordPress plugin or theme) can prevent certain requests from being answered properly. That kind of bug or incompatibility can stall the server. If a plugin takes too long (for example a heavy database query or an external API that doesn’t respond), the process can time out.
- Network delays: Although less common, network issues between servers can also play a role. For example, if your site sits behind a proxy or load balancer and it can’t connect to the backend server. This is usually outside your direct control. For most users it’s mainly important to rule out that the problem is on their side; in most cases it isn’t the visitor’s internet connection.
Note: A 504 is related to other 5xx server errors (such as 502 Bad Gateway or 503 Service Unavailable), but the root cause differs. In all cases it’s a problem the server reports while processing the request.
Now that I’ve explained what it is and why it can happen, the next question is: how do you fix it? Below I share practical steps to troubleshoot a 504 Gateway Timeout in WordPress. I start with the simplest fixes and then move to the more technical ones.
How do you fix a 504 Gateway Timeout in WordPress?
Follow these steps in order. After each step, test whether your site loads again. If it does, you can stop there.
Step 1: Refresh the page (and wait a moment)
Sometimes the error is temporary. The first thing you can try is a refresh: wait a minute and reload the page. Click the reload button in your browser or press F5 (or Ctrl+R / Cmd+R). This forces your browser to request a fresh version of the page from the server. Tip: optionally clear your browser cache before refreshing so you’re sure you’re not seeing an old, broken version of the page. If the site works after refreshing, it was likely a short hiccup (for example a moment of server overload) and the issue is already resolved. If the 504 error keeps returning or only disappears briefly, continue to the next step.
Step 2: Check your own connection and device
Even though the cause is usually server-side, it’s smart to rule out issues on your end. Try opening the website in a different browser or on another device. You can also use a private/incognito window. If the site loads there, something may be wrong with your primary browser (for example an outdated extension or cache issue). Usually the 504 error will appear on all your devices and browsers, confirming that the issue is not your computer but the site or server.
To be sure it’s not just you, you can use an online tool. Sites like “Down for Everyone or Just Me” or “Is It Down Right Now?” let you quickly check whether your site is offline worldwide. If the test shows the site is unreachable everywhere, you can be confident the server needs attention.
Step 3: Disable your VPN or proxy (if applicable)
Are you using a VPN connection or sitting behind a special proxy server? Try disabling it temporarily and reload your site. A VPN (or proxy) routes your traffic through an extra server, and that can sometimes introduce delays or communication issues. If the site works without the VPN, the problem was on the VPN server (for example overload there). In that case try a different VPN location, or leave the VPN off while you work on your website.
If you’re on a corporate network or proxy you can’t disable, try another internet connection (for example a mobile hotspot) to see if that makes a difference.
Step 4: Temporarily pause security services (firewall/CDN)
If you use an external firewall or CDN for your WordPress site—popular examples are Cloudflare, Sucuri, or a similar security plugin—it can be worth pausing it briefly. This means routing traffic directly to your server for testing. If your firewall or Content Delivery Network can’t connect to your server, that can cause the 504 error. How do you do this? Log in to the service’s dashboard (for example Cloudflare) and look for an option to put the site in development/offline mode or pause protection. Then reload your website. If the site works now, the root cause is in the firewall/CDN settings. Your server might be unintentionally blocking the firewall/CDN IP addresses. The fix is to whitelist those IPs at your host (contact hosting support for this) or review your firewall/CDN configuration. Note: don’t forget to re-enable your firewall/CDN after the test for security and performance, ideally once the underlying issue is resolved.
Step 5: Deactivate plugins (and your theme) on your WordPress site
A malfunctioning WordPress plugin can sometimes slow the server down and cause a 504 error. This is especially likely if the error appeared right after installing or updating a particular plugin. To test this, temporarily disable all plugins. In your WordPress dashboard go to Plugins and deactivate them one by one, or rename the entire wp-content/plugins folder via FTP/File Manager to deactivate them all at once.
Then try loading the site again. If it works, one of the plugins is the culprit. Reactivate plugins one by one to identify which one causes the error. Remove or replace that plugin, or contact the developer for a fix.
If the error still happens with all plugins disabled, your theme could be the cause (though this is less common). Temporarily switch to a default WordPress theme (for example Twenty Twenty-Three). You can do this in the dashboard (under Appearance > Themes) or by changing the active theme name in the database if you can’t reach the admin area. If the site works with a default theme, your original theme has an issue. Consider updating it or contacting the developer.
Step 6: Check server capacity (or upgrade your plan)
A 504 error can be caused by a server that constantly hits its limits. This often happens on sites with a lot of traffic or uncached requests (for example a busy webshop), while the hosting plan has limited memory or CPU. Check your hosting control panel for warnings about high load or resource limits. Many hosting providers (especially shared hosting) show CPU or RAM usage; if those are constantly at 100%, that explains the timeouts. In that case you have a few options: optimize your site (for example disable heavy features and use caching where possible) to reduce load, or upgrade to a more powerful hosting plan that can handle it. Sometimes you can raise the PHP timeout limit in the hosting panel (for example from 30 to 60 seconds), but that’s often a temporary patch. Ultimately you want a server that responds fast enough within normal time.
Step 7: Contact your hosting provider
If none of these steps fixes the issue, it’s time to involve your host or a professional developer. Your hosting provider can usually check server logs to see why the server isn’t responding in time. Based on error logs or monitoring they can pinpoint the exact cause—such as a specific server setting, a database issue, or something outside your control. Hosting support can often resolve the problem directly or give targeted advice. Don’t wait too long to ask for help, because a persistent 504 error is bad for both your visitors and your visibility in Google.
Summary and final tip
A 504 Gateway Timeout in WordPress means a server responds too slowly, so your page doesn’t load. In plain language: there’s a timeout between two servers. Most often the cause is on the hosting/server side (overload, firewall, DNS, or a code issue). Fortunately, there’s a lot you can do yourself to fix it: start with the simple steps (refresh the page, try another browser) and move toward the more specific causes (VPN, firewall/CDN, plugins, etc.). Often you can find the culprit by elimination and the site is reachable again once you take the right action.