Upload media
create_mediaUpload images or files to WordPress media library from local paths, URLs, or base64 data, with automatic thumbnail generation, alt text support, and optional featured image assignment.
Instructions
Upload a file into the media library from any of three sources: file_path (a path on the machine running this MCP server — this is how you upload a local screenshot), url (downloaded here, then uploaded), or base64_data. WordPress runs its normal image pipeline, generating the registered thumbnail sizes. Always set alt_text for images — it is required for accessibility and read by search engines.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Public URL to download and re-upload into the library. | |
| post | No | Attach the upload to this content ID. | |
| title | No | Media title. Defaults to the filename. | |
| caption | No | Caption shown beneath the image. | |
| 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. | |
| alt_text | No | Alternative text. Set this for every image. | |
| filename | No | Filename to store as. Defaults to the source filename; required for base64_data. | |
| file_path | No | Absolute or ~-relative path on the machine running this MCP server. For a Mac screenshot that is typically "~/Desktop/Screenshot 2026-08-23 at 2.29.04 PM.png". Not a path on the WordPress host. | |
| attribution | No | Credit line for a stock photo; appended to the description. | |
| base64_data | No | Raw base64 file contents (a data: URI prefix is accepted and stripped). Requires `filename`. | |
| description | No | Longer description, shown on the attachment page. | |
| featured_for_type | No | Content type of set_as_featured_for. | post |
| set_as_featured_for | No | After uploading, set this attachment as the featured image of this content ID. |