WordPress REST API returns 403 and loopback request fails

Website URL

https://housezonic.great-site.net/

Error Message

Hello InfinityFree Support,

My WordPress website is https://housezonic.great-site.net/

WordPress Site Health reports the following issues:

  1. REST API endpoint https://housezonic.great-site.net/wp-json/wp/v2/types/post?context=edit returns 403 Forbidden.
  2. WordPress cannot complete a loopback request.
  3. A scheduled event has failed, and WooCommerce Action Scheduler shows past-due actions.

The public REST API endpoint https://housezonic.great-site.net/wp-json/ works and displays JSON.

I temporarily deactivated Loginizer and W3 Total Cache for testing, but the REST API warning remained. I have since updated W3 Total Cache to version 2.11.0.

Could you please check whether a server security rule or hosting restriction is blocking WordPress REST API requests or loopback requests?

Thank you.

Other Information

The earlier 502 Bad Gateway error has resolved, and both my website and WordPress dashboard are opening again.

The remaining issues are:

  • WordPress Site Health reports that the REST API endpoint with context=edit returns 403 Forbidden.
  • WordPress cannot complete a loopback request.
  • A scheduled event has failed, and WooCommerce Action Scheduler shows past-due actions.

The public REST API endpoint /wp-json/ works and displays JSON.

I updated W3 Total Cache to version 2.11.0, but the REST API and loopback warnings remain.

Could you please investigate whether a hosting restriction is causing these remaining issues?

Welcome to the InfinityFree community forum! Good to have you here.

  • Most people answering here are volunteers. They’re often the fastest source of help. Admin (the only staff member) checks in about once a day for issues on our end.
  • Volunteers can’t see your account or website. Share what you actually see, like error messages and what happens when you try something. That’s more useful than your theory of what’s wrong.
  • AI tools often get InfinityFree wrong. If a volunteer’s advice differs from what an AI told you, please try the volunteer’s suggestion first.
  • Solving an issue is a joint effort. Try the suggestions you get and report back what happened.

Beep boop, I’m a bot! I dug through the forum to get you started. I sometimes get things wrong though, so do with this what you will until a human has a look.

The 403 on the REST API test and the failed loopback request are expected on our hosting. They aren’t caused by a rule aimed at your site. Our security system blocks requests that WordPress sends to itself, because it only lets through visitors using a real web browser. Site Health runs the ?context=edit check as one of those requests, so it gets a 403. The REST API works normally for your visitors, and your working /wp-json/ is consistent with that. Loginizer and W3 Total Cache weren’t the cause, which fits what you saw.

The failed scheduled event and the past-due WooCommerce Action Scheduler actions come from the same limit, and you do need to fix them. WP-Cron triggers tasks by sending a request to your own site, and that request is blocked. The fix is to add this line to wp-config.php, above the line that says /* That's all, stop editing! */:

define('ALTERNATE_WP_CRON', true);

With it, WordPress runs scheduled tasks during a visitor’s own page load instead of through a separate request. Tasks still only run when someone visits the site, so on a low-traffic site they will run late. External cron services don’t work either, because they’re blocked too.

This article covers all three warnings, including which ones to ignore:

Once you’ve added the line, do the past-due actions start clearing after a few page loads?