Custom post metadata not appearing in public API

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;
}

Leave a Comment