Easy Replace Image
This plugin allows you to replace attachment files without deleting the attachment, hence without altering the media references in the content.
You can download the free plugin from the WordPress repository.
Summary
This plugin allows you to replace attachment files by uploading another image or by downloading one from a specified URL, without deleting the attachment. The plugin handles the image sub-sizes generation and the attachment metadata update, and you will see the result right away.
The plugin becomes very useful when you do not want to delete images and then upload new ones to your posts because deleting and uploading new images (hence, creating new media entries) will make it more difficult to track and replace all occurrences of the images in all the content (if the images are embedded in the post/pages content).
Instead, you could use this plugin to just replace the media file with a new one, and the necessary images will be created, without altering the media references.
Demo Video
Search & Replace
The plugin allows you to search for a specific image. The search will match the attachment ID, title, guide, or image metadata. When you select an image from the search results, the option to replace the image will become available and the two options can be used.
Links in the media view
The plugin appends a link to the media entry menu, that allows opening the replace feature for each image from that screen.
Styles Updates
The plugin style was updated to make the features blend in more with the WordPress native screens.
Version History
3.4.1
- Added
avif
to the list of allowed file types (for cases when core supports and hosting that)
3.4.0
- Tested up to 6.6
- Exposed the sub-sizes in the replace view
- Added the link to replace view in the attachment details modal available in the Media Library in grid mode
- Additional changes related to forcing the image cache cleanup after replacement
- Accessibility enhancement for the replace view
- Additional changes that attempt to create missing folders and files on the server to fix attachments that have only database references
- Styles updates for compatibility with core changes
3.3.4
- Tested up to 6.5
- Styles updates to match better the new core styles
- Added nonce check
- Translation updates
3.3.3
- Tested up to 6.4.1
- Assets updates
3.3.2
- Tested up to 6.3
- Added filesize and sub-size info in the replace view
3.3.1
- Added SVGs to the list of potential images that can be replaced
3.3.0
- Tested up to 6.2
- Added in the sidebar box the link to any image replace page
- Added preview update of the image in the post content when the image is used in the core blocks: image, media-text, post’s featured image
- Minor styles updates
3.2.0
- Tested up to 5.8.2
- Changed the priority for the filter to execute later (allowing third-party plugins to perform early filters)
- Added
webp
to the allowed types that potentially replace files (this still depends on the server configuration and the core version)
3.1.0
- Tested up to 5.8.1
- Added link to the replace feature for the images in the media view
- Styles change to blend in more in all the WordPress screens
- New screenshots and demo video
3.0.0
- Tested up to 5.8
- Added new tools item that allows for searching and replacing images from that point
- Added featured image block for Gutenberg compatibility
- UI updates
- Decouple the plugin from jQuery legacy library
- Translation ready
2.2.1
- Fixed the images sizes generation on image replacement.
- Buttons styles for small resolution.
2.2
- Tested up to 5.5
- Icon update
2.1
- Tested up to 5.2.2
2.0
- Tested up to 5.2.1
1.0
- Allow replacing the file with a newly uploaded image
- Allow replacing files by downloading an image from a specified URL
Click the heart.
If you would like to support my work, consider making a donation, buy me a coffee, leave a 5 stars rating, or share this on your feed.
A huge thanks in advance!