How to Fix curl Error 28 (Operation Timed Out)
A phase-by-phase reading of the message, three ranked fixes and WordPress steps that need no terminal.
Updated
TL;DR
curl error 28 (CURLE_OPERATION_TIMEDOUT) means curl, or a program built on libcurl such as PHP or WordPress, stopped waiting because one of its time limits ran out. Find which phase stalled, then raise that limit or fix the slow DNS, server or proxy behind it.
What curl error 28 looks like
Captured with macOS's bundled curl on local test servers. Releases since late 2024 print the Connection timed out row where the two Older curl rows appear. The WordPress row is built from WordPress source.
| Where | What you see |
|---|---|
| curl, --max-time reached with no reply from the server | curl: (28) Operation timed out after 3003 milliseconds with 0 bytes received |
| curl, time ran out while still connecting | curl: (28) Connection timed out after 3011 milliseconds |
| Older curl, --connect-timeout reached with no TCP answer | curl: (28) Failed to connect to 127.0.0.2 port 48977 after 2002 ms: Timeout was reached |
| curl, DNS lookup unfinished at the limit | curl: (28) Resolving timed out after 2011 milliseconds |
| curl, --speed-limit 100 with --speed-time 3 | curl: (28) Operation too slow. Less than 100 bytes/sec transferred the last 3 seconds |
| Older curl, HTTP proxy never answers CONNECT | curl: (28) Proxy CONNECT aborted due to timeout |
| WordPress Site Health, loopback test | Error: cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received (http_request_failed) |
Why this happens
curl times each request, and yours was not finished when the time ran out.
The limit comes from your command, the program calling libcurl or the operating system, and one code covers a slow DNS lookup, an unanswered connection and a stalled download.
Diagnose your curl error 28 first
The text after (28) hints at the phase; these checks confirm it.
Load the URL in a web browser on the same computer; if the page hangs there too, the site or network is slow, not curl.
Read the words after (28); Resolving means DNS, Connection or Failed to connect means connecting never finished, and Operation means the stall came after connecting.
Rerun with -v; an error right after Trying means the TCP connection got no answer, and a Client hello without a reply means TLS stalled.
Add -w '%{time_namelookup} %{time_starttransfer}'; if the first prints 0.000000, DNS never finished, and a second above zero means the download had started.
For an https:// URL through a proxy, add -w '%{http_connect}'; 000 means the proxy sent no CONNECT reply, and 200 means the tunnel opened first.
Solutions ranked by effectiveness
Start with the limit itself, then the WordPress case, then the proxy route.
- Most common fix
Set limits that fit each phase
Applies when the same request succeeds once it gets more time. Keep connecting on a short limit, give the whole request a longer one, and judge large downloads by speed.
# Whole request: 10 s to connect, 60 s in total curl --connect-timeout 10 --max-time 60 https://example.com/ # Large download: no total limit, stop if under 1000 bytes/s for 30 s curl --connect-timeout 10 --speed-limit 1000 --speed-time 30 \ -O https://example.com/file.zip - Site owners
Find what stalls WordPress requests
Applies when the error shows up in the WordPress dashboard or a plugin's log. WordPress waits 5 seconds by default, 10 in Site Health tests, for each request it sends.
Open Tools > Site Health; the Status tab names the test that failed.
On Plugins > Installed Plugins, deactivate plugins one by one until the timeout stops.
Loopback or REST API test failing: ask your host why the site cannot reach itself.
Outside requests failing: ask whether wp-config.php sets WP_PROXY_HOST, a proxy for outgoing requests.
- For developers
Fix the proxy leg that stalled
Applies when the timeout appears only with -x. Either leg can stall, yours to the proxy or the proxy's to the site, and the URL scheme decides which limit covers the second.
Verbose output ends at Trying with the proxy's address: recheck its host and port.
https:// URL: raise --connect-timeout, which also covers the proxy's CONNECT step.
http:// URL: raise --max-time, because the proxy's hop to the site counts there.
Tunnel opens but the site stalls: test it without -x before blaming the proxy.
Stop the curl error 28 from coming back
Settings worth making permanent once the request works again.
Put --max-time, or CURLOPT_TIMEOUT in PHP, on every scripted call; the default of 0 means no overall limit.
Add --retry with a small count to unattended jobs; curl treats a timeout as transient and doubles each wait.
In WordPress code, pass a timeout argument to wp_remote_get() for the one slow API you call.
Set both speed options: --speed-limit alone checks over 30 seconds, and --speed-time alone uses a 1 byte per second floor.
Related errors
Learn more
FAQ
Run curl jobs side by side
Geonode's docs list no fixed thread cap for residential proxies.


