I built a visual editor for headless WordPress (free and open source)

2026-12-04来源 dev.toEnglish

At Pixelers, the web studio I run in France, we build most client sites with Next.js or Astro and use WordPress as the back office. Developers like it: the front end is fast, the code is ours, and WordPress stays on a subdomain nobody visits.

Editors like it a lot less.

In a classic WordPress site, you change a heading and you see the page. In a headless site, you fill in a form in wp-admin, save, wait for a build, open the site in another tab and look for your change. For a team that used to edit pages directly, that feels like a step back. And it usually ends with the agency getting emails like "can you change the text on the home page?".

What I wanted

I wanted editors to keep WordPress, and to edit the real site, not a preview built with a theme that looks a bit like it. And I didn't want to give up the front end we chose, or rebuild everything with a page builder.

So I built Leiho, a WordPress plugin.

How it works

The editor opens the real front end (Next.js, Astro, Nuxt, SvelteKit, React or plain HTML) inside wp-admin. They click a heading, an image or a button, change it in a side panel, and the page updates as they type. When it reads right, they publish.

On the developer side, you mark what is editable. A small bridge script, which only loads inside the editor, links each element on the page to its field in WordPress. The design stays in your code.

It reads the fields a site already has: ACF, ACF PRO, Secure Custom Fields or JetEngine. If you start from scratch, Leiho has its own content types. Nothing to migrate.

What came along the way

Once editing worked, the rest of the headless setup kept getting in the way, so the plugin grew:

  • a content API that serves the whole site in one request, with generated TypeScript types
  • publishing from wp-admin, through a build hook (Vercel, Netlify, Cloudflare Pages), GitHub Actions or Coolify
  • field-level translations
  • roles, with a simplified mode for editors who should only change text
  • an MCP server, so coding agents can read and write content
  • SEO for headless sites: schema.org data, llms.txt and a Markdown version of every page

Free, and staying free

Leiho is GPL and has no paid version: no seats, no usage limits. Your content stays in your own WordPress.

You can try it in your browser, on a real WordPress with a demo site, without installing anything: https://leiho.dev/try

The code is on GitHub: https://github.com/pixelersagency/leiho

I'd really like to hear from people running headless WordPress: what breaks for your editors today, and what's missing for your stack?

原文:https://www.a8q9.cn/en/article/i-built-a-visual-editor-for-headless-wordpress-free-and-open-source-06c059.html

相关文章