your query looks good and seems workning. I’ve made a test on my database and the image remained visible in the media library after the ID change. Maybe there was already other posts existing with that IDs
Related Posts:
- Set attached to state
- Get the url of the full sized attachment image using post ID?
- How to force regenerate thumbnails in WordPress posts?
- How to extract images of post and pages excluding header and logo image in wordpress?
- How to get custom field image url of specific size
- Converting a simple plugin to be placed inside of functions.php
- Converting Attachment to Images?
- Bulk Image Uploader to create new post from each image [closed]
- Adding Attachment Display Settings in custom media frame
- Redirect to another page using contact form 7? [closed]
- How can I automatically download all images from all imported posts, place them on my new host, and replace all the links
- Set Multiple Meta Values as an Array Using dispatch( ‘core/editor’ ).editPost() Call in Gutenberg/JS
- Search by Attachment ID
- JSON API Plugin not showing Attachments id reused
- Link Posts to External URL
- What snippet do I need to type to show my ACF field show up on my theme?
- Is there a way to make [Table Of Content] plugin while not using revision data?
- Copy/paste local images not working in WordPress
- Help to Create a Simple Plugin to make a post
- Get all image in media Gallery with alt/title?
- How to wrap image tag into div for post only?
- Get value from an input field and pass into update_meta_data as $meta_value
- Is there any hook to change media html in post? [duplicate]
- How to show post attachment image
- Retrieve post thumbnails
- Get post id in Post Page within Wp-admin
- getting image alt text via ACF plugin in WordPress [closed]
- Show Similar Post Titles ( Similar to Stack Exchange )
- How do I unlock a post programmatically?
- How to work with Syntax Highlighter Evolved?
- User-Specific Timezones? Hack? Plugin?
- Display (and manage) webcam images?
- Cropping, Re-sizing and Saving images from one folder to another folder in wordpress
- jQuery plugin only in one page/post
- Moving image attachment from post to another?
- Auto-post to multiple sites like Posterous? [closed]
- How do I change the description of the same image which is to be found in multiple instances?
- Share buttons on article footer
- How to get meta value in wp_attachment_metadata
- How to create a Page alias in WordPress
- Comparisson between date() and a date from wp_postmeta
- Dynamic HTML not displaying at respective place
- How to get all attachment image from post ?? WordPress
- How can i change an image’s author?
- Generated Images sizes do not match Media Settings Image Size
- How to filter content post only on save
- How to change Thumbnail size of next Gen Gallery plugin?
- Set WordPress Featured Image For All Post Slugs Matching Image File Name in Specified Directory
- How do I create a full-bleed background image on text mouseover? [closed]
- Find unused images?
- Image gallery plugin [closed]
- Is Wrapping intval() Around esc_attr() Redundant for Escaping Input?
- How can I implement an Add to Collection function on my Image Gallery to be downloaded later?
- How can I restrict image upload dimensions for non-admin WordPress users?
- Add padding while generating thumbnail
- Image Manager Plugin [closed]
- get_post_meta not working on category.php
- Add category selection to custom post type (plugin)
- Meta box losing its value when scheduled post is published
- Adding Static Image to WooCommerce Content-Single-Product template
- wordpress content .php file in an iframe’s src in a wordpress post
- How to accept images at multiple sizes and aspect ratios and display as standardized image size / ratio?
- Function added to hook “new_to_publish” not executing – custom plugin
- Creating an admin meta box to save post as pending
- Getting a list of the published posts
- Custom Template for wordpress cpt plugin
- Looking for a photo management solution
- Elementor Pro display featured image on section -> style -> image using shortcode
- Can export gallery but can’t import it Wp all import
- Is there a hook similar to “save_post” which only fires AFTER the post is completely published?
- How do I add a medium to the WordPress database with my own plugin?
- Display Multiple Photos as Featured Image when mouse moves on to it post
- what functions to use to resize images and create DB metadata for them after/during upload?
- Show post object of any page in frontend
- Trying to add a new feature in my wordpress website
- Powerpress upload a podcast without creating a post for it
- automatically set random featured image by category in wordpress on post
- Prefix WordPress Taxonomy Tags With Hashtag Symbol Like Twitter
- How can I get the Post ID and Post Type within a Must Use Plugin?
- Does WordPress have a way of changing the ‘Natural’ size of uploaded images?
- WordPress Dashboard organize posts based on categories
- Add new post using a page inside the website
- how to open image gallery in a post/page?
- Related posts popup
- Storing values in Post Meta vs new tables
- Determine if get_the_image has image on Get the image Plugin
- Find And Add Category to Posts
- Get page type to display content
- Insert data in custom table during new post creation
- Capturing POST data
- Get a submitted value from front end post form for single template
- Automatically set posts to NoIndex depending on category?
- Notification When Post Approved
- How should I force WordPress to give proper name for the uploading images?
- Windows 10 Printer that Sends to WordPress [closed]
- How to Add a Website Background Image to One Page?
- Want to show pop up image on home page every time when i refresh it [closed]
- My Blog page ( posts page ) theme isn’t changing with the new theme [closed]
- Can i have limit posts on a specific category and automatically remove older ones?
- How do i display the number of images on the “post screen”