WP REST API v2.0 (WP-API)
Access your WordPress site's data through an easy-to-use HTTP REST API.
The "develop" branch is version 2 which is "beta" but stable and recommended for production. Read the documentation to introduce yourself to endpoints, internal patterns, and implementation details.
The "master" branch represents the legacy version of the REST API.
The latest stable version is also available from the WordPress Plugin Directory.
WordPress is moving towards becoming a fully-fledged application framework, and we need new APIs. This project was born to create an easy-to-use, easy-to-understand and well-tested framework for creating these APIs, plus creating APIs for core.
This plugin provides an easy to use REST API, available via HTTP. Grab your site's data in simple JSON format, including users, posts, taxonomies and more. Retrieving or updating data is as simple as sending a HTTP request.
Want to get your site's posts? Simply send a
GET request to
Update user with ID 4? Send a
PUT request to
/wp-json/wp/v2/users/4. Get all
posts with the search term "awesome"?
It's that easy.
The WordPress REST API exposes a simple yet easy interface to WP Query, the posts API, post meta API, users API, revisions API and many more. Chances are, if you can do it with WordPress, the API will let you do it.
Check out our documentation for information on what's available in the API and how to use it. We've also got documentation on extending the API with extra data for plugin and theme developers!
The API code in this plugin is currently integrated into core WordPress in the trunk (latest) and 4.7 beta versions.
Development is no longer taking place in this repository - see WordPress core Trac instead.
Want to test out the WP REST API? The easiest way is just to install a recent development version of WordPress (for starters, try 4.7 beta 4).
You can also set up a development environment to work on the API code.
See the instructions for running the WordPress PHPUnit test suite to get started.
All tickets for the project are being tracked on WordPress core Trac.
Some previous issues can be found on the issue tracker for this repository; however, now that development of the API has moved to core Trac, new issues should not be filed here.
Want to get involved? Check out Contributing.md for details on submitting fixes and new features.
We take the security of the API extremely seriously. If you think you've found a security issue with the API (whether information disclosure, privilege escalation, or another issue), we'd appreciate responsible disclosure as soon as possible.
To report a security issue, you can either email
or file an issue on HackerOne. We will attempt to give an initial
response to security issues within 48 hours at most, however keep in mind that
the team is distributed across various timezones, and delays may occur as we
(Please note: For testing, you should install a copy of the project and WordPress on your own server. Do not test on servers you do not own.)