Skip to main content
Glama

Delete a user

wp_delete_user
Destructive

Delete a WordPress user account, optionally reassigning their posts and links to another user. Use it to remove access permanently while preserving content ownership.

Instructions

Delete a user account. With reassign_to, the user's posts and links pass to that user; without it, WordPress deletes the user's links and entries of post types removed with their author (posts and pages among them; these go to the trash where it is on, the rest is deleted). On multisite the account is only removed from this site, its content handled the same way. Needs delete_users and the right to delete this user; the last administrator is refused. An administrator loses that role first and is deleted after; if the deletion fails, the role is given back and the error says whether that worked; if the account was removed and only a plugin's code after it failed, the answer is deleted with a warning. The call is refused (ab_mcp_busy) while another role change or user deletion runs through AlphaBridge; changes made in wp-admin are not part of these checks. Returns deleted and id. The account deletion is permanent; no undo point is recorded.

Input Schema

NameRequiredDescriptionDefault
idYesId of the user to delete.
reassign_toNoId of the user who inherits the deleted user's content: another existing user of this site, else the call is refused and nothing is deleted. Omitted or 0: WordPress deletes or trashes it as described above.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.10.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already flag destructive=true and idempotent=false, but the description goes well beyond them: permanence with no undo point, multisite limiting deletion to the current site, temporary admin-role removal with restoration on failure, partial-failure semantics (deleted + warning), and a concurrency lock with the caveat that wp-admin changes are not covered. This is unusually rich for a destructive operation.

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?

Front-loaded with the action and the reassign branch before edge cases, and nearly every clause carries operational information. It is a dense semicolon-chained paragraph, though, and the plugin-hook failure clause is hard to parse on first read.

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?

With no output schema, the description supplies the return values ("deleted and id"), and it covers permissions, multisite scope, role-restoration rollback, partial failure, and concurrency. An agent has everything needed to call it correctly or decide not to.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, and the description adds real meaning: it spells out exactly what happens to the deleted user's posts and links when reassign_to is omitted versus supplied, and notes that 0 is equivalent to omitted. Only the id format is left entirely to the schema.

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?

Opens with a specific verb and resource ("Delete a user account"), which cleanly separates it from the read/create/update siblings (wp_get_user, wp_create_user, wp_update_user, wp_list_users). The scope — full account removal, not just site membership — is stated explicitly.

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

Usage Guidelines4/5

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

Gives concrete conditions for the two branches: supply reassign_to to hand content to another user, omit it to let WordPress trash/delete the authored content. It also states refusal cases (missing delete_users capability, last administrator, ab_mcp_busy, invalid reassign target). No sibling alternative is named, but there is no competing delete-user tool.

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