Headless CMS WordPress

Headless CMS: Use WordPress Only as a Backend

With a Content Management System (CMS) like WordPress, websites can be created easily and quickly - even without programming knowledge. Backend and frontend are directly linked to each other. This is practical as long as content is only to be played out via this one channel. However, websites are now only one medium of many. If different channels and end devices (e.g. mobile apps) are to be filled with content at the same time, a so-called headless CMS can be useful.

In this article we explain what a headless CMS actually is and whether WordPress can be used as a headless CMS . In addition, we provide you with an overview of the most important advantages and disadvantages of headless CMS or headless WordPress.

What is a headless CMS?

In a classic CMS, content is entered via an interface in the backend and organized in databases (usually MySQL). From there, the system links the content directly to themes or design templates and presents them in the frontend for visitors on the website.

A headless CMS is a content management system in which the backend and frontend are not linked. The term "headless" comes from the lack of a frontend. It is a modified form of a classic content management system, in which only the backend is used and the direct visual representation (the frontend) is omitted.

Instead, the content is output from the database via a so-called API (short for "Application Programming Interface"). This allows the content to be published completely dynamically on different devices and channels, centrally from a database. Websites and applications have access to the content via the interface, but control the display individually. A headless CMS is therefore only used to manage content and is decoupled from the display.

Headless vs. decoupled CMS

Many classic content management systems have evolved in recent years in such a way that they can be used both regularly with head and as headless CMS. This is referred to as a "Decoupled CMS", which basically still has a front end for the website, but at the same time is also accessible via API for various other channels.

Use WordPress like a headless CMS

WordPress can now also become a headless CMS. Strictly speaking, the so-called "Headless WordPress" is then also a Decoupled CMS: From version 4.7, a REST API is an integral part of the popular content management system.

This means, you can continue to use WordPress as usual "with all the trimmings" including template engine for your website. In addition, you can, if you want, also play out your content via the integrated interface, for example in an app or on other channels. In the following, we explain roughly how this works technically and which components are necessary.

The WordPress REST API

An API in general is quite loosely translated into German, a programming interface through which developers can request and transmit data. A REST API is a specific type of interface that has a relatively simple structure and can be used very flexibly. The abbreviation "REST" stands for "Representational State Transfer".

The WordPress REST API is now basically a piece of code that allows other systems to communicate with WordPress. This communication is done via HTTP requests (like PUT, GET, POST or DELETE).

Relevant in the context of Headless CMS are mainly the GET requests, i.e. requests with which certain content is read from the CMS. What exactly is to be read out is defined via URLs.

For example, if you want the REST API to output all blog posts, this would be the command:

GET http://domain.com/wp-json/wp/v2/posts/

The requests are entered for example via the command line, in WordPress this is called WP-CLI. Depending on which data is to be queried, the URL is simply supplemented with appropriate parameters.

WP-CLI at Raidboxes

At Raidboxes, WP-CLI is already pre-installed when you create a new Box (i.e. a WordPress website) via the Raidboxes Dashboard. But you can also connect to Raidboxes via SSH terminal and use WP-CLI. Read more about this in our article The perfect WordPress development workflow with Git & SSH.

Raw, structured data as a basis

Data that is requested via the WordPress REST API is always delivered in JSON format. "JSON" stands for "JavaScript Object Notation". This is a standardized, text-based format for representing structured data, based on JavaScript syntax. It is often used to transfer data in web applications (e.g. to send data from a server to the client so that it can be displayed on a website).

Basically, when you query the REST API, it structures the content you've entered into your CMS and makes it readable as raw information in JSON format for other websites and applications. They can then process or display the information.

A customized front end

The frontend (the presentation) is clearly separated from the backend (the WordPress interface, through which the content is entered in a structured way). In the frontend, the content from the CMS is rendered, i.e. assembled and displayed. WordPress is only used as a database, from which the necessary information is retrieved via the REST API.

The designs for the frontend (or multiple frontends) are developed separately, independently of the CMS. They can be written in any programming language and use any technology. JavaScript frameworks like React, Angular or Vue.js are particularly common.

Note

Using WordPress as a headless CMS and using it to populate a website (or even multiple applications) with content involves advanced programming and development work. Therefore, there are no direct instructions on how to best use Headless WordPress. The concrete implementation is ultimately up to you (or your developers).

Why should you use headless WordPress? The advantages

Now you're probably asking yourself why you should use WordPress Headless, when it also works great without. We have summarized the most important advantages here:

  • Multiple channels at once: You can scale a headless CMS virtually without limits. Any number of frontends can access the information in the backend via the API-based system, and you can basically display your content anywhere and on any platform - whether on a website or in mobile apps. Augmented reality, virtual reality and the Internet of Things (IoT) are also conceivable.
  • Time saver In a headless CMS, you manage your content centrally from one place. Adjustments, additions or corrections only have to be made once and are then automatically visible on all channels. This saves time that you can invest in creative projects.
  • More flexible design: With a headless WordPress you can design and structure your frontend even more freely. You are no longer bound to the possibilities of the classic CMS and the programming language is not predefined. So you have much more leeway in the design and can also implement elaborate websites.
  • Faster performance: Since your headless WordPress consists of only a database and REST API calls, your system becomes leaner and faster. Additionally, you can develop your frontend with modern frameworks for an improved user experience.
  • Increased security: Because your content is detached from the frontend in the database, it is less vulnerable to problems and there is less of a target for malicious access and DDoS attacks, for example.

These advantages are particularly relevant for developers, who otherwise struggle with static CMS and limited design options.

What are the disadvantages of headless CMS?

At the same time, a headless CMS or headless WordPress is also associated with some disadvantages that should not go unmentioned at this point:

  • The presentation cannot be directly influenced: What is a great advantage for developers becomes a limitation when entering the content - at least if you want to make not only textual but also visual adjustments. For non-developers there is usually hardly any room for artistic freedom.
  • Inconsistent User Experience: if you use multiple platforms to distribute your content and the presentation is not consistent across all channels, it can look inconsistent to the users and degrade the user experience.
  • Double maintenance: A headless WordPress always runs separately from the frontend. This means you basically have to maintain and service two instances. This can be associated with additional time.
  • Higher cost: It is more expensive to set up a headless WordPress. It is also more costly to maintain, as you may need several developers to maintain two different instances.
  • Not all functions: Headless WordPress does not support one-to-one the same functions as WordPress in the classic form. For example, the WYSIWYG editor or Live Preview will not work if the frontend is separate. In general, any plugin, which affects the frontend, is not usable.

"*" indicates required fields

I would like to subscribe to the newsletter to be informed about new blog articles, ebooks, features and news about WordPress. I can withdraw my consent at any time. Please note our Privacy Policy.
This field is for validation and should not be changed.

Conclusion: For whom is headless WordPress suitable?

It's hard to imagine the world of online content without WordPress. This will probably not change much in the future. What may change is the way WordPress is used: classically or as a headless CMS. Headless WordPress has many advantages, but is not suitable for all purposes and users.

Whether your project is suitable for a headless CMS depends primarily on what you intend to do. A headless WordPress might be suitable if:

  • you want to implement a very individual design on your website, which cannot be easily realized with WordPress themes and page builders.
  • you are planning a large project and want to present your content on different platforms and devices (e.g. on the website and in your own app).
  • you have programming skills yourself or have the ability to work with developers to build your own solution.

Headless WordPress is less suitable when:

  • you only want to make your content visible on a website (e.g. a blog) and don't need any particularly unusual design elements.
  • you have a small budget and your website needs frequent adjustments and maintenance.
  • you are beginner, have no experience with development and programming and will create and manage your website alone.

In conclusion, if you just want to run a "normal" website and fill it with content, you are better off with classic WordPress, possibly combined with page builders for more design freedom. However, if you want to be present on different channels and have programming skills (or the resources for developers), you can consider using WordPress headless.

Get started easily with WordPress

You prefer to use WordPress in a classic way? With Raidboxes you can create your WordPress website in no time - and you don't have to worry about your WordPress hosting. We take care of backups, updates and more for you. Start now for free or get advice from our WordPress experts.

Frequently asked questions about headless CMS WordPress

What is headless WordPress?

Headless WordPress is an advanced version of the popular content management system, using only the WordPress backend and database. So the display on the website is not directly from the CMS, but via a separate frontend.

What are the headless CMSs?

There are several providers on the market that specialize in headless CMS. Among the best known are Directus, Strapi, Cockpit, Contentful and Storyblok. In addition, many providers of classic CMS are now following suit and equipping their systems with a REST API. Therefore, WordPress can now also be used headless.

How does a headless CMS work?

In a headless CMS, the backend and frontend are not linked. This means that the system does not visually play out the content entered in the backend directly on the website. Instead, the content from the database is made available via REST API. Any website or app can then use the interface to retrieve and display the centrally entered content.

Your questions about WordPress as a headless CMS

What questions do you have regarding WordPress as a headless CMS? Feel free to use the comment function. You want to be informed about further posts about WordPress and WooCommerce? Then follow us on LinkedIn, Facebook, Twitter or via our newsletter.

Did you like the article?

With your rating you help us to improve our content even further.

Write a comment

Your e-mail address will not be published. Required fields are marked with *