wp_upload_media
Upload base64-encoded files to the WordPress media library, with options for alt text and titles to improve accessibility and SEO.
Instructions
Upload a file to the WordPress media library using base64-encoded data. Maximum file size: 10MB.
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": {
"data": "<data>",
"filename": "<filename>"
},
"name": "wp_upload_media"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alt | No | Alt text for images (for SEO and accessibility) | |
| data | Yes | Base64-encoded file data | |
| title | No | Media title (defaults to filename) | |
| filename | Yes | Filename with extension (e.g. "photo.jpg", "document.pdf") |