Add featured +- attached images to post endpoint in REST API

When one pulls up the endpoint “wp-json/wp/v2/posts” we get a key called “featured_media” but it returns an integer value.

Can’t we rewrite this to give a proper URL to the featured image? or even add another key that has attached images as URLs.

This will prevent the extra queries one has to return the image URLs or even install bloated plugins to get this information.

I know the endpoint already has so much information one rarely needs thus the growth of tech like GraphQL but we could also consider Author name & description to the individual posts.

This is voice is for decoupling ClassicPress to modern apps or front-ends.

Read-only archive:

Author: Laurence Bahiirwa

Vote count: 5

Status: open


  • difficulty-hard
  • request-add-feature