Subtle diagonal pinstripe pattern in light grey and cream, giving an impression of printed editorial paper

Fixing connection timed out errors in WordPress REST API calls

The WordPress REST API supports the block editor, admin widgets, WooCommerce data and many third-party integrations. A client waiting for a response can report a timeout without revealing which layer failed. DNS, TLS, a firewall, PHP, a reverse proxy or a content delivery network may all produce similar wording, yet each requires a different remedy.

Treat the failure as a trace rather than a single configuration problem. Establish whether the request reaches WordPress, measure each stage and inspect the origin logs. This avoids the common mistake of extending every timeout until requests begin exhausting server resources.

Confirm where the request stops

Start with an unauthenticated request from the affected computer and another from the server. Run a timed request against the REST index and record where the delay occurs:

curl -sS -o /dev/null -D - \
  --connect-timeout 10 --max-time 30 \
  -w 'dns=%{time_namelookup}s connect=%{time_connect}s tls=%{time_appconnect}s first_byte=%{time_starttransfer}s total=%{time_total}s\n' \
  https://shop.example.com.au/wp-json/

A connection timeout points towards routing, DNS or firewall behaviour. If headers arrive but the body stalls, the origin or an intermediary is taking too long. Compare /wp-json/ with the exact failing endpoint, such as /wp-json/wc/v3/orders. An immediate 404 is a rewrite or route problem, while 401 or 403 identifies authentication or permissions; neither should be treated as a network timeout.

Record the UTC time, client address, endpoint, response status and total duration. Repeat the request through the browser, a command-line client and, where possible, a second network. WordPress-specific references such as these WordPress troubleshooting guides can help distinguish a core routing issue from a plugin or hosting problem.

Separate WordPress issues from infrastructure failures

Check that the WordPress address and site address agree, permalinks are valid and HTTPS works on both the site and wp-admin. Some hosts expose WordPress through a reverse proxy, while others restrict direct access to /wp-json/. The alternative /?rest_route=/ route can confirm whether rewriting is responsible. A browser mixed-content warning should also be fixed because authenticated REST requests can be blocked before they complete.

Authentication can complicate the diagnosis. Browser requests normally require a valid X-WP-Nonce, while external integrations may use Application Passwords, OAuth or WooCommerce API credentials. Avoid placing reusable secrets in shell history or support tickets. If an unauthenticated endpoint works, focus on the authentication plugin, user permissions and security rules associated with the account.

Plugin conflicts deserve careful isolation in staging. Security plugins may rate-limit REST requests, caching layers may delay responses, and custom hooks registered on rest_pre_dispatch or rest_authentication_errors may alter endpoint behaviour. Australian retail and B2B conventions—AUD pricing, GST-inclusive totals, ABN details and domestic shipping zones—are often implemented through custom WooCommerce code. A live freight, ERP or payment callback can therefore stall an otherwise healthy API route.

Check DNS, IPv6 and regional routing

Resolve the domain from the affected network and compare the result with the hosting dashboard. Testing both IP versions can expose an incomplete or unreachable IPv6 configuration:

curl -4 --max-time 20 https://shop.example.com.au/wp-json/
curl -6 --max-time 20 https://shop.example.com.au/wp-json/

Use dig, traceroute or mtr to locate a persistent failure. If IPv4 succeeds while IPv6 times out, correct the address records or routing rather than changing WordPress. Also check the TLS certificate chain and hostname, because an incomplete certificate chain can appear as a stalled connection in some clients.

Australian network paths vary by location and provider. Sydney and Melbourne contain major cloud regions and extensive peering options, while Perth, Adelaide and Brisbane may reach the same origin through longer routes. Telstra, Optus and regional broadband networks can also route traffic differently, so a working request from one Australian connection does not guarantee success from another. Hosting the origin near the main customer base reduces latency, although application and upstream limits still need investigation.

Firewalls, web application firewalls and CDNs sit between many Australian WordPress sites and their visitors. A CDN bot challenge is especially unsuitable for an API client because it cannot complete an interactive JavaScript challenge. Review rate limits, geographic blocks and security groups for the REST path. Keep credentials and API keys out of public support forums, and avoid broadly disabling a firewall when a narrower endpoint exception will solve the problem.

Align PHP, proxy and application timeouts

A timeout may be enforced by several independent timers. PHP uses max_execution_time and max_input_time; PHP-FPM can use request_terminate_timeout and slow-request logging; Nginx applies proxy_read_timeout; and Apache may use ProxyTimeout. A CDN can add another limit, with messages such as 524 indicating that the origin accepted the connection but did not respond in time.

Do not increase every value indiscriminately. Identify the earliest timer that fires and align the remaining budgets so the client has the longest allowance, followed by the proxy and then the application. Raising only the outer client timeout leaves the request being terminated at the same point. A reasonable ceiling is still important, particularly on shared hosting plans with fixed resource allocations.

Slow database work is a frequent underlying cause. Inspect WordPress debug logs, PHP-FPM slow logs, the web-server access log and MySQL slow-query output. WooCommerce reporting endpoints, large product exports and orders with extensive metadata can require pagination, better indexes or a background job rather than a longer timeout. WordPress cron and WooCommerce Action Scheduler may also run during a request; scheduled work can be tested with wp cron test and triggered deliberately with wp cron event run --due-now.

A timer only helps when the process it supervises is allowed to finish. This timer configuration guide illustrates the importance of aligning timer and process lifetimes. The same principle applies to FPM workers: measure a real slow request, improve the operation where possible, then set a defensive limit slightly above its expected duration.

Verify the repair under realistic conditions

Reproduce the failure on staging before altering production values. Preserve the original endpoint, authentication method, client IP and request payload, then compare results before and after each change. Check both response time and server resource use; a higher timeout that consumes all available workers is not a successful repair.

For Australian administrators, verify scheduled jobs during both Australian Eastern Standard Time and Australian Eastern Daylight Time. WordPress and PHP should consistently use UTC internally, while cron schedules and log correlation require explicit conversion. Australian Eastern Standard Time is UTC+10 and Australian Eastern Daylight Time is UTC+11, so an unqualified assumption about the server offset can leave jobs an hour late.

Test from multiple Australian locations and from any overseas system used by the integration. A lightweight synthetic check can call a harmless endpoint and alert when latency or failures exceed a threshold. Review PHP, application and proxy logs together, and confirm that object caches or a CDN have not retained a stale error. Australian stores should also check where logs, backups and support dashboards store customer data, particularly when a managed provider routes operational information offshore.

Build a repeatable timeout response plan

The fastest response comes from a fixed sequence that separates client, network, WordPress and server evidence. Use the following operating checklist:

Compare the observed symptom with the likely layer before changing configuration. This keeps the investigation focused while providing a durable correction for the affected route.

Symptom Likely layer First check Durable correction
Every REST request times out DNS, firewall or origin Compare DNS output and timed connections Correct routing, security rules or IPv6 configuration
The index works but one route fails Plugin, hook or slow query Inspect debug and slow-request logs Optimise the route, pagination or scheduled work
Authentication requests fail Security plugin or permissions Review nonce, credentials and access rules Correct authentication and narrowly adjust rate limits
IPv4 works but IPv6 fails IPv6 routing Test both IP versions Repair IPv6 records, routes or host networking
A CDN reports an origin timeout PHP, proxy or database Match the request to origin logs Optimise execution and align proxy and FPM limits
The endpoint is slow under load Resource saturation Review workers, queries and cache health Add capacity, indexing, caching or asynchronous processing