Remove Category from Post


Removes a category from a post. Other categories on the post are kept. If the removed category was the only one, the post falls back to the default category (WordPress requires every post to have at least one).

Property Value
Ability slug mosmcp/post-remove-category
Wire tool name mosmcp__post-remove-category
Category Posts (mosmcp-posts)
Plan Free

 

Required access

Requirement Value
Capability edit_post (checked against the specific post)
Minimum default role Contributor
Annotations readOnly: false · destructive: false · idempotent: true · openWorld: true

 

Input schema

Field Type Required Default Description
id integer (min 1) Yes — The ID of the post.
category_id integer (min 1) Yes — The ID of the category to remove.

 

Output schema

Field Type Required
id integer Yes
title string Yes
categories string[] Yes

 

Example

Sample prompt
Take post 42 out of the 'News' category (category 5).

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 20,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__post-remove-category",
    "arguments": {
      "input": {
        "id": 42,
        "category_id": 5
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 20,
  "result": {
    "isError": false,
    "structuredContent": {
      "id": 42,
      "title": "Pumpkin Soup",
      "categories": [
        "Recipes"
      ]
    }
  }
}

 

Edge cases / errors

  • category_id that does not exist → category_not_found.
  • Post not in that category → refused with category_not_on_post.
  • Removing the post's only category → it falls back to the site's default category.

 


<< Previous Next >>
Publish Post Remove Tag from Post

For more information about the Secure MCP Server for WordPress plugin, explore the following resources:

Product Overview | Pricing | Try for Free | Documentation

If you have any questions regarding plugin configuration, pricing plans or licensing, please contact us or mail us at aisupport@xecurify.com.