ERR_CONNECTION_TIMED_OUT
HTTP 504

ERR_CONNECTION_TIMED_OUT

Elena Rodriguez ·

Symptoms

You click a link to your WordPress site and… Nothing. The browser spins for 30 seconds, then throws ERR_CONNECTION_TIMED_OUT. Your server is technically alive, but it’s refusing to respond in time. This usually means something between your browser and your server is choking — and the fix depends on which layer is the bottleneck.

What Causes ERR_CONNECTION_TIMED_OUT?

  1. Server resource exhaustion — Your PHP workers are maxed out, typically from a heavy plugin, a traffic spike, or a slow database query that won’t release its connection.
  2. DNS resolution failure — Your domain’s DNS records are misconfigured, propagating, or your DNS provider is having an outage. The browser literally can’t find your server.
  3. Firewall or security plugin blocking requestsWordfence, Sucuri’s firewall, or your host’s WAF is rate-limiting or outright blocking legitimate traffic, including your own IP.
  4. PHP memory or execution time limits — WordPress runs out of memory or hits the max_execution_time ceiling mid-request, causing the connection to hang until the server kills it.
  5. Overloaded or misconfigured proxy/CDN — Cloudflare, Sucuri, or your reverse proxy is timing out before your origin server finishes responding.

How to Fix It

Step 1: Rule Out Your Local Network

Before touching your server, confirm the problem isn’t on your end. Flush your local DNS cache and try loading the site from a different network (use your phone’s cellular data).

# macOS
sudo dscacheutil -flushcache && sudo killall -HUP mDNSResponder

# Windows
ipconfig /flushdns

# Linux
sudo systemd-resolve --flush-caches

Then check if the site is down for everyone or just you at downforeveryoneorjustme.com. If it loads fine elsewhere, the issue is your ISP, VPN, or local DNS. Switch to 1.1.1.1 or 8.8.8.8 as your DNS resolver and move on with your life.

Step 2: Increase PHP Memory and Execution Time

The right way to do this — edit wp-config.php directly, not through some plugin settings page. SSH or FTP into your site and add these lines above the /* That's all, stop editing! */ comment:

define('WP_MEMORY_LIMIT', '256M');
define('WP_MAX_MEMORY_LIMIT', '512M');

Then bump PHP’s execution time in your .htaccess file (Apache) at the site root:

php_value max_execution_time 300
php_value max_input_time 300

If you’re on Nginx or your host ignores .htaccess overrides, create or edit a php.ini file in your WordPress root:

max_execution_time = 300
max_input_time = 300
memory_limit = 256M

Reload the site. If the timeout disappears, you’ve been running on too-tight limits. Talk to your host about upgrading your plan — patching config values is a band-aid.

Step 3: Deactivate All Plugins via WP-CLI or FTP

A misbehaving plugin is the single most common cause of server-side timeouts. If you can still access SSH:

wp plugin deactivate --all --path=/var/www/html

If you’re locked out of SSH and WP-CLI, rename the plugins folder via FTP:

/wp-content/plugins/ → /wp-content/plugins-disabled/

Load the site. If it comes back, rename the folder back and reactivate plugins one by one from the dashboard until you find the culprit. Skip this if you want headaches later — half the timeout tickets I see are people who never isolated the offending plugin and just kept increasing timeouts.

Step 4: Check Your Server Error Logs

Enable WordPress debug logging to catch what’s actually failing. Add this to wp-config.php:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

Then check wp-content/debug.log after triggering the timeout. Also pull your server’s error log:

# Apache
tail -100 /var/log/apache2/error.log

# Nginx
tail -100 /var/log/nginx/error.log

Look for Fatal error, Allowed memory size exhausted, or Maximum execution time exceeded. These tell you exactly what to fix.

Step 5: Verify DNS and CDN Configuration

If you’re behind Cloudflare or another CDN proxy, the timeout may be between Cloudflare and your origin server, not between the user and Cloudflare.

In Cloudflare: go to Speed > Optimization and check your Proxy Read Timeout (Enterprise) or switch to DNS Only mode temporarily (grey cloud the record) to test if the CDN layer is the bottleneck.

For any CDN, confirm your origin server’s IP hasn’t changed. A host migration where you forgot to update the CDN’s origin IP is a classic cause of this error.

Step 6: Contact Your Host

If none of the above resolves it, the problem is likely at the server level — maxed-out PHP workers, a MySQL process lock, or a firewall rule you don’t control. Open a ticket with your host and include:

  • The exact URL that times out
  • Your debug.log output
  • The server error log entries
  • What you’ve already tried

Good hosts like Kinsta or Cloudways will resolve this in minutes because they have direct access to the infrastructure layer you can’t touch from WordPress.

Prevention

  • Use a quality managed host. Shared hosting with 512MB RAM and 2 PHP workers will time out under any real traffic. Kinsta, Cloudways, and WP Engine handle resource scaling so you don’t have to debug this at 2 AM.
  • Audit your plugins quarterly. Deactivate and delete anything you’re not actively using. Every plugin adds PHP execution overhead, and abandoned plugins are ticking time bombs.
  • Set up uptime monitoring. Use UptimeRobot or your host’s built-in monitoring to catch timeouts before your visitors do. A 60-second check interval is fine for most sites.
  • Keep PHP updated. PHP 8.2+ is dramatically faster than 7.x. If your host still defaults to PHP 7.4, that alone could be causing timeouts on pages that would load in 2 seconds on a modern runtime.

Last verified: April 2026