admin管理员组

文章数量:1327524

I am attempting to remove/hide a post via the REST API and having issues.

Currently, I have tried sending the payload as:

{
    'status':'private'
}

And I send the request to:

/wp/v2/posts/<id here>

Every other part of my requirements works. I am able to create a post and update post content, but now I want to remove a post without deleting it, but it doesn't seem like I can update the status. I remembered reading that the payload needs to include title, content, and excerpt, so I tried another request with those and that didn't work either.

I suppose I could fully delete the post if I need to, but this would work better for my needs. Does anyone know how to accomplish this or what I'm doing wrong?

本文标签: Updating post status via rest api