Restore Page from Trash


Restores a page from the trash back to its previous status.

Property Value
Ability slug mosmcp/page-restore
Wire tool name mosmcp__page-restore
Category Pages (mosmcp-pages)
Plan Free

 

Required access

Requirement Value
Capability delete_page (checked against the specific page)
Minimum default role Editor
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 page to restore.

 

Output schema

Field Type Required
id integer Yes
title string Yes
new_status string Yes
edit_url string

 

Example

Sample prompt
Bring back the 'Spring Promo' page I trashed yesterday.

Example request (json)

{
  "jsonrpc": "2.0",
  "id": 47,
  "method": "tools/call",
  "params": {
    "name": "mosmcp__page-restore",
    "arguments": {
      "input": {
        "id": 42
      }
    }
  }
}

Example response (json)

{
  "jsonrpc": "2.0",
  "id": 47,
  "result": {
    "isError": false,
    "structuredContent": {
      "id": 42,
      "title": "Spring Promo",
      "new_status": "draft",
      "edit_url": "https://example.com/wp-admin/post.php?post=42&action=edit"
    }
  }
}

 

Edge cases / errors

  • The page is not in the trash → refused with not_in_trash.
  • id is not a page (including one already permanently deleted) → refused with page_not_found.
  • WordPress fails to untrash it → restore_failed.
  • The resulting status is whatever WordPress restores (since WordPress 5.6 this is usually draft), reported in new_status.

 


<< Previous Next >>
Publish Page Schedule Page

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.