wp_media_delete
Delete a media item from WordPress, sending it to trash for recovery. Permanent deletion available with explicit confirmation.
Instructions
Delete a media item. Default sends to trash (recoverable). Pass force=true with confirm="DELETE_PERMANENTLY_" to permanently delete (requires MODE=full). Note: WP's native UI offers no trash recovery for media by default — many sites have ATTACHMENT_DEFAULT_TRASH disabled. Verify your site's behavior before relying on the trash.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| force | No | ||
| confirm | No |