A 504 means a request took too long for the backend to finish. It usually points to a slow query, large import, or external API call.
- Identify the slow action — a big import, backup, or report often triggers it. Break large jobs into smaller batches.
- In cPanel MultiPHP INI Editor, raise
max_execution_timeandmax_input_timefor long scripts. - Optimize slow database queries and clear bloated tables (e.g. WordPress transients).
- If an external API your site calls is down, the wait causes the timeout — add a shorter timeout in your code.
- Clear caches to rule out a stored error.
If short, simple pages also time out, open a ticket with details.