WordPress and REST API

WordPress REST API

Last update:

Most of the past updates have been relatively minor and for many of us, There have not been much impact on us. WordPress 5.0 is different. Rather than adding minor improvements here and there, this release focuses entirely on two things:

  1. The new WordPress editor from Gutenberg
  2. The Twenty Nineteen WordPress Theme

Other than that, minor changes and bug fixes are only considered on a case-by-case basis. In reality, everything revolves around Gutenberg.

At first glance, it may not seem like much to change, but it could not be further from the truth! Gutenberg is an attempt to advance WordPress as a CMS in the field of website building. In fact, the WordPress team plans to move away from the old release cycle where we receive only small updates to receive only one where we will see bigger changes at once.

However, they also said that the plan is to have a minor update twice a month now that WordPress 5.0 is released. You can see what they have planned for Phase 2 of Gutenberg.

Table of Contents

Introduction

So what exactly is Gutenberg?
The Gutenberg manual does an excellent job of synthesis:

Gutenberg began as a transformation of the WordPress editor – a new interface to add, edit and manipulate content. It aims to facilitate the creation of rich and flexible content through a block-based user interface. All types of page components are represented as modular blocks, which means that they are accessible from a unified block menu, dropped anywhere on a page, and edited directly to create the custom layout that the user wants.

It is a modernization and fundamental transformation of the functioning of the WordPress experience, creating new opportunities for both users and developers. Gutenberg introduces new frameworks, interaction models, features and user experiences for WordPress…

In other words, in WordPress 5.0, you will not have the same classic WordPress editor or text editor that you’ve used in the last decade.

With the new Gutenberg advent the WordPress REST API will take a whole new dimension by offering new possibilities to developers.

In our case, our SEO agency and Magento development will benefit from this new API advances, allowing us to retrieve and manage WordPress content from external sites.

What is a Rest API?

For start, we must understand that an API is simply a “remote” access to a system. In the case of WordPress, it is access that allows access to database content and remote functionality.

An API (Applications Programming Interface) allows developers to design scripts that can authenticate on WordPress to create, modify, delete or retrieve content for the purpose of automating actions.

A Rest API is the ability to communicate with a site or application from another site. It is an opening to make possible the communication of data between applications.

The rest API is characterized by sending an HTTP request in the form of a URL scheme containing the commands that one wishes, and the answer is returned in JSON (Javascript Object Notation) or sometimes the XML format.

In order to secure the exchanges, the API provider gives you a unique API key.

How the Rest API changed WordPress?

The WordPress API is not new. Indeed, an API is enabled by default from WordPress 3.5. The novelty is that it is a new REST API, designed with today’s standards and fully integrated into the heart of WordPress without the need to install a plugin.

What must also be remembered is that this new API has been redesigned from scratch to be compatible with new uses of the web.

Some ideas and future revolutions to expect…

1. WordPress must face the competition

Even though the hosted version of WordPress is open source, Automattic, the team behind WordPress.com is still a business. It has to compete with all these other website creation solutions such as Wix and Squarespace.

If you look at WordPress’s market share from 2017 to 2018, year-over-year growth is about 17.3%. While this sounds great, take a look at some of the competitors. Squarespace increased by 180% and Wix by 233%.

And if the open source project and the activity are technically separate, they go hand in hand with each other. In other words, WordPress needs to catch up! Why do you think all page builder plugins are growing at an incredible rate? This is because people need easier ways to build their websites and write content. Even other publishing platforms like Medium and Ghost have a much better writing experience if you just want to blog.

2. Themes completely based on JS

They can do without the template engine, be completely managed in Javascript with the help of React JS for example.

An experimental theme proposed by Automattic: https://github.com/Automattic/Picard that you can try! There is still some way to go but the basics are laid. The revolution in progress. At WordCamp US Matt made it clear that JS was the future of WordPress and everyone should get started.

3. Single page applications

Single Pages Apps (SPA) are JavaScript-coded applications that work without full page reloads, so they are faster to load and more responsive. We do without PHP and company for the benefit of JS (React, Angular, or libraries like ionic, meteor …)

In summary WordPress would serve as the application base (as long as the application aims to disseminate information a minimum), and the theming based in Javascript by offering a completely responsive interface.

4. New WordPress admin panels

The WordPress admin tends to be a little slow, especially on big sites. Automattic, the company behind wordpress.com has decided to completely redo its backend interface with Node.js + the Rest API.

If you have a wordpress.com site you already have this new interface. You can test it on your site by installing jetpack and creating an account wp.com

On the other hand, as the needs become wider and more specific, tomorrow’s WordPress admin panel may have to adapt to the needs of its users. Imagine a restaurant: the site would display the menu, news on the blog, but also take reservations and manage orders, placement tables…

The server would not need the entire WP interface, just check reservations and table assignments. In this case a special admin panel (with the UX that goes with it) might be a good idea.

5. Mobile native applications

The most common use will be the creation of native iOs and Android mobile applications that retrieve site data via the Rest API for display in the app.

6. A CMS mobile backend

In line with the previous point, it would be possible to create a service that allows mobile app publishers to provide the power of WordPress to edit the content of their apps. That’s what Contentful does, but they do not do it with WordPress. So there is a business opportunity there.

7. News integration everywhere

The API would also allow, on any platform and library coded in Ruby, Python, Java, C++ … to integrate the latest news. This would expose WordPress content anywhere with ease. This would also allow more latitudes than a simple RSS integration.

8. A front-end content editor

Front-end content editors are increasingly coming to the fore. WordPress needs to join this non stop train. Sooner than later the Gutenberg editor and API evolution will support the entire process and make it easy to design and create content from our website front-end.

API evolution continues in WordPress 5

If we want to evolve in this new API silent revolution, we have to jump to the new WordPress 5 path. This new WordPress 5 main development line will face new future big changes that for sure will affect our current WordPress sites.

We can not stress enough the importance of testing current WordPress 5 and its future updates. This is a moment of big changes.

On each and every WordPress minor release, you really need to make sure all your plugins and themes work properly. If you have a custom solution, make sure to start contacting a WordPress developer to have it updated. It’s not something your WordPress web host can fix for you.

Our recommendation is to always create a copy of your site and test upgrades in your playground environment.

If your hosting provider doesn’t provide you the testing or staging environment, Contact us and learn more on how you can take advantage of this feature with wetopi.

You can sign-up and request a FREE migration (no up-front payments, no commitments, no credit card). You will have a copy of your site in a demo domain where you could test and check compatibility without breaking your production site.

Conclusion

The WordPress REST API has made a big jump and thanks to the new editor Gutenberg changes its going to continue evolving and taking relevance.

This REST API is really good for developers using WordPress. This API can allow startups to launch new services without necessarily having to install a plugin, to allow companies with multiple sites to easily cross content between them, to allow using WordPress as BackOffice of an application mobile for editing content, automating remote tasks on a WordPress, etc.


Guest Contributor
Junaid Ali Qureshi is an ecommerce entrepreneur with a passion for tech and marketing. Some of his current ventures include Elabelz.com, Progos Tech, Titan Tech and Smart Marketing. 

This might also interest you

See how Wetopi stacks up against your current hosting

Try before you buy.

With no obligation on your part, we’ll migrate a copy of your website:

No hidden small text.
No commitments.
No credit card.