What are the WordPress REST API endpoints ?

WordPress is the king of online CMS. It rules the Web. WordPress introdued REST API since version 4.4. In WordPress version 4.7 the REST API was added into the core of WordPress. The WordPress can be used as a content producer and the front-end can be built using modern JavaScript based view framework. To interact with WordPress remotely or from external app, WordPress provides REST endpoints. Using those endpoints we can easily create content or get or update content of WordPress. Following are some endpoints provided by WordPress:

WordPress default REST endpoints

Resource Base Route
Posts /wp/v2/posts
Post Revisions /wp/v2/revisions
Categories /wp/v2/categories
Tags /wp/v2/tags
Pages /wp/v2/pages
Comments /wp/v2/comments
Taxonomies /wp/v2/taxonomies
Media /wp/v2/media
Users /wp/v2/users
Post Types /wp/v2/types
Post Statuses /wp/v2/statuses
Settings /wp/v2/settings

In the process of WordPress REST API call if we need the token based authentication we can use the following plugin. The following plugin allows us generate authentication token and validates the WordPress REST API endpoints:

JWT Authentication for WP REST API

Ofter we add custom post type or custom taxonomy to support the growing needs of the project. It is also possible to access those custom post types or taxonomy using WordPress REST API. There are couple ways to enable the endpoint of custom post type or taxonomy but the following plugins is really useful. We have used the following plugin to enable the endpoint of custom post type.

WP REST API Controller

Let say we have added a new post type called products then the WordPress REST API endpoint will be:

WordPress custom REST endpoints

Resource Base Route
Products /wp/v2/products

How to use WordPress REST API

Share