Plugin

LH Add Media from URL fetches a remote file by URL and adds it to the WordPress media library — via wp-admin or a JavaScript bookmarklet. Useful when you find an image or file elsewhere online and want a permanent local copy in your own media library, rather than depending on the original URL staying up.

Features

  • Fetches a remote URL and sideloads it into the media library via WordPress core’s own upload pipeline (media_handle_sideload()), so it goes through the same validation, thumbnail generation, and metadata handling as a normal upload.
  • Redirects to the new attachment’s edit screen on success.
  • Ships a bookmarklet: install it once, then click it on any page to upload the current URL without leaving the page.
  • Exposes an MCP ability (lh-add-media-from-url/add-media-from-url) so an MCP agent can pull a remote file into the media library the same way, without a human filling in the form — see Architecture for details.
  • File-extension and MIME detection run against the already-downloaded local copy via wp_check_filetype_and_ext(), staying inside WordPress core’s own SSRF-protected fetch path rather than making a second, unprotected request to the remote URL.

Installation

  1. Upload the lh-add-media-from-url folder to /wp-content/plugins/.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. Go to Media -> Add from URL to add media via URL, or use the bookmarklet.

Documentation