WordPress Gains a JSON REST API Plugin

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.

For instance, while the WordPress administrative interface is often praised for its ease of use and polish, a REST API would enable developers to more easily build web and mobile administrative clients of their own. A REST API could also make it easier for developers to more easily implement more complex Front-end functionality into their WordPress themes. With this in mind, the WP API includes a JavaScript reference client.

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.

Be sure to read the next Content Management article: Accellion Launches Kiteworks Secure Mobile Content Platform