Easy Replace Image
Replace easily an attachment file by uploading another file or by downloading one from an URL, without deleting the attachment.
Install in
This plugin allows you to replace an attachment file by uploading another image or by downloading one from a specified URL, without deleting the attachment. The plugin handles the sub-sizes generation and the attachment metadata update, and you will see the result right away.
SVG attachments are supported too: an SVG attachment can be replaced with another SVG file, and a raster image with another raster image (JPG, PNG, GIF, WebP, AVIF).
Demo
License
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Joobi from the project's own listing. See the source page
3.6.0
- Tested up to 7.2
- PHP 8.5 compatibility checks (the image size functions detect the SVG files natively)
- Adds support for replacing the SVG images (an SVG is replaced only with another SVG, and a raster image only with another raster image)
- The SVG files are validated before the replacement, the ones with scripts, event handlers or embedded external content are refused (filter
easy_replace_image/svg_is_safeavailable for a custom sanitization) - The replace action is available in the Media screen for the SVG files too
- Fixes the previews that were not refreshed after the replacement: block editor featured image, editor canvas, product gallery and other thumbnails of the same file
- Refreshes the file size and the dimensions on the attachment edit screen after the replacement
- Shows an error message when the replacement fails, and fixes the upload error check
- Updates the dependencies and the build setup
See the changelog for detailed information on changes made in the earlier versions.
Follow this listing's changes (Atom feed)