Restore Post from Trash
Restores a post from the trash back to its previous status.
| Property | Value |
|---|---|
| Ability slug | mosmcp/post-restore |
| Wire tool name | mosmcp__post-restore |
| Category | Posts (mosmcp-posts) |
| Plan | Free |
Required access
| Requirement | Value |
|---|---|
| Capability | delete_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 trashed post to restore. |
Output schema
| Field | Type | Required |
|---|---|---|
| id | integer | Yes |
| title | string | Yes |
| new_status | string | Yes |
| edit_url | string |
Example
Sample prompt
Restore post 42 from the trash.
Example request (json)
{
"jsonrpc": "2.0",
"id": 22,
"method": "tools/call",
"params": {
"name": "mosmcp__post-restore",
"arguments": {
"input": {
"id": 42
}
}
}
}Example response (json)
{
"jsonrpc": "2.0",
"id": 22,
"result": {
"isError": false,
"structuredContent": {
"id": 42,
"title": "Old Announcement",
"new_status": "draft",
"edit_url": "https://example.com/wp-admin/post.php?post=42&action=edit"
}
}
}
Edge cases / errors
- Post not in the trash → refused with not_in_trash.
- WordPress fails to untrash it → restore_failed.
- The post returns to the status WordPress records for it at trash time; on current WordPress versions that is usually draft, so re-publish it if needed.
| << Previous | Next >> |
|---|---|
| Remove Tag from Post | Schedule 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.