Published on October 15, 2022
Separation of Head from Body
In Scottsdale, Arizona, is a cryogenics facility where the heads of 168 deceased people sit frozen, awaiting the day when perhaps medical science can reverse fatality. So cleaving a head from the body is kind of a radical idea, and it might pay off one day, assuming you’d want to live through the potential hellscape of Earth, Year 2122.
But as far as WordPress goes, separating the head from the body is a concept that many web developers have toyed with, and here we’ll consider the upside and downside of this so-called “headless WordPress.” It isn’t a ghoulish creation, but it’s also not a panacea to solve some of the puzzles that WP can present. Since WP is the content-management system that handles around 40% all websites on our planet, what happens there has important implications.
Head, Meet Body
First, let’s do a little WP anatomy lesson. WordPress basically is bifurcated into two domains, the frontend (the head) and the backend (the body). The frontend is what users experience when they visit your website. It’s the images they see, it’s the CTA buttons they’ll click on, and it’s the forward face of your brand.
The backend is where the magic happens, where content is created and its presentation crafted. You build in the backend what users will see in the frontend. But it’s crucial to understand that these two domains are distinctly separate. For them to “speak” to each other, WordPress utilizes the REST API.
For the vast majority of WP users, this coupling of frontend to backend works extremely well, just as in most cases the head and body link up to sustain life. It’s a no-brainer. Why would you ever separate the head from the body? Wouldn’t that move pretty much spell doom?
Removing the Head
The key to “headless WordPress” resides in the REST API. This application interface can connect not only the backend to the frontend within WP, but the backend to a wide array of platforms that can serve as the frontend outside of WP. Hence, the moniker “headless WordPress.”
In addition to the bounteous creative landscape that a headless approach can bestow, there are possible security improvements, under the generic label of “Not All of Your Eggs Are in One Basket.” That basket, WordPress, makes a very inviting target to hackers, because it carries a ton of traffic and some sites aren’t well protected. According to one study, around 70% of all WP sites are vulnerable to hacking, and so one step you can take is to de-couple the frontend from the backend.
Yes, going headless can protect you. It doesn’t seem logical that having no head can make you safer, but in this case, it does. With just your frontend exposed to the nefarious criminals looking to hijack your site, your backend data is removed and separate, and thus immune from malware. DDoS attacks can only target one area at a time, since you have frontend and backend housed on different servers.
WordPress has been called a “monolith,” a term usually associated with cultures where innovation is curtailed. In this case, monolith refers to the PHP-coded templates that make WP easy to use for non-developers. The downside is that the content being generated is available only in HTML, and it’s non-static.
That means, each time a visitor comes to a new page, the browser basically ingests all the content off the web server, which can slow down load times. This so-called “server-side rendering” can sink your Google rank if load times fall too low. Going headless allows you to use the API to connect to static pages, where the load times are lightning fast.
One legitimate question persists, however. If going headless offers so many clear advantages, why aren’t more WP users stampeding for this solution? Ah, that’s because going headless has some serious drawbacks that you can’t ignore.
The bottom line is that if you aren’t a pretty polished developer, then going headless might be a bit too much to handle. Sure you can watch fifty YouTube tutorials on how to de-couple WP’s frontend and backend, and guess what? Now you’re on your own. Any bugs and kinks you’ll have to fix yourself, combing through blogs for ideas. This can eat up time you don’t have.
And WordPress works for developers and non-developers alike, and thus splitting the head from the body can lead to confusion if not everybody is up to speed. Clients won’t be happy if they can’t really access their own website.
The Queen of Hearts in Alice in Wonderland ordered: “Off with their heads!” When it comes to WordPress, unless you’re building a multi-channel platform or you can code in Python, you’re probably better off not decapitating the frontend. You might get twice the headaches even though you don’t have a head.
This post was last updated on November 3, 2022