How to use _embed when using _fields?

It is not clear in the documentation, but you need to include the “_links” and “_embedded” as fields to be returned. In addition, I include the _embed parameter, as it does not require a value. As of WordPress 5.4, the resources to embed can be limited by passing a list of link relation names to the _embed parameter, though I have not had success with that when using _fields

Example:

domain.com/wp-json/wp/v2/posts?_fields=link,title,featured_media,_links,_embedded&_embed

Leave a Comment