Home/Blog/How to Fix WordPress REST API & Loopback Request Errors

How to Fix WordPress REST API & Loopback Request Errors

WordPress REST API loopback error fix guide

Open Tools โ†’ Site Health and you may find two red warnings: “The REST API encountered an error” and “Your site could not complete a loopback request.” Your site looks fine to visitors โ€” but scheduled posts, background updates, and many plugin features quietly stop working. This WordPress REST API loopback error fix guide explains what these checks mean, why the server fails to “call itself”, and six steps to restore healthy loopback and REST API responses.

What Causes REST API / Loopback Errors

WordPress constantly makes HTTP requests to itself โ€” to run scheduled tasks (wp-cron), to let the block editor save via the REST API, and to let plugins communicate in the background. Site Health tests this by POSTing to wp-cron.php and requesting /wp-json/. When those self-requests fail, you get these warnings. The usual causes:

  • Firewall or WAF blocking the server’s own requests: server firewalls, Cloudflare WAF rules, Sucuri, or security plugins (Wordfence) blocking outbound/loopback traffic.
  • DNS not resolving on the server: the server can’t resolve its own domain name, so the request to itself never connects.
  • Basic Auth / password protection: if the site is behind HTTP Basic Auth (staging protection), WordPress doesn’t know the credentials, and the internal request gets a 401 rejection.
  • Maintenance mode stuck on: a leftover .maintenance file or a maintenance-mode plugin answers every request โ€” including loopback ones โ€” with the wrong response.
  • Plugin conflict: a broken plugin intercepting REST API requests or admin-ajax.php calls.
  • SSL verification issues: self-signed or misconfigured certificates making the server’s HTTPS request to itself fail verification; also cURL timeouts (error 28) on slow servers. More Site Health guides live on the KamiWeb blog.

How to Fix REST API / Loopback Errors

Start by reading the exact error code in Site Health โ€” it tells you which layer is broken: a cURL error 28 means timeout, 401 means authentication, and an unexpected status code points at maintenance mode or a bad response. Then work through these fixes, keeping our free web tools handy.

WordPress site health monitoring dashboard concept

  1. Deactivate plugins to find the blocker. Deactivate all plugins and re-check Site Health. If the warnings clear, reactivate one by one until they return. Security, firewall, and maintenance-mode plugins are the usual suspects โ€” configure them to allow /wp-json/, wp-cron.php, and admin-ajax.php instead of leaving them off.
  2. Check for stuck maintenance mode. Look for a .maintenance file in your site root (enable “show hidden files”) and delete it if an update left it behind. Also disable any maintenance-mode plugin temporarily โ€” they answer loopback requests with a maintenance page instead of a proper response.
  3. Verify your site URL and DNS. Go to Settings โ†’ General and confirm the WordPress and Site addresses are exactly right. If the loopback still fails, your server may not resolve its own domain โ€” ask your host to check the server’s DNS configuration, or add a hosts entry mapping your domain to the server IP.
  4. Fix firewall and Basic Auth blocks. Ask your host to whitelist loopback traffic and check ModSecurity rules. If the site sits behind HTTP Basic Auth, temporarily disable it to confirm it’s the cause; for a permanent setup, allowlist the loopback endpoints (wp-cron.php, admin-ajax.php, /wp-json/) in your auth rules, or move scheduled jobs to a server cron running WP-CLI (define('DISABLE_WP_CRON', true); plus a system cron hitting wp-cron.php).
  5. Check SSL and server resources. Ensure your SSL certificate is valid and that local SSL verification passes. Raise PHP memory (256M+) and max_execution_time, and make sure cURL/OpenSSL are current โ€” slow, overloaded servers produce the cURL timeout variant of this error. Confirm your exact software versions in Site Health โ†’ Info โ†’ Server.
  6. Contact your host with the details. If nothing above clears it, the block is server-side: DNS, outbound firewall rules, or entry-process limits. Send your host the exact Site Health error message, your WordPress and PHP versions, and your active plugin list โ€” that’s everything they need to fix it. Browse KamiWeb’s plugin resources for monitoring tools.

Conclusion

The WordPress REST API loopback error fix is about letting your server talk to itself again: clear plugin/firewall blocks, remove stuck maintenance mode, fix DNS and URL mismatches, handle Basic Auth, and rule out SSL and resource issues. Once Site Health reports both checks as good, scheduled posts, background updates, and API-driven features all work again. More fixes at KamiWeb.