What is Headless WordPress(CMS)?
Tags: wordpress, webdev, beginners, writing
Published: 2022-05-24 13:48:08

## What is a headless CMS?
To understand what a headless CMS is, it helps to understand what traditional content management systems (CMSs) and what are they used for. The CMS manages everything, including the creation, reading, updating and deleting the content, as well as how it is displayed. The CMS approach of putting everything in one place like content, images, HTMl, CSS made it impossible to reuse the content because it was mixed with code.

Over the years it has become very difficult to organize content in web pages, making it impossible for the same content to adapt to other platforms.

One way to solve the limitation of traditional CMS is by making use of a headless CMS. A headless CMS is slightly different. It lets you manage content but does not care how the content is displayed. You can choose any front end of your choice that you want the content to be displayed from. Content that is housed in a headless CMS is delivered via APIs for seamless integration across different platforms.

Some traditional CMS can also be turned into a headless CMS that allows you to send content to a separate presentation layer(front end).

While headless CMS enables you to choose an appropriate front end of your choice, not all CMS solve an underlying problem: structuring the content so that it can be reused across different platforms.

## Headless Wordpress
A headless wordpress works differently; it removes the front end tools, leaving only the backend content management tools. It still allows you to upload, create, edit and delete content. But instead of pushing content directly to the front end, headless wordpress makes its resources available to a separate front end solution through [REST API](https://developer.wordpress.org/rest-api/).

By eliminating themes and instead sharing content via wordpress [REST API](https://developer.wordpress.org/rest-api/), any wordpress installation can be made headless.In a headless wordpress configuration, the content management tools are still available, but front end features like themes and block editor are not. Another front end tool handles how the user’s website looks.A headless wordpress is not always the best solution. However, there are times when it is an ideal solution.

### Benefits of headless Wordpress

1. **Front End Flexibility**: You can keep the “content management”  part of the Wordpress CMS and outsource the front end to virtually any other software of your choice as long as the front end tool can make API requests to the Wordpress API.

2. **Improved Performance**: In traditional Wordpress the page speed isn’t always faster and slow page load can hurt the end user experience. But with headless Wordpress, one potentially speeds up their page performance. For example,  you can fetch content from Wordpress and assemble it into static HTML pages, then ship the static pages to clients upon request.

3. **Improved Security**: If the front end is separated from the content, it will be much more difficult to locate and access the content directly through the website, as long as the backend server is sufficiently hidden.

### Limitation of headless Wordpress

1. **Complex Maintenance**: When opting for headless Wordpress, you have two systems to maintain, especially in terms of security and updates. In the long run, maintaining two different systems may lead to technical issues.
2. **Expense**: Maintaining complex environments may turn out to be expensive. It typically takes more development time to make changes.
3. **Less Wordpress Functionality**: Designing in the back end becomes difficult  because  live preview is no longer supported. A majority of wordpress plugins do not work.

## Next Steps
After weighing the pros and cons of headless Wordpress and if you decide it is worth pursuing, there are several ways to go about it.

1. **Wordpress Plugins**: this approach still requires the developer to be well versed in relevant programming languages and API. The main plugin that you can use is WPGraphQL, which lets you turn your WordPress installation into a GraphQL API. What this means is that you can create your own data schemas that any front-end client may use to retrieve data from your headless CMS.
2. **Coding it on our own**: While using a plugin makes it easier but doing it manually will give you more flexibility. Ever since REST API was introduced in Wordpress it has become a great tool to turn Wordpress into a headless CMS.
3. **Static Wordpress hosting**: while this approach is not free it has its own advantages. Some of the best static Wordpress hosts are [Shifter](https://www.getshifter.io/), [HardyPress](https://www.hardypress.com/), [NorthStack](https://pagely.com/)


In conclusion, I would definitely recommend using Wordpress as a headless CMS to develop smaller sites like blogs. Hope you find this article useful. :)