• I no longer understand why the REST API error 401 {“code”: “rest_forbidden_context”} persists and “haunts” me in Site Health. That damn thing absolutely prevents me from using Blocks to edit pages, posts and viewing the drafts, etc …..

    I’ve already done four … or five ??? : (((re installations of WP (I deleted the whole site, upload the clean WP and then add the old / wpcontent folder to the new installation.
    Previously, I did several exports and recreations of the same DB in MariaDB with different names.

    The last install before posting this was today.
    But I already directly exported with the default WP tool all the contents of the site.
    And then I installed a completely clean and new WP, downloaded from WP org. I had to make several adjustments in addition to installing the theme that I am using (Twenty Eleven).
    And despite the fact that it is a clean installation, with a totally new DB, and that I only imported the existing contents in previous installations. In other words, the core of WP is new and intact.
    HOWEVER the API REST 401 error keeps happening and for my head break I CAN’T EDIT ANYTHING.
    Any new ideas ?? ‘ Because I already did everything recommended in various sites: add a rewrite to the .htaccess (which is useless because the .htaccess is also discontinued), delete the browser caches, deactivate plugins, etc etc etc
    Nothing works.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    What is the message that is returned with the error code? The issue is likely an authentication problem with API requests, which is normally cookie authentication. Either the auth cookie was not sent or it was malformed along the way. Re-doing WP installations will not help with cookie issues external to WP.

    What do you mean by “.htaccess is also discontinued”? Your trouble could be related to server configuration and not WP itself.

    Not a solution, but a workaround if you need to edit something while trying to resolve this, try the classic editor plugin which is much less reliant on the API.

Viewing 1 replies (of 1 total)
  • The topic ‘REST API error 401 drives me crazy’ is closed to new replies.