How to Fix the 504 Gateway Timeout Error in WordPress (UK Guide 2026)

17 August 2026

Fix the 504 Gateway Timeout error on your WordPress site in the UK. Learn causes, step-by-step solutions, and how to prevent it in 2026.

What Does a 504 Gateway Timeout Error Mean?

A 504 Gateway Timeout error occurs when one server doesn't receive a timely response from another server it's trying to access. For WordPress, this typically involves your web server (like Apache or Nginx) waiting too long for a response from PHP or a database. UK users might also see this if a CDN service like Cloudflare is in the chain. It's a server-side issue, not something caused by your visitors' browsers. The error can be temporary, but if it appears frequently, it's a sign that your WordPress site needs technical attention to keep your UK visitors happy and avoid losing sales.

Top Causes of 504 Errors in WordPress

Common culprits include long-running PHP scripts—especially during plugin updates, imports, or heavy cron jobs. Outdated or poorly coded plugins can also cause the server to time out. Another trigger is exceeding server resource limits like max_execution_time or memory_limit, particularly on shared hosting plans popular in the UK. External services such as payment gateways or slow API calls can also contribute. Finally, if your web server is misconfigured or your site receives a sudden traffic spike, the queue of requests can delay a response. Knowing the root cause is essential to applying the right fix and avoiding downtime for your UK audience.

Step-by-Step Solutions to Fix 504 Gateway Timeout

Start by refreshing the page—sometimes the timeout is transient. If it persists, log into your WordPress admin (if possible) and deactivate all plugins, then reactivate them one by one to find the culprit. Next, increase PHP execution limits: add `set_time_limit(300)` to your wp-config.php or edit php.ini. Also, clear your site cache and any caching plugin's cache. If you're using a reverse proxy like Varnish or Cloudflare, check their timeout settings. For a more permanent fix, optimise your database using a plugin or via phpMyAdmin on your UK hosting account. Always have a recent backup before making changes.

UK Hosting Considerations: When to Upgrade

Many UK-specific hosts, such as 123 Reg, Fasthosts, and Krystal, offer support for 504 errors, but the fix often depends on your hosting plan. On shared hosting, resource limits are tight, so a timeout is more likely if your site grows. If your WordPress site regularly hits 504 errors during traffic peaks or after installing resource-heavy plugins, it might be time to upgrade to a VPS or dedicated server. UK hosts also provide status pages and support teams who can check server logs for you. Look for hosts with UK-based data centres and 24/7 support to minimise response times.

Preventing 504 Errors in the Future

To reduce the chance of future timeouts, keep your WordPress core, themes, and plugins up to date. Use a reliable caching plugin and consider a content delivery network (CDN) to offload static content. Monitor your site’s performance with tools that alert you to latency spikes. Optimise images and database tables, and schedule heavy tasks like cron jobs at off-peak times. If your site has long-running processes, consider offloading them to a queue system. Finally, choose a UK hosting provider that offers appropriate PHP limits and scalable resources. Proactive maintenance will help your UK site stay fast and reliable.

FAQ

It can last from a few seconds to a few minutes, depending on the cause. If it's a temporary overload or a slow script, the error may disappear once the request is processed. However, if the underlying issue is not resolved, it can keep occurring. Check your server logs or contact your UK host to understand whether it's a recurring problem.

Latest guides