This plugin provides endpoints for the WordPress REST API for any posts, terms, options and more with detailed controls about API content.
The plugin adds endpoints for:
- posts of any post type including meta data
- terms of any taxonomy including meta data
- users including meta data
- theme mods
- sites (for multisite)
The data for all endpoints is heavily customizable through an admin interface, for example you can select which post types should be available and which meta data should be displayed for each post type.
Note that all endpoints except for the users endpoint are read-only since the plugin is designed for frontend-facing usage only. The user endpoint is an exception so that an authenticated user can modify his own data.
Installation and Setup
You can download the latest version from the WordPress plugin repository.
If you like, you can also use it as a must-use plugin by moving the directory into the
wp-content/mu-plugins directory and then moving the main file
wp-js-plugin.php from the plugin's directory to the must-use plugins root directory (i.e. from
wp-content/mu-plugins). Note that, while must-use plugins have the advantage that they cannot be disabled from the admin area, they cannot be updated through WordPress, so you're recommended to keep them up to date manually.
Once the plugin is activated, you will see a new submenu item "WP-JS API" under Settings through which you can manage the API endpoints.
Contributions and Bugs
If you have ideas on how to improve the plugin or if you discover a bug, I would appreciate if you shared them with me, right here on Github. In either case, please open a new issue here!
You can also contribute to the plugin by translating it. Simply visit translate.wordpress.org to get started.