WordPress REST API

The WordPress REST API: What it is and why you should care

WebsitesCategory
8 min read
Tom Ewer

If you are involved with WordPress professionally, you’re probably aware of the buzzword that has been floating around the WordPress sphere for the past months. I am, of course, talking about the WordPress REST API.

This new addition to WordPress core, whose two-phase implementation has started with version 4.4, is being hailed as the next big thing that will significantly shape the future of the platform.

The WordPress REST API is being hailed as the NEXT BIG THING for the WP platform.

However, like many others you might be unsure exactly what the WP REST API is and what its coming means for you as someone working with WordPress.

For that reason, it’s time to take a more detailed look at and gain better understanding of this revolutionary addition to the WordPress platform. To that end, in this article we will explore exactly what is behind the term WP REST API, what it can do, and what its arrival means for WordPress professionals.

Ready to start? Let’s get cracking!

Deconstructing the WP (JSON) REST API

Before we dive deeper into the capabilities of the WP REST API (or JSON REST API as it is also sometimes known), we first need to have a look at what is hidden behind the term.

WP REST API

What does API stand for?

API is short for Application Programming Interface. It’s a piece of software that functions as a connection between two different applications.

For example, if you use a third-party program to post to Twitter, you are taking advantage of the Twitter API connecting the platform to your software. The use of such APIs is very widespread on the Internet.

What about JSON?

The next acronym is short for JavaScript Object Notation. It describes a certain format for data exchange based on the JavaScript programming language.

JSON APIs have become common on the web due to the fact that most programming languages can easily convert their data to the JSON structure and vice versa. That way, an interface based on this format can be put between applications in different programming languages and act as an interpreter.

What Is REST?

Finally, REST is a stand-in for Representational State Transfer. It describes an HTTP-based style of building APIs that is:

  • lightweight
  • suitable for high data volume
  • highly compatible (because it is based on HTTP)
  • user friendly

In short, The WP (JSON) REST API is a connector between WordPress and other software applications which is characterized by universality and high compatibility.

If you’re hungry for more information, check out the WP REST API documentation. Now, we’re going to move on to the reason for its development.

Why does WordPress need the WP REST API?

The idea of an API for WordPress isn’t new. In fact, the platform already has an API to interact with themes, plugins and more. So why not use that one?

Because the existing WordPress API is outdated.

While it’s true that we already have a software interface in place, the truth is that it hasn’t aged particularly well. The existing API works nicely for WordPress-internal things, but using it to interact with software outside of the platform is cumbersome — something developers have lamented for years.

Because the new WP REST API is a universal connector.

As we have learned, a key consideration in the development of the API is universality. Because it is JSON based, the REST API enables WordPress to easily communicate with other websites and services.

While that might sound a bit mundane at first, the consequences are nothing short of revolutionary, because The WP REST API will enable WordPress to exchange content and data with other web properties regardless of the programming language they are written in.

The WordPress REST API is revolutionary because it enables WP to communicate with other web properties no matter what programming language they’re written in.

As long as the other side runs on the HTTP protocol (which is basically the entire known Internet), the two sides will be able to send requests in both directions. This gives almost any application a standardized way to interact with the WordPress platform.

It basically marks the beginning of WordPress becoming a full-scale application platform and opening it up to the rest of the Internet.

What does the emergence of the WP REST API mean for WordPress professionals?

Now that you understand the importance of the REST API, let’s look at what it means for us as WordPress users and developers.

JavaScript will become the new PHP

If you have been following the news, you might know that WordPress.com recently introduced the Calypso update.

The two most noteworthy takeaways from this release are that:

  • the re-imagined admin is written completely in JavaScript instead of HTML/PHP, and
  • it is 100% REST-API based.

You read that right. The thing we are talking about is already live on one of the largest websites on the Internet.

More differences to the old WordPress.com backend can be found in this handy infographic, courtesy of WordPress.com:

The move toward JavaScript is no accident. In the State of the Word address 2015, Matt Mullenweg repeatedly stressed the importance of both JavaScript and API-driven interfaces for the future of WordPress and the web in general, and urged the audience to “learn JavaScript, deeply.”

WordPress development will become simpler and more flexible.

As mentioned, JSON makes it easier to connect WordPress to things outside the WordPress universe. For developers, that means not also access to additional tools, but also that other programming languages are fair game for being integrated into WordPress.

While that was possible in limited ways in the past, the WP REST API makes it much easier than the old standard, provides more efficient and standardized ways to process this type of data, and enables the creation of custom endpoints.

As a consequence, advances in Ruby on Rails and other frameworks will become available for WordPress and plugins and themes will become more dynamically extendable.

Third-party content integration will get much easier.

Because the WP REST API enables WordPress to make nice with other technologies, it will be possible to source content from practically anywhere.

In effect, the platform can be used as a CMS for content from other web profiles and properties. On the flipside, pulling WordPress content into other applications and services becomes just as easy.

The WordPress backend will change forever.

As can be seen from the Calypso update, the WP REST API is able to take over all the responsibilities of the standard WordPress admin area.

Together with its function as a universal connector, this also means that the WordPress dashboard is ready to be reimagined or even replaced. Developers will be able to build admin areas or blogging clients more to their liking, completely separate from WordPress.

In fact, Matt Mullenweg imagines a future in which the WordPress admin area will be as easily replaceable as themes and plugins.

WordPress will truly enter the app market.

Another advantage of the JSON format is that it is natively supported by both iOS and Android. This opens the door for anyone looking to build a WordPress-based mobile app.

The ability to easily pull content through the API has the potential to turn WordPress into just another server for mobile clients. On the other hand, the platform will be capable to house other software solutions including JavaScript apps (see a first tutorial here).

This goes so far as Sam Hotchkiss speculating at WordCamp San Francisco 2014 about the possible emergence of a third-party app store for plugins.

There will be increased demand for WordPress developers.

Finally, the best news: The integration of the WP REST API also means more work opportunities for those experienced in working with WordPress. While the API will open up the platform to more developers from other disciplines, as it moves beyond its sphere, the demand for WordPress professionals is likely to rise.

If you don’t care about it for any other reason, this one should do the trick.

Conclusion

For many, the WP REST API has long been a bit of a Pandora’s Box, despite the amount of buzz surrounding it. By now, you will have gained a clearer understanding both of what hides behind the term and what the technology means for the future of WordPress.

Let us quickly reiterate the key points:

  • The WordPress REST API will take the place of the outdated WordPress API.
  • It will open the WordPress platform to technology outside the WordPress universe and vice versa.
  • Like the rest of the Internet, WordPress is moving towards JavaScript.
  • For developers, the API means more flexibility and extensibility.
  • WordPress and third-party content will be easier to integrate with one another.
  • The API opens up WordPress for new ways of content management.
  • Integrating the platform with the rest of the web is likely to result in increased demand for WordPress professionals.

Now it’s over to you! What do you think about the WP REST API? What are you excited about and where are you skeptical? Let us know in the comments section below!