Table of Contents

504 Gateway Timeout in WordPress: Causes and Practical Fixes

Originally published: December 5, 2022 · Last updated: August 13, 2026

A 504 Gateway Timeout means that a server acting as a gateway or proxy did not receive a response from an upstream server quickly enough. On a WordPress site, the visible error may come from a CDN, reverse proxy, hosting platform or web server rather than from WordPress itself.

What a 504 error actually tells you

The important point is that a 504 is usually a server-side timing problem. The browser reached one server successfully, but that server was waiting for another component and the wait exceeded its allowed time.

This is different from a normal WordPress application error. Changing the browser or clearing local cookies rarely fixes a persistent 504 affecting many visitors.

Common WordPress causes

Several situations can create or expose timeout problems:

  • a temporary hosting or upstream service outage;
  • a very slow database query;
  • a plugin or theme process that takes too long;
  • a large import, backup, optimization or bulk operation;
  • high traffic combined with insufficient server resources;
  • a CDN or proxy waiting too long for the origin server.

First determine whether the problem is temporary

Reload the site after a short interval and test more than one URL. If only one heavy admin operation fails while normal pages work, the issue may be tied to that task rather than the whole site.

If the entire site is unavailable for multiple users, check the hosting provider’s status information before changing WordPress.

Review what happened just before the error

Context matters. A 504 that starts during a mass image optimization, database cleanup, backup, migration or bulk post deletion is a strong sign that the operation exceeded an infrastructure limit.

In that situation, reducing batch size is often more sensible than repeatedly retrying one huge operation.

Check WordPress for unusually heavy work

If the site remains accessible, review recent plugin changes, scheduled jobs and resource-intensive tasks. Performance and backup plugins can legitimately create short bursts of load, but they should not make the site repeatedly unavailable.

Use logs and hosting metrics

Persistent 504 errors are best diagnosed with hosting logs and resource metrics. Look for patterns around the time of the timeout: CPU or memory exhaustion, slow database operations, PHP workers at capacity, or repeated long-running requests.

If those metrics are not available in your hosting panel, provide the host with the exact time of the error and the affected URL or operation.

Do not immediately increase every timeout

A longer timeout can hide the symptom without solving the cause. If a request takes several minutes because a plugin is inefficient or a bulk operation is too large, allowing it to run even longer may simply consume resources for a longer period.

Identify why the request is slow first. Increase limits only when the workload is legitimate and the infrastructure is sized for it.

Practical WordPress checklist

  1. Confirm whether the whole site or one operation is affected.
  2. Check host or CDN status.
  3. Note what task was running when the timeout occurred.
  4. Reduce large jobs into smaller batches.
  5. Review recent plugin or theme changes.
  6. Check hosting logs and resource usage.
  7. Ask the host to trace persistent upstream timeouts.

When a 504 is a capacity signal

If the site repeatedly times out during ordinary traffic, the problem may no longer be a one-off task. That is the point to review caching, database performance, PHP worker limits and the hosting plan itself.

Reference: MDN 504 Gateway Timeout.