Update WordPress Media Item
wp_update_mediaUpdate WordPress media metadata to add missing alt text, titles, captions, or descriptions. Improve accessibility by backfilling alt text on images without it.
Instructions
Update metadata on an existing media item — title, alt text, caption, description, or attachment target. Most common use: backfilling alt_text on images that don't have it.
Args:
id (number): Media item ID. Required.
alt_text (string): New alt text. Pass empty string to clear.
title, caption, description (string): Optional.
post (number): Reassign to a different post/page ID (0 = unattach).
response_format (enum): markdown | json. Default 'markdown'.
Returns: The updated WPMediaItem.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>"
},
"name": "wp_update_media"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Media item ID to update. | |
| post | No | Reassign to a different post/page ID. 0 = unattach. | |
| title | No | New title. | |
| caption | No | New caption. | |
| alt_text | No | New alt text. Pass empty string to clear. | |
| description | No | New description. | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable. | markdown |