You could do this via PHP instead of SQL, just get the existing metadata and change what you need to, it will handling the serializing for you:
$newwidth="250"; // or whatever it is
$attachments = get_posts(array('post_type'=>'attachment');
foreach ($attachments as $attachment) {
$id = $attachment->ID;
$metadata = wp_get_attachment_metadata($id);
$metadata['width'] = $newwidth;
wp_update_attachment_metadata($id,$metadata);
}
But really, you may do better use the Regenerate Thumbnails Plugin which may fix this and regenerate the different thumbnail sizes at the same time.
Related Posts:
- How to get image title/alt attribute?
- How can I get a different image size, if all I have is the link?
- Exclude featured image from attachment loop
- How to create resized versions of images added with wp_insert_attachment
- How to attach images that I “insert from url” into the post?
- How to Fix HTTP Error When Uploading Images?
- How to disable WordPress from creating thumbnails?
- Programmatically get images by URL and save in uploads folder
- How do you get the post thumbnail size?
- Minimum Dimensions Requirement for Featured Image?
- Generate Thumbnails only for Featured Images
- Get the first image from post content (eg.: hotlinked images)
- How to Dynamically Resize WordPress Image On-The-Fly (custom field/theme option)
- Set Featured Image Front Frontend Form
- How to find attachment by it’s name?
- media_sideload_image generates blank?
- Showing a placeholder/default img, if no featured image is set
- How to change the naming of the resized image files
- Programatically creating image attachments from local URLs and setting featured image
- Can WordPress crop only the post thumbnails?
- Allow user to manually set crop area of default/custom image sizes on upload [closed]
- Adding Featured Image to Post programatically
- Resizing Images to lower Disk Space Using Plugins
- Autogenerated Thumbnail compression depending on size
- Only create image size when used in featured image
- How to get custom image sizes into media uploader dropdown?
- WordPress resizes image to the same size as uploaded
- Show prev and next post links for parent post of current image in attachment page?
- wordpress responsive image srcset not working
- How do I get a random image from subset of images in media gallery?
- How to set an attachments parent post id in code?
- Why are extra 92 pixel square thumbnails created?
- wp-cli regenerate media is not working for custom sizes
- Remove dimensions from filename featured image
- Can a thumbnail of an animated gif be animated?
- Converting Attachment to Images?
- add_image_size not working with the_post_thumbnail
- Need clear explanation about medias/files/attchments
- Why does the Hard Crop option Scale?
- How do I set the default “feature image” size?
- Image still attached to post even after removing it as featured image
- thumbnails are getting clipped down, want to resize instead
- How check that there is post thumbnail feature image or not on wordpress?
- If I Regenerate Thumbnails, would WordPress delete the existing Thumbnails and replace them with ‘new copies’?
- How to get cropped thumbnail source for custom post type
- 2 image size for post
- adaptive featured images wordpress 4.4 grid
- Featured Image Not Working when loaded from sub-domain
- Generate image for newly added size
- How to both crop (with tool) and resize thumbnails having only a max width constrain?
- “Medium” size image displayed instead of “thumbnail” in only one post, other posts are fine
- wp_get_attachment_image_src match smallest edge
- Show Multiple Size URL of one Featured Image/Thumbnail?
- WordPress returns old thumbnail size after changing media settings
- remove and disable image link in functions.php
- media-library: how to insert thumbnails with a fixed width, regardless of landscape/portrait orientation
- Check if parent post is sticky on attachment page?
- the_post_thumbnail(‘my_image_size’) always outputs full image
- Server B handling add_image_size() differently than Server A
- Image with large file size not cropping
- What can I do if I set a gif as featured image? no thumbnail when i share on facebook
- images not showing despite using add_theme_support(‘post-thumbnails’);
- Retrieve Image Attachments Getting Post Thumbnail Image First
- How to hide image-url if no attachment?
- Resizing thumbnails retrospectively
- post thumbnail: increase dimension if smaller than… Possible?
- Generating very small sized thumbnails from featured image
- How risize a thumbnail?
- Unrestricted height thumbnails
- custom thumbnail image size not working
- Is wordpress compressing my images? if so, how to prevent it?
- Display post thumbnail in foreach loop
- the_post_thumbnail(‘medium’) still gives thumbnail-size img
- How to update custom image sizes?
- Create an instance of add_image_size
- Moved server, and WP now uses original images for all thumb sizes?
- custom image size not being fetched
- Custom image size not displaying with wp_get_attachment_image()
- attachment_fields_to_save first parameter is null
- Thumbnails are hard cropped not matter what
- Using the_post_thumbnail do not rollback to original image if specified thumbnail does not exist
- Missing image size
- Post thumbnail not displaying correct size
- Making a ‘featured image’ become the image for a full banner (top of page) image in a blog post?
- Troubles with code for upload a image
- wp_get_attachment_image not to get the post_thumbnaill
- How to force regenerate thumbnails in WordPress posts?
- Featured Image, and Image in post
- Trouble Retrieving Thumbnail URL on Front-Page
- Featured Image URL is Showing but not thumbnail
- Always generate thumbnail after sideloading image
- setting featured image is not working while running script in background, works when running that script from browser
- Custom image sizes are not used
- Import Dummy Content and Post Thumbnails
- Editing featured image
- Get all images from posts with maximum number and without featured image
- wordpress featured image
- How can I use an image from an external source without uploading it to the media library
- Why not attaching images after impoting using wp cli
- Close featured image modal windows with JS