wp_delete_user
Delete a WordPress user permanently and reassign authored content to another user; dry-run preview prevents accidental deletion and production writes require explicit approval.
Instructions
PERMANENTLY delete a user; their content goes to reassign (0 = deleted too).
There is no trash and no undo for a user: WordPress's REST API only deletes with
force, so this cannot be reversed from here. reassign decides what happens to
everything they authored - posts, pages, media: the DEFAULT of 0 DELETES THEIR
CONTENT WITH THEM, while any other user id transfers authorship to that user (get
one from wp_list_users). If the account wrote anything you want to keep, pass a
reassign target. DEFAULTS TO dry_run=true (returns a preview that spells out which
of the two outcomes you are about to get; deletes nothing). Pass dry_run=false to
delete. Requires the REST transport and an administrator app password. Prod writes
require allow_prod=true.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | ||
| install | Yes | ||
| user_id | Yes | ||
| reassign | No | ||
| allow_prod | No |