Delete a media item
delete_mediaPermanently delete a WordPress media attachment, removing the file from disk. Requires confirm: true because deletion is irreversible and any references will break.
Instructions
Delete a media item. Attachments bypass the trash by default in WordPress, so deletion removes the file from disk permanently and requires confirm: true. Any content still referencing the file will show a broken image.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The attachment ID. | |
| confirm | No | Required — the file is removed from disk and cannot be recovered. | |
| site_id | No | Which configured WordPress site to act on. Optional — with a single site configured it is used automatically; with several, the default site is used unless you name one. Run list_sites for valid ids. |