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]
- WP galleries in posts after import. How do I do it?
- How to select a paragraph other than the 1st to be the post’s excerpt?
- posts from multiple post types in one slider
- How to display the featured post on the category page?
- How can I concatenate variables to search results title? [closed]
- Plugin for an interactive image? [closed]
- Clear out old images, any advice?
- Flickering sidebar when scrolling page [closed]
- How to fix broken media library?
- Is there a plugin or a way in the wordpress that would let us have different versions of a post or page accessibe to users?
- How to accept images at multiple sizes and aspect ratios and display as standardized image size / ratio?
- Moving FB comments at the end of page
- Where Should i write the code for wordpress ajax voting?
- How to get images using taxonomy ( WP Media Folder)
- adding Adsense’s In-Article Ads between images of blog post
- Add “Featured Image” box in my plugin post page
- download button for audio file in post [closed]
- check uncategorized category by default
- Print posts category or tag as a formatted journal
- Large amount image data transfer
- how to execute some code after a post is published in WordPress [duplicate]
- Post status doesn’t update to ‘future’ every time?
- Blurry images when loading the page first time
- Function added to hook “new_to_publish” not executing – custom plugin
- Get Image Having the ID [closed]
- Image Galleries for website migrated from .com to .org
- Retrieving post meta array (attachment)
- Creating an admin meta box to save post as pending
- trigger email when post is published by someone a user follows
- Grab ID from post from plugin and use it to create an object
- Article content navigator in wordpress like mbaskool website
- WP::is_main_query() Not Working
- Overwrite add_image_size defined by theme
- Scrape a webpage for image and add it to post
- I would like to remove date display on photo preview
- Post deleted in trash [closed]
- Getting a list of the published posts
- How to relate 3 wordpress components with each other (Create database relationships)
- Change website directory safely to add a static page on startup
- Show related posts based of current ACF field name in a single page post (a loop within loop)
- How do I link an image in my plugin so it displays on WordPress?
- If post exists in the database – each time goes on `else`
- Custom Template for wordpress cpt plugin
- Embed PDF into wordpress
- Hook Scripts and Styles in WordPress
- Get data from wp_posts of mysql in to variables of wordpress-php script
- WordPress plugin: Getting posts where checkbox selected
- Remember the Meta Value With Radio Buttons
- What hook can I use to modify custom post data before it is displayed on the page?
- get current page number with wp_link_pages()
- problem with register_activation_hook in plugin
- How can i summerize posts or news automatically in word press site?
- WordPress “Add new tag” button is not working
- Attachments broken after giving WordPress its own directory
- Delete data from custom table when deleting a post
- How to auto strip hyperlinks & images in wordpress post
- how can authors to define custom pages?
- Plugin is creating posts twice
- Some images on WordPress site are suddenly gone
- How to get the next and previous image title from attachment or gallery?
- Regenerate Thumbnails Plugin successfully updated my thumbnails but image src won’t change to new image size?
- “After file loaded” action
- Add_image_size not generating correct size
- Is there a way to insert multiple images into a post at the same time without using a gallery?
- Is there a Image Gallery which will load all my posted Images like twitter’s image grid?
- Multiple images per post – Show random image elsewhere
- Edit part of a post
- How to write a new file when new post has been published in WordPress
- WordPress Stats Plugin: Display Post Views [closed]
- WP Editor, save content and category on frontend
- Replace image urls(absolute instead of relative) by using filter in single page
- Plugin for TinyMCE to create reference to other posts
- Problem with ajax plugin for refreshing posts