royal-mcp__wp_upload_media_from_url
Download a file from a public HTTPS URL and add it to the WordPress media library. Accepts images and any document type the site allows in its media library (for example PDF). Use this when you have a file URL (Unsplash, Pexels, client asset, an official PDF, etc) that needs to become a library attachment — for example before setting an image as a featured image. Returns the new attachment ID and its MIME type. To convert, resize or compress an image on the way in (for example a JPEG under 400 KB), pass convert_to, max_width / max_height and max_kb. Pass if_exists: reuse to get back the existing attachment when this URL was already uploaded with the same options, so a retry never makes a duplicate. (site: demo.royalplugins.com) Through Royally: waits for a person to approve it in Royally; nothing on the site changes until then.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Public HTTPS URL of the file to download | |
| title | No | ||
| max_kb | No | Images only. Lower the quality step by step until the file is at most this many kilobytes. Works best with convert_to jpeg or webp. | |
| caption | No | ||
| quality | No | Images only. Starting quality for JPEG or WebP (default 82). | |
| site_id | No | Site to run this tool on: 8ef2e52b-bd07-4671-a363-ebe8b480b65c (https://demo.royalplugins.com) | |
| alt_text | No | Alt text for accessibility and SEO (images only) | |
| filename | No | Optional filename (with extension). Derived from URL if omitted. | |
| if_exists | No | reuse: when the same file (for a URL upload, the same URL) was already uploaded with the same image options, return that attachment instead of adding a duplicate. Default create. | |
| max_width | No | Images only. Scale down to at most this many pixels wide, keeping proportions (never scales up). | |
| convert_to | No | Images only. Save the image in this format; a PNG from an image generator usually becomes a much smaller JPEG. | |
| max_height | No | Images only. Scale down to at most this many pixels high, keeping proportions (never scales up). |