keepcalculator

06 Numbers and Powers

Headless WordPress: What It Is & How to Host It

Card No. 06·71173 · Updated · Standard formula, shown below

Headless WordPress is a setup where WordPress manages content in the backend but does not display it on the frontend; instead, a separate application fetches that content via an API and renders it. To host it, you need two parts: a WordPress installation (on any standard PHP host) and a frontend application (on a static host or server), connected through the WordPress REST API or GraphQL. This article explains how the architecture works, what to consider when choosing hosts, and answers common questions about costs, security, and performance.

Background: Why Headless Exists

Traditional WordPress uses PHP to generate HTML pages on the server and sends them to the browser. This is simple and reliable, but it ties the content to the theme and server. Headless architecture separates content management from presentation: the WordPress admin remains the place where editors write posts, upload images, and manage metadata, but the frontend is a completely separate application—often built with React, Vue, or Next.js—that pulls content through an API.

The idea became popular in the mid-2010s as JavaScript frameworks matured and developers wanted faster, more interactive websites. By decoupling the frontend, you can use the same content for a website, a mobile app, a digital kiosk, or even a smartwatch, all from one WordPress backend. It also allows developers to choose the best tool for each job rather than being locked into WordPress’s theming system.

How Headless WordPress Works

In a headless setup, WordPress acts purely as a content repository. When you publish a post, WordPress stores it in its database and exposes it through an API. The frontend application requests that data, processes it, and renders it as HTML in the browser. The two main ways to access content are:

  • REST API: The default WordPress REST API returns JSON at endpoints like /wp-json/wp/v2/posts. It is built in, requires no extra plugins, and supports authentication for private content.
  • GraphQL: The WPGraphQL plugin adds a GraphQL endpoint, letting you query exactly the fields you need in one request, which can reduce payload size and round trips.

Because the frontend is separate, it can be hosted anywhere—on a CDN, a serverless platform, or a traditional web server. The WordPress backend still needs a server that runs PHP and MySQL, but it does not need to handle public traffic. This means you can put the WordPress admin behind a firewall or VPN, and the public never sees it.

Choosing a Hosting Setup

Hosting headless WordPress is not a single product; it is two hosting decisions. Here is what to consider for each side:

  1. WordPress backend host: Any host that supports PHP 7.4+ and MySQL works. Shared hosting is fine for low traffic, but managed WordPress hosts offer better caching and security. You need SSH access if you plan to use WP-CLI or custom deployment scripts.
  2. Frontend host: Since the frontend is static files or a server-rendered app, you can use a static site host (like Netlify or Vercel), a cloud server, or a CDN. The choice depends on whether you need server-side rendering, API routes, or edge functions.

For most projects, the simplest path is: WordPress on a managed host (for admin stability) and the frontend on a static host (for performance). You connect them by setting the frontend’s API URL to the WordPress site’s domain. If you need to keep the backend private, you can restrict access by IP or use a plugin like Application Passwords for authentication.

Common Problems and Misconceptions

One frequent misconception is that headless WordPress is automatically faster. In reality, the frontend can be very fast, but the API requests can be slow if you do not implement caching. Every time a visitor loads a page, the frontend may make several API calls, each hitting the WordPress server. Without caching, this can be slower than a traditional WordPress site.

Another issue is previews. In a traditional site, clicking “Preview” shows a draft with your theme. In headless, you must build a preview mechanism that fetches the draft via the API and renders it in your frontend. This requires extra development work and is a common pain point for editors.

Plugins that output HTML directly (like page builders or some SEO plugins) do not work in headless mode because they rely on the PHP rendering step. You must find alternative solutions or handle those features in the frontend.

Headless vs. Traditional WordPress

Here is a quick comparison to help you decide:

  • Performance: Headless can be faster if you cache API responses and use a CDN; traditional WordPress can be equally fast with good caching plugins.
  • Development speed: Traditional is faster to set up—install WordPress, pick a theme, add plugins. Headless requires custom frontend development.
  • Content editing: Both use the same WordPress admin, but headless may lose some live preview features.
  • Flexibility: Headless allows any frontend technology and multi-channel publishing; traditional is limited to WordPress themes.
  • Maintenance: Traditional has one system to update; headless has two (WordPress and the frontend framework).

If you are building a simple blog or a brochure site, traditional WordPress is usually the better choice. If you are building a web app, a mobile app, or a site with a highly custom user interface, headless makes sense.

Costs and Security Considerations

Hosting costs vary widely depending on the providers you choose. A basic shared host for WordPress can cost a few dollars per month, while a managed WordPress host might be $20–$50 per month. Static frontend hosting often has a free tier, but paid plans start around $10–$20 per month. For a small site, total costs can be under $30 per month; for a large enterprise, costs can exceed $500 per month due to higher traffic and managed services.

Security-wise, headless can be more secure because the WordPress backend is not exposed to the public. You can restrict access to the admin and API, reducing the attack surface. However, the frontend still needs to handle user input, and you must secure any API authentication tokens. Always use HTTPS, keep WordPress core and plugins updated, and use strong passwords. If you expose the API publicly, consider rate limiting to prevent abuse.

Alternatives to Headless WordPress

If headless WordPress feels too complex, there are other content platforms that are API-first by design:

  • Contentful: A headless CMS with a web interface and a robust API. It has no built-in frontend, similar to headless WordPress.
  • Strapi: An open-source headless CMS that you self-host. It offers a customizable admin panel and REST/GraphQL APIs.
  • Sanity: A real-time headless CMS with a structured content model and a JavaScript-based editor.
  • Ghost: A blogging platform that can be used headless, though it is primarily a full-stack CMS.

These alternatives may be easier to set up if you do not need WordPress’s plugin ecosystem. However, WordPress has a larger community and more documentation, which can be an advantage for finding help.

Frequently Asked Questions

Do I need a special WordPress host for headless?

No, any standard WordPress host works. The backend just needs to run PHP and MySQL. What matters is that the host allows API requests and has good uptime. You can even use a local development environment and a cheap shared host for production.

Can I use headless WordPress for an e-commerce site?

Yes, but it requires more work. WooCommerce has a REST API, but you need to handle cart, checkout, and payment processing on the frontend. This is more complex than using WooCommerce’s built-in templates. For simple stores, traditional WordPress is easier.

How do I handle SEO with headless WordPress?

You need to ensure the frontend renders meta tags, structured data, and sitemaps. Tools like Yoast SEO have headless support, or you can use a frontend library like Next.js that supports SEO out of the box. You also need to set up redirects and canonical URLs correctly.

Is headless WordPress good for beginners?

No, it is not recommended for beginners. It requires knowledge of HTML, CSS, JavaScript, and API concepts. If you are new to web development, start with traditional WordPress and learn the basics before going headless.

Can I switch from traditional to headless later?

Yes, but it is not trivial. You need to build a new frontend and migrate any theme-specific functionality. The content in the database remains the same, so you will not lose posts or pages, but you may need to adjust custom fields and menus.

What is the difference between headless and decoupled WordPress?

They are often used interchangeably, but technically “decoupled” refers to any separation of frontend and backend, while “headless” specifically means the frontend is a separate application that uses an API. In practice, they mean the same thing.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →