WordPress has maintained its popularity despite lacking a built-in REST API that enables external applications to easily interact with a WordPress-based website's content and users. That will likely soon change, however. A WordPress plug-in dubbed WP API extends the open source content management system with a full REST API that uses JSON and OAuth Authentication. WP API recently hit version 1.0, and its creator, Ryan McCue, is pushing to have it integrated into the WordPress core as early as the next major release, 4.0.
Using the WP API plug-in, developers can read, add and edit all of their WordPress content, including POST metadata, custom post types and comments, and the 1.0 release adds the ability to create, view, edit and DELETE user accounts. In effect, the WP API now makes it possible to fully manage a WordPress site and access all of its content via a REST API.
"Accessing data remotely is a common goal for many WordPress users and developers," McCue wrote. "The ability to access and update data remotely is used by desktop publishing software, mobile applications, and in-browser applications. These users need to be able to access WordPress data in a standardised, interoperable manner."
WordPress has an XML- RPC API, but that looks less and less ideal in a world dominated by REST and JSON. McCue points to complexities around generating and parsing XML, as well as the structure of the RPC calls the current API offers. Given the years-long decline in XML's popularity, a more thoughtfully designed REST API based on JSON seemingly offers a better path to the type of interoperability developers are seeking from WordPress.
WordPress as Platform
As the popularity of WordPress has grown, so too have the ways it's being used. No longer a simple content management system ideally suited to blogs, WordPress is more and more frequently used as an application Framework to build highly interactive websites. A REST API fits well into that paradigm and supports a variety of use cases.
More fundamentally, a developer-friendly REST API would allow developers to leverage WordPress purely as a back end, creating their own custom administrative and end user-facing interfaces. This may be the most exciting potential use of a new WordPress API, raising the possibility that WordPress could in the near future become a true content management platform and not just a content management system.