Headless Theme: the one thing WordPress needs when you only want the backend

If you run WordPress as a headless CMS, your real website lives somewhere else: Astro, Next.js, whatever you like. WordPress is just where the content is written. But WordPress still insists on an active theme, and whichever one you leave active will happily serve a public site at your backend address.

I wanted a theme whose only job is to get out of the way. So I made one, and it is free.

What it does

Headless Theme is a very small WordPress theme.

  • Visitors who open your WordPress address are redirected to the frontend you choose.
  • The admin, the REST API and GraphQL keep working as normal, because the redirect only applies to ordinary page requests.
  • Anonymous comments are allowed through the REST API, which is useful when your frontend has a comment form.

There is one setting: Settings > Headless > Frontend URL. Leave it blank and the theme does nothing, so a fresh install never sends anyone anywhere until you say so.

Why it is not on WordPress.org

The WordPress.org Theme Directory expects a theme to display a working front end. A theme that redirects every page does the opposite of that, so I did not expect it to be accepted, and I did not try to submit it.

Install it

  1. Download headless-theme.zip from the latest release. You can check it against headless-theme.zip.sha256.
  2. In WordPress, go to Appearance > Themes > Add New > Upload Theme and activate it.
  3. Open Settings > Headless and enter your frontend URL.

Requirements

WordPress 6.0 or newer and PHP 8.1 or newer. It is licensed GPL-2.0-or-later.

If you hit a problem, open an issue.

Related Articles