This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.



A common request for the WP REST API is to limit the fields returned by the API. Modifying the underlying response objects is not recommended as this is likely to cause compatibility issues with other consumers of the API; this plugin instead allows consumers to specify the data that they need using the JMESPath query language for JSON to request only the data that they need from the response.


The plugin checks REST API requests for the _query parameter; if present it treates this as a JMESPath expression and applies it to the response, e.g.

curl -s --globoff  "[0:2].{id: id, title: title.rendered}"

could be used to select only the first two posts (with the [0:2] slice) and from there build an object with id and title fields selected from id and title.rendered.

The JMESPath site has an interactive tutorial and examples.


  1. Upload wp-login-nonce.php to the /wp-content/plugins/ directory or the /wp-content/mu-plugins/ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress if uploaded to /wp-content/plugins/.


December 3, 2016
JmesPath should be native PHP! This plugin should be native part of wp rest api!
November 30, 2016
Awesome plugin that makes JSON responses of WP-API a lot lighter and easier to work with. It's like GraphQL for WP.
September 3, 2016
Initially, I wanted to download and cache id, title, slug, and except, but was disappointed that the REST API v2 did not support that. This plugin allowed me to define a concise response payload. In my case, wp-json/wp/v2/posts?_query=[].{id: id, title: title.rendered, slug: slug, excerpt: excerpt.rendered} Brilliant! Thank you elyobo!
Read all 3 reviews

Contributors & Developers

“WP REST JMESPath” is open source software. The following people have contributed to this plugin.


Translate “WP REST JMESPath” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.