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
- Missing feature image link function
- 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
- How to add a class to the attachment images
- Programmatically Set First Image as Featured
- Removing default image size list in Media Box
- How to use get_template_directory_uri() to load an image that is in a sub-folder of my theme?
- WP 4.4. responsive loads normal image after loading the responsive image
- How to create thumbnails for PDF uploads?
- How to reduce original image quality on upload?
- Add options to featured image
- Is it possible to maintain image aspect ratio when scaling images?
- Set image size on media and text block with a function
- Generating Responsive Background Image Sizes in PHP
- Change meta tags programatically
- How to get meta value in wp_attachment_metadata
- Why are image thumbnails cropped proportionally (not per dimensions)?
- Use a function to update post meta based on other post meta
- Create thumbnail on PDF upload with Gravity Forms
- Gallery images titles – get from post
- Display info from custom fields in all images’ HTML
- Remove images from get_the_excerpt
- update_post_meta for custom field not working upon form submission
- Use Exact Image Size using add_image_size
- copy attachments to another post type and change attachment url
- Assign category using custom field?
- Why are image thumbnails cropped proportionally (not per dimensions)?
- Display height and width properties with the_post_thumbnail() or related function
- Insert width & height attributes to all images displayed on each page
- Converting a simple plugin to be placed inside of functions.php
- Regenerate missing _wp_attachment_metadata
- Custom image size in Media Dropdown
- Convert User ID’s to User Names in a single.php file
- Removing the first image in content
- Function to auto-set a featured image that is already in use
- Actions according to image type and size
- 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?
- Woocommerce Storefront WordPress Ignore Media Gallery Images and use External 3rd Party Host
- Overwrite Parent Theme add_image_size in Child Theme
- Images uploaded using media uploader are appearing upside down
- Find first image on paginated post for Pinterest
- How to add css class to image attached in all the posts?
- Add custom image size not working
- Count total number of images in post and echo results as number
- How can you limit srcset on a single type of page?
- how to add an image to the footer?
- How do I permanently Disable Attachment Post URL
- wp_get_attachment_image function size argument not working if I also add a custom class
- Automatically wrap multiple images in div
- Understanding and altering the structure of posted images
- Overwriting Parent Theme’s Image Sizes
- Load post attached images on a single page site with fancybox
- Publish/Update post is changing image links from file url to post url
- 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?
- Disable auto-resizing of uploaded images, but only for certain filename
- Can you put a condition on add_image_size() depending on the width of the uploaded image?
- What WordPress function to use to get meta value by using meta keys?
- show first 3 thumbnails of posts in different sizes [closed]
- Remove after images
- Getting custom image size URL in functions
- Set spesific size of featured images
- Default Custom Field Value Automatically Update
- Can’t generate thumbnail images
- media resize/crop possibilities?
- Post meta not updating
- Function to update post_meta based on existing post_meta
- get_post_meta not working on category.php
- Can’t filter wp_get_attachment_link
- Get ID of first image attached to a post
- How to stop wordpress from injecting hard-coded style into image attachments with captions
- Exclude from the query posts with meta_key and meta_value
- Control the srcset much more (not all sizes in it each time)
- Way to store featured image width and height in two separate variables?
- Prevent custom field from being updated after first publish
- 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
- User function to return multiple get_post_meta()
- attachment page template? only show attachments for current post?
- How to get an attachment id from a filename