This works for me: http://wordpress.org/support/topic/detach-amp-re-attach-media-attachment-images-from-posts#post-1609173
I’ve saved this as a snippet in my IDE for use in projects. Very handy!
Related Posts:
- Responsive Images
- Use Media Library to manage galleries like Nextgen (with folders, albums, collections, tags, categories, terms…)
- Add size in Gallery Settings in Media Library
- Define size for `get_post_gallery_images`, they seem to have been resized to 150×150
- Media gallery – inserting full size images without link
- How to Add a Custom Colum on Thickbox Media Gallery Tab?
- Getting the image title/alt attribute from the gallery shortcode
- Add data attribute to a gallery link?
- Large Media Library
- Add Download Button in prettyPhoto Plugin
- Gallery Image Numbers?
- Extending Media Gallery – Retrieving values from short code
- How to run custom JavaScript code on gallery attachment image selection
- Original image not saving?
- Display number of latest images from wordpress gallery in your homepage
- Why do the images only display in original size, not my custom size?
- Display Gallery Images from Custom Post Type
- Ipad app: Need uploaded images to go into “Gallery” as well as “Media Library”
- Gallery – custom html for inserting images
- Media Categories as Classes on WordPress Gallery Shortcode
- Display custom gallery in each wordpress post
- Add anchor tag on previous_image_link / next_image_link
- Programmatically adding images to media library
- How do I delete all UNUSED images from my uploads directory?
- How to extend the gallery block in Gutenberg?
- Minimum Dimensions Requirement for Featured Image?
- Upload images to remote server
- How to delete resized (cropped) image uploads and prevent future resizing?
- Prevent WordPress from adding image’ title automatically
- Overide Gallery Default Link to Settings
- Creating a photo gallery in WordPress [closed]
- How can I alter the [gallery] markup?
- Uploaded images don’t show in Media Library if there are special characters in IPTC Keywords
- What’s the proper way to find and remove duplicate images from posts and the media library?
- get_post_gallery with Gutenberg
- Which filters or actions to use after a media upload and delete?
- Custom wordpress gallery option
- Make a really simple gallery structure
- Best approach when modifying the Media Manager
- How to have different captions for same image, for galleries?
- Separate Media Library for each user
- get_post_gallery_images returns thumbs . I want full size
- Gallery Inside One Post
- How do i add class=”fancybox” to the default gallery?
- How to show description under an inserted image?
- Why is wp_get_attachment_image_src not working with my custom size (add_image_size)
- image_size_names_choose filter doesn’t show
- Hide custom image sizes from media library
- Post slugs and images cannot have same name?
- WP 3.5 and Galleries – how to count images?
- Navigate with keyboard in Gallery shortcode
- Add existing images from Media Library in to custom gallery
- How to draw media details for Isotope gallery using Photoswipe
- Modifying the media-template.php file, the right way?
- Cropped featured image replaces original image in gallery
- How to call WP3.5 Media Library manager?
- First three images in post excerpt
- How to register images uploaded via FTP in media library?
- get images from post and make a zip
- What is the action hook for save media-form on gallery tab?
- how do i create a downloadable gallery with image descriptions?
- Way to force media uploader use custom image size
- Bulk edit wordpress images alt and title attributes
- Customize WordPress Media Manager – Media Window
- Images dont show in grid view, but do in list view
- Change the output for [gallery] shortcode
- Set default link type to “file” for image galleries
- How can I hide media library images from general users?
- Add option to “Gallery Settings” section
- Making WordPress Gallery (.gallery-item) Responsive?
- Download external images if post is publish
- How do you modify the HTML output of a Gallery item (using the gallery shortcode)?
- How I can get image description/title/alt for gallery image?
- How to include externally hosted images into a gallery block
- How can I attach images to a post from the media library?
- Can I load posts via Ajax?
- How to rename an image attachment filename using php
- add_image_size creating lots of images (of various sizes)
- Image width tag is less than the image pixel width – why?
- Excludes posts that don’t have attachments in the_content()
- Remove duplicate images from media library.
- Register an additional image size for only some images in my media library
- Admin Media grid view images won’t load
- WP_Editor – Remove TinyMCE Toolbars
- Having Problem On Getting WP Post Gallery Images URL
- How to add a “data-” attribute to the image tag of native gallery output
- Images Missing from built in WP Gallery
- Setting up a gallery with images and a zip download
- How to remove title attribute from gallery links and images
- How can I remove or change a border/outline on a picture when it is in a gallery page?
- How can I make all gallery images to open in a new window?
- Gel all image from certain post type
- WordPress function: limit size, only jpg, jpeg, limit of uploaded files per account
- How do I get gallery thumbnail URL and change the default thumbnail size?
- The WordPress Gallery, Grabbing The Link and Images?
- Post photo galleries [closed]
- Displaying a featured image (only img url) as the img src?
- Proper Way to Remove Thumbnail Links In Gallery
- Gallery images titles – get from post
- Cannot access the thumbnails of attachment images… Cannot find the reason