Title: The REST API in WordPress 5.3
Author: K. Adam White
Published: October 16, 2019

---

 [  ](https://profiles.wordpress.org/kadamwhite/) [K. Adam White](https://profiles.wordpress.org/kadamwhite/)
3:13 pm _on_ October 16, 2019     
Tags: [5.3 ( 80 )](https://make.wordpress.org/core/tag/5-3/),
[dev-notes ( 648 )](https://make.wordpress.org/core/tag/dev-notes/), [rest-api ( 111 )](https://make.wordpress.org/core/tag/rest-api/)

# The REST API in WordPress 5.3

WordPress 5.3 contains a number of REST APIREST API The REST API is an acronym for
the RESTful Application Program Interface (API) that uses HTTP requests to GET, 
PUT, POST and DELETE data. It is how the front end of an application (think “phone
app” or “website”) can communicate with the data store (think “database” or “file
system”) [https://developer.wordpress.org/rest-api/](https://developer.wordpress.org/rest-api/)
improvements designed to make it easier and faster to work with APIAPI An API or
Application Programming Interface is a software intermediary that allows programs
to interact with each other and share data in limited, clearly defined ways. data
from the blockBlock Block is the abstract term used to describe units of markup 
that, composed together, form the content or layout of a webpage using the WordPress
editor. The idea combines concepts of what in the past may have achieved with shortcodes,
custom HTML, and embed discovery into a single consistent API and user experience.
editor or other client applications.

## Register Array & Object Metadata

As covered previously in [this developer note on array & object metadata](https://make.wordpress.org/core/2019/10/03/wp-5-3-supports-object-and-array-meta-types-in-the-rest-api/),
it is now possible to use `register_post_meta` & `register_term_meta` (as well as
the underlying method `register_meta`) to interact with complex metaMeta Meta is
a term that refers to the inside workings of a group. For us, this is the team that
works on internal WordPress sites like WordCamp Central and Make WordPress. values
as schema-validated JSONJSON JSON, or JavaScript Object Notation, is a minimal, 
readable format for structuring data. It is used primarily to transmit data between
a server and web application, as an alternative to XML. arrays or objects using 
the REST API. See the linked post for more details.

## Nested response filtering with _fields query parameter

[This developer note on the changes to the REST API’s `_fields=` query parameter](https://make.wordpress.org/core/2019/10/10/filtering-nested-rest-response-_fields-in-wp-5-3/)
shows how you may now filterFilter Filters are one of the two types of Hooks [https://codex.wordpress.org/Plugin_API/Hooks](https://codex.wordpress.org/Plugin_API/Hooks).
They provide a way for functions to modify data of other functions. They are the
counterpart to Actions. Unlike Actions, filters are meant to work in an isolated
manner, and should never have side effects such as affecting global variables and
output. your REST API response objects to include only specific nested properties
within the response body.

Ticketticket Created for both bug reports and feature development on the bug tracker.
[#42094](https://core.trac.wordpress.org/ticket/42094)

## Set drafts back to “floating date” status

Once a date has been set for a draft, it was previously impossible to set the post
back to showing “publish immediately” (also referred to as a “floating date,” where
the post will be dated whenever it is published). As of 5.3, passing `null` for 
a date value will unset the draft date and restore this floating state.

Ticket [#39953](https://core.trac.wordpress.org/ticket/39953)

## Faster Responses

We have introduced a caching wrapper around the generation of REST resource schema
objects, which initial testing has shown to yield up to a 30-40% performance increase
in large API responses. If you work with expensive or large REST API queries, things
should be quite a bit faster now. (Ticket [#47871](https://core.trac.wordpress.org/ticket/47871))

The REST API has also been improved to avoid unnecessary controller object instantiation(
[#45677](https://core.trac.wordpress.org/ticket/45677)) and to skip generation of
sample permalinks when that data is not requested ([#45605](https://core.trac.wordpress.org/ticket/45605)).

Please Note: if your team has existing performance benchmarking tooling for the 
REST API, please contact the component maintainers in the `#core-restapi` SlackSlack
Slack is a Collaborative Group Chat Platform [https://slack.com/](https://slack.com/).
The WordPress community has its own Slack Channel at [https://make.wordpress.org/chat/](https://make.wordpress.org/chat/)
channel; we very much desire to expand our metrics in this area.

## Additional Changes of Note

In addition to these key enhancements, there are a number of smaller improvements
to the REST API which may be of interest to developers.

 * It is no longer possible to DELETE a Revision resource using the REST API, as
   this behavior could break a post’s audit trail. Ticket [#43709](https://core.trac.wordpress.org/ticket/43709)
 * The `/search` endpoint will now correctly embed the full original body of each
   matched resource when passing the `_embed` query parameter. Ticket [#47684](https://core.trac.wordpress.org/ticket/47684)
 * `rest_do_request` and `rest_ensure_request` now accept a string API path, so 
   it is possible to instantiate a request in PHPPHP The web scripting language 
   in which WordPress is primarily architected. WordPress requires PHP 7.4 or higher
   using nothing more than the desired endpoint string, _e.g._
   `rest_do_request('/
   wp/v2/posts' );`Ticket [#40614](https://core.trac.wordpress.org/ticket/40614)
 * Creating or updating a Terms resource via the REST API now returns the updated
   object using the “edit” context. Ticket [#41411](https://core.trac.wordpress.org/ticket/41411)
 * It is now possible to edit a posted comment through the REST API when authenticating
   the request as a user with the `moderate_comments` capabilitycapability A **capability**
   is permission to perform one or more types of task. Checking if a user has a 
   capability is performed by the `current_user_can` function. Each user of a WordPress
   site might have some permissions but not others, depending on their role. For
   example, users who have the Author role usually have permission to edit their
   own posts (the “edit_posts” capability), but not permission to edit other users’
   posts (the “edit_others_posts” capability).. Previously a full editor- or adminadmin(
   and super admin)-level role was needed. Ticket [#47024](https://core.trac.wordpress.org/ticket/47024)
 * `rest_get_avatar_urls` now receives the entire User or Comment object, not just
   the object’s email address. Ticket [#40030](https://core.trac.wordpress.org/ticket/40030)

## Welcoming Timothy Jacobs as a REST API component maintainer

Last but not least, many of you have no doubt seen [@timothyblynjacobs](https://profiles.wordpress.org/timothyblynjacobs/)
active in tracTrac An open source project by Edgewall Software that serves as a 
bug tracker and project management tool for WordPress., slack, and community events.
Timothy has driven much of the momentum that resulted in the above improvements,
and I’m excited to (belatedly) announce that he has joined the REST API team as 
an official component maintainer. Thank you very much for your energy and dedication!

Thank you also to every other person who contributed to API changes this cycle; 
it’s the best version of the REST API yet, and we couldn’t have done it without 
the dozens of contributors who helped create, review and land these patches.

We’ve got some ambitious ideas about how we can make the REST API even better in
5.4. Interested in helping out, with code, docs, or triagetriage The act of evaluating
and sorting bug reports, in order to decide priority, severity, and other factors.?
Join us for weekly office hours, every week on Thursdays at 1800 UTC!

[#5-3](https://make.wordpress.org/core/tag/5-3/), [#dev-notes](https://make.wordpress.org/core/tag/dev-notes/),
[#rest-api](https://make.wordpress.org/core/tag/rest-api/)

### Share this:

 * [  Threads ](https://make.wordpress.org/core/2019/10/16/the-rest-api-in-wordpress-5-3/?share=threads)
 * [  Mastodon ](https://make.wordpress.org/core/2019/10/16/the-rest-api-in-wordpress-5-3/?share=mastodon)
 * [  Bluesky ](https://make.wordpress.org/core/2019/10/16/the-rest-api-in-wordpress-5-3/?share=bluesky)
 * [  X ](https://make.wordpress.org/core/2019/10/16/the-rest-api-in-wordpress-5-3/?share=x)
 * [  Facebook ](https://make.wordpress.org/core/2019/10/16/the-rest-api-in-wordpress-5-3/?share=facebook)
 * [  LinkedIn ](https://make.wordpress.org/core/2019/10/16/the-rest-api-in-wordpress-5-3/?share=linkedin)

 1. ![](https://secure.gravatar.com/avatar/eb40cfd30811ad59c8c2fd20976605cc81653e00e587bd5a89a218760faeb45f?
    s=32&d=mm&r=g)
 2.  [jayhill](https://profiles.wordpress.org/jayhill/)  2:04 pm _on_ October 17, 2019
 3. This is huge! Really looking forward to the performance gains.
 4.  * ![](https://secure.gravatar.com/avatar/cc1fa8fe3014e161d0e87594f94ec34245f540ac6a4b0b0ae43d6408da5f3af9?
       s=32&d=mm&r=g)
     *  [arindam4u](https://profiles.wordpress.org/arindam4u/)  3:33 pm _on_ November
       13, 2019
     * Looking forward to performance improvement for REST APIREST API The REST API
       is an acronym for the RESTful Application Program Interface (API) that uses 
       HTTP requests to GET, PUT, POST and DELETE data. It is how the front end of 
       an application (think “phone app” or “website”) can communicate with the data
       store (think “database” or “file system”)
        [https://developer.wordpress.org/rest-api/](https://developer.wordpress.org/rest-api/).
       Cheers.

Comments are closed.

# Post navigation

[← What’s new in Gutenberg? (16 October)](https://make.wordpress.org/core/2019/10/16/whats-new-in-gutenberg-16-october/)

[Core editor chat summary 16th October, 2019 →](https://make.wordpress.org/core/2019/10/16/core-editor-chat-summary-16th-october-2019/)