=== Replace External Images === Contributors: hansandfriends Tags: media, images, import, external images, hotlinking Requires at least: 5.0 Tested up to: 6.8 Requires PHP: 7.4 Stable tag: 1.0.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Easily import externally hosted images found in post content into your media library and replace them with local copies. == Description == “Replace External Images” lets you import externally hosted images used in post content directly into your WordPress media library — with just one click per post. The plugin automatically replaces external URLs in the content with local media URLs. Includes a live progress view, supports any image host, and updates featured images where needed. Ideal for: - site migrations - pasted content from other sources - cleaning up hotlinked images == Installation == 1. Go to your WordPress dashboard. 2. Navigate to “Plugins > Add New”. 3. Search for “Replace External Images”. 4. Click “Install Now” and then “Activate”. Alternatively: 1. Download the plugin as a ZIP file. 2. Go to “Plugins > Add New > Upload Plugin”. 3. Select the ZIP file, click “Install Now”, then “Activate”. Once activated: - Open a post that contains externally linked images. - Click “Replace External Images” in the Tools section. - Watch the live progress bar and wait for completion. == Screenshots == 1. A post with an externally hosted image. The "Replace External Images" panel appears in the editor sidebar. One click imports the image into the media library and updates the post to use the local version. 2. Successful import confirmation with summary and return link. 3. Works in both Classic Editor and Gutenberg, including multi-image posts. 4. Respecting protected content — import fails cleanly for non-image or restricted resources. == Frequently Asked Questions == = Does it overwrite existing media? = No — it only imports external images and skips media already in the library. = What happens to the image URLs? = They are updated to local media paths after import. = Can I undo the import? = Not automatically. Please make a backup before running the importer if you need to restore content later. = What happens with protected or blocked images? = Some image sources actively block hotlinking or automated downloads by returning a different content type (e.g. `text/plain` instead of `image/jpeg`). This plugin detects such cases and skips the import gracefully — no image is saved, and the log explains why. = What if the post doesn't have a featured image? = If a post has no featured image, the plugin will automatically set the **first successfully imported image** as the featured image. == Changelog == = 1.0.0 = * Initial public release * Live importer for external images * Works on individual post basis * Tested up to WordPress 6.8.1 and PHP 8.2