WordPress REST API Returns 401/403 and Rank Math SEO Menu Is Missing

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 REST API results you’re seeing are probably not the cause. Our article on Site Health warnings says our security system blocks WordPress’s requests to itself, and that this triggers the “REST API encountered an unexpected result” warning. It also says the REST API works normally for visitors.

The article is here:

The 401 on /wp-json/wp/v2/types/post?context=edit is also what WordPress normally returns when you open that URL directly in the browser. context=edit needs a logged-in session plus a nonce, which a plain address-bar request doesn’t send. Another InfinityFree user on a recent topic got the same 401 on that endpoint and called it expected. So I wouldn’t treat it as a sign that a hosting rule is blocking your admin.

I couldn’t find anything that explains a missing Rank Math menu, so I need two details:

  • What is the full address in your browser’s address bar when “Sorry, you are not allowed to access this page” appears? It will be something like wp-admin/admin.php?page=....
  • Did this site come from a migration or backup restore, or did you change the database table prefix at any point? Or did the Rank Math menu never appear after a fresh install?

Does any other plugin’s admin menu give the same message, or only Rank Math? That would show whether the problem is with the plugin or with your user’s permissions.