Running the wp media regenerate
command from WP-CLI with the --only-missing
argument is quite fast (takes about 30 seconds for 4000 images) and rebuilds _wp_attachment_metadata
correctly:
wp media regenerate --only-missing
Related Posts:
- Programmatically adding images to media library
- Uploaded images don’t show in Media Library if there are special characters in IPTC Keywords
- How can I hide media library images from general users?
- Get images attached to a specific page
- WordPress Attachments with old images
- How can I use an image from an external source without uploading it to the media library
- How can I get or the intermediate size of an image with wp_get_attachment_image_src without using post meta?
- Programmatically get images by URL and save in uploads folder
- how to get original image using wp_get_attachment_image_src
- Can I attach image to post without adding it to post?
- Upload images to remote server
- How to delete resized (cropped) image uploads and prevent future resizing?
- What’s the proper way to find and remove duplicate images from posts and the media library?
- wp_get_attachment_image_src and server path
- Separate Media Library for each user
- How to find attachment by it’s name?
- Why is wp_get_attachment_image_src not working with my custom size (add_image_size)
- How do I delete all generated images from my server except those currently used in posts
- Insert an image into a post by API
- Function to call the attachment image from post
- Theme Customiser Image Control
- Images dont show in grid view, but do in list view
- Get attachment ID of author_meta image – Attachment Metadata
- Associate an existing image with a post
- How to rename an image attachment filename using php
- Programatically creating image attachments from local URLs and setting featured image
- Remove duplicate images from media library.
- Use Media Library to manage galleries like Nextgen (with folders, albums, collections, tags, categories, terms…)
- How do i upload an image and return the image id?
- Get Attachment ID from URL [duplicate]
- How to remove title attribute from gallery links and images
- Separate attachment images from post loop
- How to display a shortcode caption somewhere other than the_content
- WordPress function: limit size, only jpg, jpeg, limit of uploaded files per account
- How to get meta value in wp_attachment_metadata
- copy attachment title to description and alt text
- Get an image from url in front end submission form
- Open the attachment details modal
- How to upload image without post ID using the new media uploader?
- Display info from custom fields in all images’ HTML
- How do I delete thousands of unattached images?
- Cannot access the thumbnails of attachment images… Cannot find the reason
- Allowing post attachments without allowing to insert in text
- Why would image paths in wordpress suddenly change?
- Applying class to links around self hosted images embedded to posts/pages
- Get post embedded image caption
- Rename attachments during upload
- Regex to turn embedded images in to attachments
- copy attachments to another post type and change attachment url
- Re-process Images
- Show prev and next post links for parent post of current image in attachment page?
- Pulling Post Image Attachments in WordPress 3.9
- Import Images from one self-hosted WordPress install to another
- Uploading images to Media Library fails with Memory Exhausted
- Why can’t I edit certain images from the WordPress Media library?
- Edit image preview is not displayed
- Uploading images: ‘ø’ get replaced with ‘ø’
- Link Featured Thumb to Attachment Page, If Possible
- How can I autopopulate titles in the media library?
- Upload thousands of images to WordPress without plugin?
- Make alt text required when setting a featured image
- Image still linked as attachment to page even though it has been deleted
- How to make programmatic image upload generate thumbnail and sizes?
- Best way to strip character entities (%20 etc)
- How to change ID of an attachment in wp_posts and its related tables correctly?
- Display one random image, but only if landscape
- get_attachment_id() only get id of first attached image after post update
- Different upload path per file type
- Display latest 12 images from media library
- Why can I not view image attachment pages?
- Images are randomly deleted from server
- Is there a way to get attachment data?
- Get full image array
- How to change image url?
- Add a new data attribute in tag
- Bulk image rotation
- Custom page template to display all image attachments
- Link to full size image or attachment page in photo theme
- get the image of the post
- HTTP Error when uploading files above 7mb unless using GD Image Editor
- add the post as canonical for attachment page wordpress
- Consolidating two websites into one, but migrated images not appearing in Image Library
- wordpress media library shows empty images
- Retrieving an alt tag from a custom field
- media_sideload_image with rewritten urls?
- How to order images in a post in WordPress 3.3?
- Get thumbnail url of custom meta image?
- Check if the image exists in WordPress media library
- unattached media files that should be attached
- How to output images as figure/figcaption
- Add an attribute to attachments
- Bulk edit of EXIF data for jpeg images uploaded in the media library?
- Out of memory error reporting
- How can I attach hotlinked images in posts/pages within the same server?
- Multiple images in one attachment page
- WordPress Image Attachment using remote image
- offload media to external services [closed]
- Exclude images from “inserted into post” when trying to get attachments
- WordPress adds extra width to post images container boxes
- Handling image uploads without thickbox