In the years WordPress has been around, we’ve seen it grow from a small community project into one of the largest CMS platforms available; currently powering over 30% of the web. In that time, multiple iterations have risen and fallen, and various developments continue to make waves in the WordPress community – even official ones (Gutenberg, anyone?).
Headless WordPress is one of those developments. A form of Headless CMS, headless WordPress allows for expanded creative freedom by allowing you to adopt an alternate front-end suited to your needs.
This article will cover what headless WordPress is and some of the benefits and disadvantages of adopting this development style.
Take advantage of a better WordPress hosting solution with Nexcess.
What Is Headless WordPress?
WordPress is made up of three parts.
- A database
- A layer of PHP code
- A front-end
On standard WordPress sites, the layer of PHP code interacts with the database to create an admin interface, that content of which is then displayed through the front-end.
To use WordPress as a headless content management system, you chop off (or bypass) the user-facing front-end and replace it with something else.
This is possible because WordPress has a REST API that other applications can use to request posts, static files, and other content. In simple terms, the rest API allows for content to be converted into raw data for interpretation by alternate systems.
So it is possible to use WordPress as a headless content management system, but why would you want to?
The Benefits of Headless WordPress
WordPress, in its native form, is already incredibly flexible. However, there are several cases where WordPress doesn’t fit the requirements of a business. In these cases, adding headless capabilities adds to that flexibility in a way that can add value.
You may want to adopt a headless WordPress environment if you:
- You’re building a SaaS environment
- You have a smaller budget but want a customized user-facing website.
These are all great reasons for adopting headless WordPress. To really understand why, we need to look at each in a little more detail.
For this reason, headless WordPress gives front-end developers the powerful content management capabilities of WordPress, without asking them to create WordPress themes or code with WordPress’s API.
Nexcess Dev Sites allow you to create, develop, and push without fear.
Build a PWA With WordPress (SaaS)
Progressive web applications have taken the web development world by storm in the past year. They use modern web technologies to provide web applications with some of the abilities of native applications. As a result, WordPress renders its pages on the server, but there are advantages to rendering content in the browser.
A PWA can cache content from the API, rendering it instantly on page transitions; cached content works while the device is offline, and PWAs can use push notifications and other niceties typically reserved for native applications.
Build static sites With WordPress
Static websites are a popular alternative to client-rendered web apps. If content doesn’t change rapidly enough to justify dynamic page generation, a static site is a viable alternative. Tools like Gatsby and Next.js can pull content from backends and use them to create a static site. There is a Headless WordPress starter kit based on Next.js, but it is not for the faint of heart.
Use WordPress as the Backend for Anything
The Drawbacks Of Headless WordPress
A headless WordPress installation has many applications, but it isn’t for everyone. The WordPress front-end and WordPress themes are one of the reasons WordPress is so popular: themes make it possible to quickly get up-and-running with a fast and professional-looking site.
Building a separate front-end for WordPress is much more expensive than simply installing a WordPress theme. It’s really only an option for developers or businesses that are happy to hire a developer.
Headless WordPress is interesting, and it shows just how flexible WordPress has become, but it is likely that only a tiny portion of WordPress’s millions of users will have any need of a headless CMS.
Interested in more WordPress? Check out our guide to Gutenberg, where we cover how to get started with some of the new editor’s most powerful features.
Alternatively, are you looking to optimize WordPress for eCommerce? See if WooCommerce is the right choice before opting for headless WordPress.
Posted in: WordPress