You can easily inspect all the metadata for any post like so:
// 123 is the (attachment) post ID
var_dump( get_post_meta( 123 ) );
And in a default WordPress setup with no plugins or theme which add custom metadata to the image attachment post, the metadata you’d get are:
-
_wp_attached_file
— string, the image file (path and name) for the attachment post -
_wp_attachment_metadata
— array (serialized), the sizes for the image like ‘thumbnail’ (including original size), and metadata from EXIF/IPTC info. -
_wp_attachment_image_alt
— string, the image’s alternative text
As for the other details like the image title, they are in the post data (in the posts database table), so you can for example use wp_update_post()
to update these details:
-
post_title
— image title -
post_excerpt
— image caption -
post_content
— image description
Related Posts:
- remove links from images using functions.php
- How to add classes to images based on their categories?
- Auto delete WordPress images/thumbnails (all sizes) and featured after X days/hours, or similar?
- How to add a rel attribute to images that contains their categories?
- Best way to programatically add “rel” attributes to page and post images
- Can’t check if a post has thumbnail adding filter to get_post_metadata()
- Image rotation fails to regenerate custom sized thumbnail
- Display images that are not in the content
- How to hide image-url if no attachment?
- Different image using srcset function
- Auto delete content in specific folder inside media library
- How to update an image attachment’s alt text from a custom field when saving a post?
- blank page with wp_get_attachment
- Open image size links in a page instead of direct image link
- Add image size if page template
- Set JPEG compression for specific custom image sizes
- Issue with wp_get_attachment_image() and SVG file type
- How to change the markup WordPress inserts for post images
- Removing default image size list in Media Box
- How to create thumbnails for PDF uploads?
- Change meta tags programatically
- Why are image thumbnails cropped proportionally (not per dimensions)?
- Use a function to update post meta based on other post meta
- Gallery images titles – get from post
- Display info from custom fields in all images’ HTML
- copy attachments to another post type and change attachment url
- Assign category using custom field?
- Why are image thumbnails cropped proportionally (not per dimensions)?
- Regenerate missing _wp_attachment_metadata
- Convert User ID’s to User Names in a single.php file
- What is the “icon” parameter in wp_get_attachment_image_src used for?
- How to change ID of an attachment in wp_posts and its related tables correctly?
- Count total number of images in post and echo results as number
- How can you limit srcset on a single type of page?
- Automatically wrap multiple images in div
- Understanding and altering the structure of posted images
- Overwriting Parent Theme’s Image Sizes
- Featured Image Thumbnail Creation
- Twentyten Child Theme: header images display messed up in admin panel
- Move Post to different category if post_meta field is 0 or is 2 days old?
- Set spesific size of featured images
- media resize/crop possibilities?
- Post meta not updating
- Function to update post_meta based on existing post_meta
- Can’t filter wp_get_attachment_link
- Get ID of first image attached to a post
- Exclude from the query posts with meta_key and meta_value
- Way to store featured image width and height in two separate variables?
- srcset and custom field get_post_meta and wp_get_attachment_url
- Limit dimensions of “Full” size images
- Get array of metakey in all posts
- Visual Composer creating own shortcodes with vc_map() to return simple Image
- attachment page template? only show attachments for current post?
- Woocommerce image sizes missing from Appearance › Customize but not declared by theme
- How to properly set custom logo size?
- Add attribute only to first image of every post via functions.php
- Need to convert image url to a Base_64 data url with wordpress function..
- Function to insert missing image size attributes into img tags
- Get Attachment Category Name
- Image Crop Not Working
- Use existing image sizes for WooCommerce
- Retrieve First Image Function
- Using add_image_size in functions.php to get original uploaded file
- How d0 i get the number of attachments in the post
- How to avoid saving empty data to sql while using add_meta_box
- Custom image sizes showing in Classic Editor only when upladed directly to post
- how can I change all wordpress media file url to custom cdn url?
- How to change images url in function.php?
- WP_Query for Attachments not working as expected
- Update wp_postmeta table based on 2 keys
- Class parameter in get_avatar args doesn’t get added to output
- large image size of 1440×1440 not pulling 2x of 2880×2880 image
- Images with overlay
- Reference multiple style sheets, clearing styles for permalink page, custom fields for css
- How To Display Author Popup on Entry Meta (Genesis Framework)?
- Remove all video attachment, both files and post/postmeta from database?
- Printing medium sized image
- save_post doesn’t correctly process function call with php class
- restrict uploaded image size and fixed image display size
- Why am I losing image quality on my site?
- Replace image attributes for lazyload plugin on image elements with specific class
- Disable links to images only if link is an image
- Restricted images only for logged user. (hidden url)
- Zip all (original) images from media gallery
- No compression occurs on my jpegs after adding jpeg_quality hook to my functions.php file
- Update add_image_size
- Function the_content
- How to add a meta information to the URL?
- Set thumbnail from URL, by grabbing image in functions.php
- Dynamically adding Captions to images
- Full size image option removing problem
- Function to get thumbnail img source
- Add custom fields after post/page title
- Display post_meta-by_key on product catalogue
- Image width issue in IE [closed]
- image_size with respect to aspect ratios
- How to resize image from import image url?
- How to crop image in WordPress with aspect ratio for any size of image
- How to add height and width dimensions automatically to archive descriptions
- How to overwrite image if it already exists – WordPress, Gravity form