WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to get a value of a field set with Media Custom Fields (programmatically)?

share|improve this question
up vote 2 down vote accepted

As taken from :


How does this plugin handle my data?

Media items are stored in WordPress just like regular posts. This enables us to use native WordPress functions to store and retrieve your custom fields. Due to this, your data is stored in a very future-proof way, in the postmeta table of the WordPress database.

So you would do it the same way you would do it for a post or page using get_post_meta, but you would pass the media attachment ID in as the post ID

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.