DEV Community

OTOS Links
OTOS Links

Posted on

Debugging a WordPress 504: it is not WordPress

A 504 on a WordPress site is not WordPress telling you something is broken. It is the layer in front of WordPress, usually Nginx, a load balancer or a CDN, giving up on a request that PHP never answered in time. That distinction changes how you debug it.

The useful triage: if only one page or one action 504s, suspect a plugin or a long-running task on that request. If every page 504s, suspect the server itself, its PHP pool, or the database.

Order I would work in: reload once in case it was transient, then deactivate plugins (rename the plugins folder over SFTP if wp-admin is unreachable), raise PHP max_execution_time and the Nginx fastcgi_read_timeout, disable the CDN for a test, and ask the host whether the box was overloaded at that minute.

One caution: raising a timeout hides the problem instead of fixing it. Find the slow query or plugin first, and raise the limit only when the task genuinely needs the time. The full seven-step version with the exact config lines is here: https://cmsideas.net/wordpress-504-gateway-timeout/

Top comments (0)