Skip to main content
Glama

Delete a post or page

wp_delete_post
Destructive

Deletes a post, page, or custom post type entry, moving it to trash by default; use force=true for permanent removal.

Instructions

Delete a post, page or entry of any post type: into the trash by default, for good with force=true. Trashing also hides its comments; a trashed entry comes back when wp_update_post gives it a status. An entry already in the trash, a media file, and any entry on a site without a trash are refused without force=true, so a repeated call does not delete for good by itself. Deleting for good also removes its revisions, comments, custom fields and term assignments and cannot be undone. Needs the right to delete the entry. Returns {deleted: true, permanent, id}; an unknown id returns a not-found error. Media files are deleted with wp_delete_media.

Input Schema

NameRequiredDescriptionDefault
idYesId of the post, page or entry to delete.
forceNotrue deletes for good instead of trashing. Default false.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.7.0

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Despite annotations already declaring destructiveHint=true and idempotentHint=false, the description adds substantial behavioral detail: permanent deletion removes revisions, comments, custom fields, and term assignments, cannot be undone, and requires the right permission. It also explains trash behavior, comment hiding, refusal cases, and repeat-call safety, going well beyond the structured annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core delete/trash distinction and force behavior. It is dense and information-rich, but not bloated; most clauses carry useful edge-case or safety information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive mutation with no output schema, the description is highly complete: it covers permissions, trash vs permanent behavior, irreversible side effects, refused cases, restore path, return shape, not-found error, and the media deletion alternative.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both id and force. The description clarifies the practical consequence of force=true but largely repeats the schema's existing parameter meaning, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb+resource: delete a post, page, or entry of any post type. It explicitly distinguishes media deletion via wp_delete_media, so the agent can tell it apart from the sibling media tool without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It clearly explains the default trash behavior, when force=true is required, and which cases are refused without force. It also names wp_update_post as the restore path and wp_delete_media as the alternative for media files, giving explicit when/when-not/alternatives guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools