Headless WordPress: If you haven’t heard of it yet, you will soon. The new and unique way of utilizing the ever-adaptive CMS is exploding in popularity, with a growing list of examples in the wild. You may be tempted to jump right on the bandwagon. However, the use cases for headless WordPress are not unlimited.
So what is headless WordPress, and what about it has the WordPress community so interested?
In short, WordPress is based on PHP and a bit of Javascript, which you were stuck with in the past. Its back end and front end are connected, and for a long time they were inseparable. Make a change to the back end, and it will automatically alter the front of your website as well.
But what if you could detach the CMS part from all this? Keep your database and the sleek content management features, but push the actual content somewhere else? For example, a website coded in a language WordPress can’t even support, or a different platform entirely? A mobile app, even?
With a little imagination and the help of the REST API, anything is possible thanks to headless WordPress.
Obviously for some websites this is unnecessary and you can keep on using the traditional CMS no problem. But if you’re seeing potential for a specific solution in headless WordPress, it’s definitely worth looking into.
Do you publish content across multiple channels, or want to connect your WordPress site to an app? Is your site very complex, or do you want to optimize for speed? Headless WordPress might just be a good option for you.
Here are a few ways your website can put it to use.
Cross-Platform Publishers
Websites are no longer standalone platforms. A web of connections exists between social media, apps, and even other websites, and automation keeps it all running smoothly. You can now publish something and have it instantly pushed to dozens of different platforms across the web.
This is called multi-channel publishing and it’s a time-saving staple of big online businesses. Here are just a few examples of what you can do:
- Publish products to your site as well as online retailers like Amazon and eBay.
- Deliver content to partner sites.
- Ping your newsletter subscribers with info on a new post.
- Post automatically on social media when you publish new blog posts or pages.
- Save and structure content for physical printing.
- Work with the Internet of Things (smart devices).
Why Is This a Great Use Case for Headless WordPress?
WordPress has some plugins that can do simple versions of some of these, like posting your content to social media and newsletters. But for real multi-channel, cross-platform publishing, there’s no great alternative to headless WordPress. It’s perfect for using it as a launching pad to distribute your posts or other content across various channels.
All this works using the REST API, which connects your WordPress back end to other applications. An API is just an interface, like a controller, which you can configure to determine how your server handles data. With WordPress decoupled from its front end, you can use this controller to manage what platforms your site connects to and what it does with your data.
For instance, if you publish a blog post on WordPress, you can configure REST to take that post and publish it on an entirely different site. It takes some setup, but once you have it going, it all happens automatically.
In default WordPress, you have a closed system that can’t be separated from its front end. Decouple it and make good use of the REST API, and you can take cross-platform publishing into your own hands.
Making the most of this takes a bit of technological know-how and the ability to think up clever solutions to the issue of multi-channel publishing. But if you’re ready to build your website to meet these standards, headless WordPress would be good for you.
You’ve got all this content. Why let it go to waste? Publishing it over multiple platforms is the best way to get a good ROI for all your effort. Plus, once you have automate it with REST, it will be smooth sailing.
App Builders
One of the most prominent use cases for the cross-platform capabilities of headless WordPress is the ability to keep an entire app running using only a website and the REST API. Web app or mobile app, this is a great way to populate an application with content.
With traditional WordPress, this is all but impossible. Your back end is linked irreversibly to a front end website. This also means you’re stuck using PHP (so no mobile apps, and no cross-platform frameworks like React).
Detach it and you’re free to port the content in your back end wherever you want, and it will automatically update on your apps too. You can use whatever programming languages you want. No longer are you limited to PHP and Javascript. Just connect your headless WordPress instance to a mobile app and you’re good to go.
Besides making an app, there’s all sorts of other creative ways to use this feature. For example, you are not limited to mobile apps. There’s also web applications to think about. You could even connect WordPress to your in-store kiosk program and automatically update its product listings!
Also keep in mind that you can integrate Gutenberg into your app, as it’s built with React.
Not sure where to start with building a headless WordPress app? This advanced course does a great job running you through it. Note that you should already understand HTML, PHP, and Javascript, as well as the REST API.
Content Managers
What if you’ve got a website already but would like to use WordPress’ built-in database and content management systems? Maybe your existing site is incompatible. Or maybe you even want to try out WordPress with other web development languages like Django or Ruby on Rails.
All of these are great use cases for headless WordPress. Even those who dislike the platform tend to say the same thing about it: It’s a great CMS at its core, it just has other issues they’re not fond of.
Take away the front end and you have your easy-to-use admin panel, the back end post editor, and the robust content manager. You can even still make use of plugins like Advanced Custom Fields that primarily affect the back end! And with all that, you get to keep the flexibility of your website and the freedom to work with whatever platforms and programming languages you wish.
How Do You Do This?
It all works very similarly to publishing across multiple platforms. You just connect your front-end website(s) using the API, and when properly configured, it will handle all the rest. That means that you can publish posts and manage certain parts of your website all the same, even if it’s not built on PHP.
This is quite useful if you’re managing a large amount of content, especially if you want to publish it to several partner sites. While WordPress originally aims at indie authors and small businesses, it works quite well for bigger websites. The content management features are scalable and easy to use whether you have ten articles or ten thousand.
It’s no wonder businesses running all sorts of web apps are turning to headless WordPress. It makes it easy to manage your content and keep your site and database organized.
Performance & Security
Every website owner is always pushing for better performance, faster loading, and tighter security. That’s universal, no matter what you write or sell. And headless WordPress delivers.
Headless WordPress is Fast
First: Performance. The faster your loading speed, the better your SEO, the more traffic you get, and the more likely your visitors are to stick around.
WordPress is, of course, already fairly well optimized, but it can only go so far. There’s plenty of little bits of code that you may never even use, but bog down your website nonetheless. Decouple your CMS and those fall by the wayside.
That’s not automatic, of course, you’ll need to do some configuration. This guide to decoupling JSON in headless WordPress does a great job showing off how to do just that. Use of caching and SHORTINIT
will do wonders for your speed. The REST API can be quite slow, so make sure you’re minimizing it. Otherwise, you might actually see an increase in loading times.
In short, with a little configuration you’ll get to use WordPress as your CMS back end, but with a vastly faster front end.
Headless WordPress is Safe
Decoupled WordPress also comes with better security. Let’s be clear: For your typical small-scale business or single blogger, a simple WordPress installation with a good security plugin is the safest way to go. Using headless WordPress requires more developer experience and know-how when it comes to identifying security holes.
But if you know what you’re doing, it has a huge advantage: all those entry points for DDoS attacks and hacking attempts are all but out of reach. Your front end and back end are on entirely different servers. This makes it incredibly hard to breach.
This might not be a big deal for small websites, but for large and growing businesses, it can make all the difference. If you find your servers often under attack, headless WordPress will make the job of hackers a lot harder.
What Other Use Cases for Headless WordPress Are There?
Headless WordPress is everywhere at the moment, but is it right for you and your website? This trend is popular for a reason, but it’s definitely not for everyone. Here are a few reasons why headless WordPress might not be the solution for you:
- Small blogs and editorial sites will not benefit very much from the headless solution. It’s best for sites that put out a lot of content and need to automatically distribute it across a wide array of outlets.
- Headless WordPress use cases require building either a website, an app, or some other platform by yourself. No WYSIWYG builder to make things easy. If you’re not a skilled web developer or don’t have a team of them at your disposal, then stick with traditional WordPress.
- In addition, you’ll need developer skills to work with the REST API, the separate front and back end servers, and ensure you’re not letting any security holes slip through the cracks.
On the other hand, if you need a robust solution for multi-channel publishing, and are willing to do the maintenance and setup necessary to get it running fast and secure, headless WordPress can be a great choice for you.
Now that we’ve broken down some of the key features, you should hopefully have a better idea of whether or not headless WordPress can play a role in your case.
If you’re ready to begin, familiarize yourself with the REST API and start reading guides on how to make WordPress headless or how to build a web app with headless WordPress. There’s plenty of tutorials out there that can help walk you through it.
What are your favorite use cases for headless WordPress? Let us know in the comments!
No Comments