“Headless WordPress” is a trending buzzword these days. As a fairly new technology, it’s constantly changing and growing. So how do you get started? What do you need to know to understand if Headless WordPress is right for your business? Let’s start at the beginning.
What is Headless WordPress?
Let’s start with Headless Website Architecture in general. A headless system is where content is stored in one server (the body), and delivered to another (the head) via an API. This framework is detailed in Figure I below, where the head handles all of the display and rendering, and the body handles delivery of data.
Figure I. The Headless Framework
Practically speaking, any website which gets its data from a WordPress install via the API is a headless WordPress website. So how did headless WordPress come to be? In 2016, at version 4.7, a REST API was shipped with WordPress for the first time. This allowed developers to request content from WordPress over the network rather than directly from the database.
This meant that a complete website could be built using any language to interact with WordPress. This removed from WordPress the entire feature set of rendering a website itself, which thus made WordPress “headless.”
What Are The Benefits Of Headless WordPress?
Let’s take a look at a few of the core benefits of headless WordPress.
Security
There are two big advantages here. One is that with headless WordPress, the only part of WordPress that the front end of the website really interacts with is the REST API, which is part of WordPress core. As mentioned in our post on WordPress security, WordPress core is the most tested, reviewed, and updated part of the entire WordPress platform. This reduces the number of possible attack vectors.
Additionally, the most common attack vector for WordPress is third party themes and plugins. With a traditional WordPress site, the potentially problematic PHP code from plugins and themes is on the same server as the head, whereas with headless, it should be on a different server, optimally blocked from access by the general web.
By effectively separating the front end of the website from the vulnerable parts of WordPress, you make the entire platform more secure.
Speed
The presentation layer of a traditional WordPress site is generated on demand, leveraging a database and lots of server side code. This is slower than a site made of plain HTML pages, and while good caching can mitigate the speed issues to a certain extent, the cache still needs to be rebuilt occasionally.
Headless WordPress sites generally have no server side work that goes on, so the server response time can be MUCH lower, making the site feel like it loads much faster.
The most common headless strategies these days involve static HTML files with Javascript in them to get the data. This can provide a tremendous speed improvement while at the same time decreasing the amount of system resources required to keep the site running properly. Increasing speed while decreasing costs is always a win.
This does require of course that the WordPress server has the resources it needs to respond to those requests, as well as having good caching policies. Yet, at the end of the day, it’s possible to make headless WordPress extraordinarily fast.
Platform Flexibility
Headless WordPress allows your development team to build the front end of the site (the head) in whatever technology they prefer. It could be Javascript and HTML, or React, or Laravel, or any language that can make remote requests (which is anything modern). This allows the team to be as efficient and powerful as possible.
If there isn’t a team, or the team isn’t sufficiently trained for a headless framework, an agency like Camber can be an excellent choice. They can do a technical analysis, determine the requirements, and choose the best programming environment for the needs.
Additionally, headless WordPress allows one WordPress site to serve multiple “heads.” So if your WordPress database has information about many different sports, you could make headless sites for each sport using one core WordPress site as the data source.
One last point to make is that you can create REST API endpoints yourself. The REST API is very extendable and can be made to work with just about any data in WordPress. So if you’re writing your own plugin, or you really need an existing plugin to have REST capabilities, you can add it yourself.
What Are The Disadvantages Of Headless WordPress?
There are two sides to every coin. Despite its many advantages, there are also some disadvantages to using headless WordPress. Let’s take a look at a few.
Loss of Plugin and Theme Availability
One of the superpowers of WordPress is the theme and plugin system. WordPress can be deeply extended to fulfill almost every need, but themes are exclusively about the front end, and plugins often impact the front end. Most of those plugins become useless in a headless environment.
There are several instances where this is not an issue. One is plugins that only impact either the admin area of WordPress or the data itself. Another is when a plugin makes itself available to the WordPress REST API. Yoast SEO is an excellent example of this, as they have a full REST API implementation. However, not all plugins have the knowledge or resources to make this happen.
SEO Complications
Given that you’re building the front end from scratch, you can add all the SEO capabilities you wish. That said, some headless platforms like React are actually single page apps, getting different data based on variables, so Google doesn’t know how to crawl the site properly. As long as you’re aware of the issue however, and take steps to mitigate it, it’s not a problem. One easy solution has already been mentioned: Yoast SEO has a REST API. Simply install it on the WordPress site and request the SEO information the same way you’re requesting all the other page information.
Maintaining Multiple Platforms
No matter what, a headless environment involves more than one platform. In our case, there’s the WordPress instance and then there’s perhaps a Javascript web app, a progressive web application, and however many other platforms you choose to have pulled from that WordPress instance. As traffic and heads increase, this gets more complicated. As long as you have a good system engineer, this isn’t inherently a problem, but if not done properly, it can get expensive and be a huge headache.
When To Choose Headless WordPress
Given that we shared both advantages and disadvantages of using Headless WordPress, let’s take a look at some use cases where leveraging Headless WordPress might be particularly beneficial for your business.
You Want The WordPress Editing Experience
An important first question to ask yourself is “Why should I use WordPress at all?” If you’re going to strip out half of the functionality of the entire app, that other half better have something pretty great. And in fact it does. The WordPress editing experience is very strong, and has some great plugins that can extend the multi-author aspect of it, like the PublishPress suite.
Additionally, given its ubiquity, it’s entirely possible that your content managers already have experience with the WordPress administrative interface.
You Want To Create An App (Or Apps) With The Same Data Source
Having WordPress as the body in a headless environment gives you a single source of truth for all your content. This allows you to build other content applications, like mobile apps in React Native, or tangential websites, each being updated all at once as the WordPress site is updated.
Your Needs Require Something Other Than PHP
WordPress is written in PHP, so a traditional WordPress setup is going to require that. But what if your needs are more suited to a different language? A headless setup allows things like data manipulation and presentation to be handled in whatever language is best for the project, while still letting WordPress (the body) do what it does best.
When Not To Choose Headless WordPress
In some instances, Headless WordPress may be just what you need to take your business to the next level. Yet, in others, it’s simply not the right fit and you shouldn’t try to force a round peg into a square hole. Here are some of the instances where you might steer clear of Headless WordPress.
If You’re New to Headless
Headless WordPress can be tricky and if you have an in-house team that’s never done it before, I assure you it will be painful. There should be lots of practice, betas, and testing underway. That said, this could be an excellent place for an agency to step in and either help, or simply build it outright for you. There’s a lot to be said for hiring a qualified expert to get the job done quickly and efficiently.
Because It’s Trendy
Headless is very popular right now, and any number of sales folk and excited young engineers will tell you it’s the way of the future — that you must go headless or be left behind. Headless has some very specific benefits, but if you don’t need those benefits, then it’s probably more work than it’s worth. Make sure you have a solid technical analysis of your needs before making the decision to go headless.
This is another place where a qualified agency could help. Let’s say you do have an excited young engineer who’s built ten headless sites and knows what they’re doing, but they lack long-term experience. An agency can review your project needs, and lend wisdom to your project. Then maybe you decide to build in-house, and maybe you don’t. But your decision will be informed and your future path will be a lot smoother.
When You’re Not Prepared For The Network Maintenance
We mentioned above that a headless setup requires at least two site configurations, and those really should be on separate servers. If you start scaling up and end up with three or four or ten heads, the task of understanding that whole network and not bringing it down like a house of cards becomes much larger. At scale, you want a dedicated engineer or service maintaining that.
If all you need is a single website that serves common assets like text and images, headless is probably not for you.
Key Takeaways
Headless websites are an exciting new technology. WordPress is a very powerful engine for it, so it makes a lot of sense that headless sites would be powered by WordPress.
Whether or not to use Headless WordPress is a complex question that should be answered by experienced people who know how to properly analyze your project’s technology requirements. If you’re interested in having Camber Creative discuss your project with you, reach out to our team to see if we’re the right fit for your business!
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Hexagon tumeric banjo bicycle rights. Deserunt commodo try-hard taiyaki marfa, live-edge cardigan voluptate pork belly hexagon laborum 90's poutine bespoke. Hella asymmetrical offal skateboard chia DIY actually mukbang flannel magna messenger bag 3 wolf moon letterpress minim coloring book. Voluptate vexillologist raclette pariatur vinyl. Post-ironic chicharrones irure jianbing incididunt mustache etsy organic PBR&B. Do cillum vaporware ennui venmo adaptogen cloud bread.
Sriracha tweed gatekeep ennui, messenger bag iceland JOMO magna in tumblr la croix.