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

I'm using wordpress.com's public REST API to retrieve custom posts from a Wordpress installation. The JSON that's being returned is missing all the custom fields, however. The fields are definitely there and working, because I can filter on them. For example this URL:


is successfully limiting based on the facebook custom field, but that field isn't present in the response. Judging by the criteria for including custom fields in this article:

If the user performing the request is unauthenicated, he or she will not be able to add, edit or delete any metadata; will be able to read any metadata for which the key doesn’t begin with _ but will not be able to read any metadata which begins with _ unless it is whitelisted.

the field should be appearing. Is there something I'm missing, or is this a bug?

share|improve this question
wordpress.com customizations are off topic here. Please ask their support. – toscho Sep 13 '13 at 9:17
Please excuse my ignorance because I know nothing about Wordpress - but this isn't anything to do with wordpress.com (bar using their public API) - the site in question is a private wordpress installation. To my knowledge nothing has been customised, beyond the post type which is custom. Is that what you're referring to? – Craig Sep 15 '13 at 19:17
Try making an authenticated request. – Paul Schreiber Apr 30 '15 at 17:41

Try using the rest_api_allowed_public_metadata filter to whitelist the facebook custom field. It will then appear in the response:

add_filter( 'rest_api_allowed_public_metadata', 'jeherve_allow_fb_metadata' );
function jeherve_allow_fb_metadata() {
    // only run for REST API requests
    if ( ! defined( 'REST_API_REQUEST' ) || ! REST_API_REQUEST )
        return $allowed_meta_keys;

    $allowed_meta_keys[] = 'facebook';

    return $allowed_meta_keys;
share|improve this answer
Thanks; I have similar code in place but it doesn't make any difference. I raised this with Jetpack support and they think it's a problem on their end, so I'm waiting to see what happens with that. – Craig Sep 22 '13 at 22:12

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.