WordPress allows to attach (or assign) images and other attachments organized within the Media Library to posts and pages. A file will automatically be attached when uploading it in the post creation form. There are also “Attach” links in the Media Library to manually attach files to posts. Once attached there is no way to unattach or re-attach images, pdfs or any attachment in WordPress core.
This plugin fills this gap by providing two additional links next to “Attach” in the Media Library:
- Re-Attach: Allows to choose a new post to attach the file to
- Unattach: Totally removes an existing relation between an attachment and a post
The plugin also provides bulk actions for unattaching and re-attaching multiple files at once! Just mark the files you want to change, select your desired action from the Bulk Actions dropdown and hit Apply.
Thanks to tamlyn who created the plugin Unattach and Unattach and Re-attach Media Attachments which inspired this plugin. Just adding upgrades of the code to the latter so it is safer for use. My initial issue came from here