Fixing the 'Loopback Request Failed' Error in WordPress Site Health

intermediate📝 WordPress2026-06-14| WordPress 5.x/6.x, Ubuntu/Debian, Nginx/Apache, PHP-FPM

Error Message

The loopback request to your site failed, this means features relying on them are not currently working as expected.
#site-health#loopback#rest-api#wordpress-diagnostic

What’s actually happening?You open your WordPress Site Health dashboard expecting a sea of green, but instead, a critical error stares back at you: The loopback request to your site failed.

It’s not just a nagging notification. Think of a loopback request as WordPress calling its own phone number to check if the line works. When this fails, the consequences are immediate. Your scheduled posts might sit in "Scheduled" status forever. The Block Editor (Gutenberg) might freeze when you hit save. Even the REST API, the backbone of modern WordPress, will essentially be paralyzed.

Step 1: Diagnose with cURLBefore you start digging through WordPress settings, verify if your server can physically reach itself. Access your server via SSH and run a cURL command against your own API endpoint. Use the -I flag to see only the headers.

# Replace yourdomain.com with your actual site URL
curl -I https://yourdomain.com/wp-json/

Watch the output closely. If you see a 403 Forbidden or 500 Internal Server Error, your server is actively blocking itself. If you see curl: (60) SSL certificate problem, your server doesn’t trust its own security certificate—a common issue after migrating to a new VPS.

Step 2: Check the /etc/hosts FileMany VPS providers like DigitalOcean or AWS Lightsail don't automatically configure "hairpin NAT." This means the server tries to look up its own domain via public DNS, gets its own public IP, and then fails to connect to itself. You can bypass this by mapping the domain locally.

sudo nano /etc/hosts

Add a line that forces the server to look at its local interface (127.0.0.1) for your domain:

127.0.0.1 yourdomain.com www.yourdomain.com

Save and exit (Ctrl+O, Enter, Ctrl+X). Run the cURL command from Step 1 again. If it now returns a 200 OK, you've solved the routing conflict.

Step 3: Resolve SSL Certificate TrustWordPress uses the PHP cURL library for loopback calls. Even if your browser shows a green padlock, the server-side PHP might fail if your CA (Certificate Authority) bundle is ancient or your certificate is self-signed.

If you’re using Let's Encrypt, ensure your certificates aren't just valid, but properly installed in the chain. You can refresh your server’s trust store with a single command:

# For Ubuntu or Debian systems
sudo apt-get update
sudo apt-get install --only-upgrade ca-certificates

Avoid the temptation to use plugins that "disable SSL verification." That's like fixing a 'check engine' light by putting tape over it—it hides the problem but leaves your server vulnerable.

Step 4: Bypass Basic AuthenticationAre you testing on a staging site protected by a password (Basic Auth)? WordPress isn't smart enough to know your credentials. When it tries to ping the REST API, it hits your login prompt and receives a 401 Unauthorized error.

You need to tell your web server that requests coming from the server itself don't need a password. For Nginx:

location / {
    satisfy any;
    allow 127.0.0.1;
    allow 192.168.1.100; # Replace with your actual Server IP
    auth_basic "Restricted";
    auth_basic_user_file /etc/nginx/.htpasswd;
}

Step 5: Inspect Firewalls and Security PluginsSecurity tools often mistake frequent loopback requests for a DDoS attack or a bot scrape. Since WordPress can trigger dozens of these requests in a few seconds, you might be getting rate-limited by your own software.

- **Wordfence:** Switch the Firewall to 'Learning Mode' temporarily. If the error disappears, Wordfence was blocking 127.0.0.1.
- **Cloudflare:** If you use the Orange Cloud, ensure your server's IP is whitelisted in the Cloudflare Dashboard under 'Security > WAF > IP Access Rules.'
- **Fail2Ban:** Check if your server has accidentally jailed itself: `sudo fail2ban-client status nginx-http-auth`.

Step 6: The WP-CLI Conflict TestIf the server logs look clean but the error persists, a plugin is likely interfering with the http_request_args filter. Instead of clicking through the UI, use WP-CLI to diagnose this in seconds.

# Deactivate everything at once
wp plugin deactivate --all

# Check Site Health. If it passes, reactivate your plugins one by one.

VerificationHead back to Tools → Site Health. That critical error should now be gone. To be 100% sure your background tasks are back on track, check your cron schedule:

wp cron event list --format=table

If the 'Next Run' column shows times in the future rather than the past, your loopback requests are officially healthy.

Quick Tips

- Always peek at `/var/log/nginx/error.log` or the Apache equivalent. The logs never lie about why a connection was dropped.
- If you use Docker, ensure your WordPress container can talk to the Nginx container over the internal bridge network.
- Don't settle for a green checkmark if the underlying features like WP-Cron are still failing. Functionality matters more than the dashboard status.

Related Error Notes