When it comes to the world of CMSs, none are as prolific and well-known as WordPress. Love it or hate it, WP powers nearly a quarter of the modern web. While WP’s prowess as a platform for small, basic sites has long been established, its ability to handle complex, more professional applications has lagged behind competitors such as Drupal for several years now. However, the WordPress development landscape is ever-changing, and with some exciting new additions, WP has the potential to cement itself as a go-to back end for all kinds of web applications, large and small.
Enter WP’s new REST API. In its simplest terms, a REST API is a programming interface that allows a multitude of programming languages and clients to interact with a system, allowing them to fetch and change information. Here is a basic WP REST API endpoint:
By accessing this JSON list of posts on your WP install, you are free to do with them what you please, by whatever method works best for your application. There are already a number of libraries for various languages built to interface with this API. Most notable is the AngularJS library. Until recently, building a full AngularJS app with a WordPress back end was, for most, a pipe dream. This API makes it possible and truly brings WordPress development into the modern age of the Web.
At the core of the REST API is the exciting possibility of completely decoupling WordPress from its built-in PHP and templating system. This takes WordPress from a basic site platform to an ultra-flexible back-end solution capable of powering a vast array of web applications. A great example use of this functionality would be a custom admin panel. Clients frequently choose WordPress for its ease of use in updating content. However, WP’s built-in admin panel can leave a bit to be desired, or in some cases may present too many options for a basic user. Using the new REST API, you could easily build a custom panel with the exact array of options a client demands without overwhelming users with superfluous information. This API also opens up the potential for true mobile app integration with WP as a back end. By hitting WP API endpoints within your app, you can display information from a WP back end within a native mobile app environment.
These are just a few of the vast array of possibilities presented by the WP API. The API is currently on version 2, with consistent updates to come. While more robust systems like Drupal still lead the pack in terms of complex, enterprise solutions, this new level of flexibility may allow WP to establish itself as the de facto back end of modern web apps.