Content & media
Headless WordPress & EmDash
WordPress or EmDash behind your site: connecting, entry pages, the companion plugins and headless mode.
A CMS source is a data source whose rows are a CMS’s posts or entries. You design their pages on the canvas, the site ships as static Astro, and the CMS stays where your editors work. Two are supported: EmDash, the CMS built on Astro, and WordPress.
Connecting a site
Under Content → Sources, press + and choose CMS, then EmDash or WordPress, and type the site’s address. sitereal looks for the companion plugin as you type, and lists the site’s collections — its post types, for WordPress — as soon as it can read them.
- EmDash answers nothing without a token. Press Connect with EmDash: EmDash’s admin opens with a code filled in, you approve once, and sitereal makes a token of its own that can only read content and schemas, named after the site so you can revoke it in EmDash. It is written to
.envasEMDASH_TOKEN. You can also paste a token under Credential. - WordPress needs no credential while its REST API answers published content to anybody, which it does unless a plugin or a login locks it. Then it takes a user and an application password, under Credential.
Each collection has a switch. Every one you switch on becomes a source of its own, picked in a Loop like any collection; the site’s screen keeps what they share — the address, the plugin and the credential.
What arrives
| In the CMS | In a row |
|---|---|
| Rich text | HTML — EmDash’s Portable Text included — with its pictures pointed at their copies when you copy pictures |
| Pictures | addresses, with the alt text beside them as <field>_alt |
| Dates | the date, and <field>_text written out in the site’s language |
| Categories and tags | names and slugs, {item.category} and {item.category_slugs} — for EmDash, the taxonomies you pick |
| References | the entry they point at, as { id, slug, title, url } |
| Authors | author, author_slug and author_bio for the byline, and authors for every one credited |
| SEO fields | meta_title, meta_description and meta_image, for an entry page’s head |
| Custom fields | plain keys — for WordPress, from ACF, Meta Box and ACPT alike |
A page per entry
Switch on Entry pages on a source and design one page, with {entry.title} where the title goes. It ships as a page per entry: in a folder (/journal/my-post), at the top level, or where the CMS had it, so links and search rankings survive the move. Every row then carries url, so a card links with {item.url}, and the sitemap lists every page.
Every build also writes /sitereal.json: where each entry is on the built site. The companion plugin reads it for headless mode, so an address is set once, on the source in sitereal.
Pictures, and a CMS that is down
- Copy pictures and files puts a source’s media into
public/media/sources/<slug>/before the build, so it is served from your domain and resized by the build. Every publish copies again first. - When the CMS cannot be reached, a build fails, uses the rows last cached on the build machine, or uses a copy committed beside the source — the only choice that works for a CMS no host can reach.
The companion plugins
Both plugins do the same three jobs, and the app reads them alike. They are free and optional: without one, the site still builds from the CMS at your next deploy.
- Publishing rebuilds the site. Paste your host’s deploy hook into the plugin’s settings — Vercel, Netlify, Cloudflare Pages, Coolify, any address. Changes are collected for a minute and built once.
- New posts show up in sitereal. The open app asks the plugin every half minute — every five seconds for a CMS on your computer — and fetches the rows again only when something changed.
- Headless mode keeps the CMS’s own pages out of search results — below.
| Plugin | Download | Install |
|---|---|---|
| sitereal for WordPress 0.3.0 | sitereal-wordpress.zip | In wp-admin: Plugins → Add New → Upload Plugin. Later versions arrive in wp-admin like any plugin’s update. |
| sitereal for EmDash 0.1.0 | sitereal-emdash.tgz | In the EmDash site’s folder, then in its astro.config — below. |
npm install https://sitereal.app/downloads/sitereal-emdash.tgzimport emdash from "emdash/astro";
import sitereal from "sitereal-emdash";
export default defineConfig({
integrations: [
emdash({
// …your database and storage
sandboxed: [sitereal],
// without a sandbox runner: plugins: [sitereal]
}),
],
});The EmDash plugin keeps the deploy hook encrypted, so the site needs EMDASH_ENCRYPTION_KEY set, and EmDash lets a plugin call only public addresses, so the hook has to be one. On a source’s screen sitereal shows whether the plugin is installed and what it reports, with the way to it when it is not.
Headless mode
One switch in the plugin’s settings. The CMS keeps working for your editors; visitors and search engines are pointed at the built site.
- WordPress: search engines are discouraged (your Reading setting comes back when you switch it off),
robots.txtsaysDisallow: /, and visitors of the theme are sent to the same page on the built site — never wp-admin, the login, the REST API, previews or a logged-in editor. View in wp-admin opens the built site. - EmDash: its pages say
noindex, followand name the built site’s page as canonical. A sandboxed plugin cannot redirect a visitor, so it does no more than that.
A CMS on your computer
A WordPress in LocalWP, DDEV, Valet or Herd, or an EmDash started with npm run dev, is a source like any other — over https too, when a local tool signed the certificate. No host can reach it, so it starts no build: keep a copy of the rows committed, copy the pictures, and publish from sitereal, which fetches the newest content, copies the pictures and pushes.
With an agent
Claude Code reads the same setup through the MCP: the guide’s sources topic covers CMS sources and the plugins, and sitereal_cms_companion says whether a site has its plugin and what it reports. An agent recommends the plugin and never installs it, and leaves the token and the deploy hook to you. See Agents & the MCP.