How to remove the images from “Uploaded to this post”?
You have to unattach the images from the post. And that means setting their ‘post_parent’ => 0 in wp_posts database table. The plugin Unattach and Re-attach Media Attachments does exactly this, and it uses the following command to this end: $wpdb->update( $wpdb->posts, array( ‘post_parent’ => 0 ), array( ‘id’ => (int)$_REQUEST[‘post_id’], ‘post_type’ => ‘attachment’ ) … Read more