Support article
Error 504 Gateway Timeout: how to fix it
Learn what the 504 Gateway Timeout error means, why it appears and how to review hosting, plugins, PHP, databases and performance.
What this error means
The 504 Gateway Timeout error means that a request took too long to complete and the server ended the process before receiving a valid response.
The key word is timeout: something did not respond in time.
It may happen because of a temporary server issue, a website that is too slow, heavy database queries, stuck PHP processes or intermediate services that are not responding.
Why it happens
The most common causes are:
- PHP processes that take too long.
- Heavy plugins or modules.
- Slow database queries.
- An overloaded server or a temporary incident.
- External APIs that do not respond.
- Scheduled tasks that consume resources.
- Attacks, bots or excessive traffic.
- Proxy, CDN or external cache configuration.
How to fix it
1. Check whether it is temporary
Load the website again after a few minutes and test it from another browser or connection.
If the issue disappears on its own, it may have been a temporary load spike.
2. Review whether it affects the whole website or only one section
- If it affects the whole website, review the server, resources, PHP and the database.
- If it affects only the WordPress admin area, a plugin or internal task may be involved.
- If it affects only one page, that page may be running a very heavy query or process.
3. Disable non-essential plugins
In WordPress, many 504 errors are caused by plugins that perform heavy tasks: statistics, backups, security, visual builders, importers or external sync tools.
If you can enter the admin panel, disable non-essential plugins and test again.
If you cannot log in:
- Connect by FTP or open the file manager.
- Go to:
wp-content/plugins/
- Rename the folder of the suspicious plugin.
- Test again.
4. Review resource usage
From the control panel, look for sections such as:
- Resource Usage
- Metrics
- Statistics
Check whether there are spikes in CPU, memory, processes or input and output activity.
5. Review error logs
Logs may reveal PHP errors, slow queries or processes that never finish.
Look for sections such as Error Log. If you see repeated messages about memory, execution times or specific files, that may be the main clue.
6. Optimize the database
A very large database or damaged tables can cause slow responses.
In WordPress, you can:
- remove old revisions
- clear expired transients
- optimize tables
- review plugins that create too many rows
- check for slow queries
Make a backup before optimizing.
7. Review external calls
If your website connects to external APIs, payment gateways, CRM tools, feeds or other third-party services, a failure in those services may cause long waits.
Temporarily disable recent integrations to test.
8. Contact support
If the error appears repeatedly and you cannot find the cause, contact support and provide:
- The affected URL.
- The approximate time.
- Whether it always happens or only intermittently.
- Recent changes.
- Recently installed plugins or modules.
- A screenshot of the error.
Conclusion
The 504 Gateway Timeout error appears when a request takes longer than allowed. It may be caused by the server, a slow website, plugins, the database or external services.
The fix involves reviewing resources, logs, plugins and performance. If the issue continues, support can help determine whether the cause is in the hosting environment or in the application itself.