Sidcraft document format

Every page you build is saved as one JSON document, not as shortcodes. This page describes that format field by field, publishes it as a JSON Schema, and explains what stays in WordPress if Sidcraft is ever switched off.

Updated . Covers Sidcraft 0.15.0 and later, document format version 2.8.

The JSON Schema

The format is published as a JSON Schema (draft 2020-12). Use it to validate documents, generate types, or write an importer or exporter.

WhereWhat you get
schema/sidcraft-document-2.8.schema.jsonThe schema for the free plugin's 62 units, format 2.8.
GET /wp-json/sidcraft-page-builder/v1/schemaThe schema for your own site, generated from the units installed there, so Sidcraft Pro and other add-on units are included. Public, cached for an hour.
wp sidcraft-page-builder schemaThe same, printed by WP-CLI.

Each unit type has its own settings definition in $defs, named settings_<type>, for example settings_heading. Settings every unit shares (spacing, background, border, position, motion, visibility) are described once in $defs/shared_settings. Fields starting with x- are Sidcraft notes: x-control is the editor control type, x-options the choices of a select, x-units the CSS units a slider accepts.

Where a page is stored

Post meta keyHolds
_sidsyn_document_dataThe document, as JSON. This is the source of truth.
_sidsyn_template_dataThe same format, for saved templates.
_sidsyn_document_hashHash of the document's normalized form. A save with an identical layout is detected with it and writes nothing.
_sidsyn_document_version, _sidsyn_document_updatedPlugin version and time of the last save.
_sidsyn_css_cacheCompiled CSS for the page. Rebuilt from the document when missing.
_sidsyn_autosave_dataAn unsaved editor draft, deleted on save.
_sidsyn_original_contentThe post content the page had before Sidcraft first wrote its readable copy (see below). Kept once.

Revisions are ordinary WordPress revisions. Each one carries a copy of the document meta, so restoring a revision restores the layout.

If Sidcraft is switched off

Every save that changes the layout also writes a clean copy of the page into the normal WordPress post content, as core blocks: headings, paragraphs, lists and separators become real Heading, Paragraph, List and Separator blocks; images, tables, quotes and figures become Custom HTML blocks. Builder classes, inline styles, scripts and forms are left out.

Turn this off under Settings → Advanced → Readable fallback content. To fill in pages built before 0.15.0, run wp sidcraft-page-builder fallback. To put back the content pages had before their first copy, run wp sidcraft-page-builder fallback --restore.

Content that only exists while the builder runs is not in the copy: forms, sliders that load slides with JavaScript, maps, video players, and query loops show the posts they listed at the time of the save.

The document

{
  "version": "2.8",
  "settings": { "template": "default", "page_width": "1140px" },
  "root":   [ /* nodes, top to bottom */ ],
  "header": [ /* optional page header */ ],
  "footer": [ /* optional page footer */ ]
}
FieldTypeMeaning
versionstringFormat version. Older documents are upgraded when read; a save always writes the current version.
rootarray of nodesThe page body.
header, footerarray of nodesA header and footer for this page only. Ignored while the theme provides its own header and footer.
settings.templatestringdefault, full_width or canvas (no theme header and footer).
settings.title, settings.body_class, settings.page_widthstringPage title override, extra body class, content width as a CSS length.

PHP stores an empty object as [], so "settings": [] means no settings.

A node

{
  "id": "hero_title",
  "type": "heading",
  "settings": { "text": "Welcome", "tag": "h1", "size": { "desktop": "48px", "mobile": "32px" } },
  "styles": { "base": {}, "hover": {} },
  "interactions": [],
  "editor_settings": { "label": "Main title", "locked": true },
  "children": []
}
FieldTypeMeaning
idstringStable and unique in the document: letters, digits, _ and -, up to 40 characters. Generated when missing. Used in CSS as #lb-node-{id} and for anchors, so keep it when you edit a document.
typestringA registered unit type such as container, heading or image. Nodes of unknown types are dropped on save.
settingsobjectValues for the unit's controls. Unknown keys are dropped on save; missing keys use the unit's defaults. See $defs/settings_<type>.
settings._dynamicobjectDynamic tag bindings, keyed by setting name, resolved when the page renders.
childrenarray of nodesOnly for units that hold other units (container, grid, inner section, nested tabs…).
slotstringFor children of Nested Tabs, Nested Accordion and Nested Toggle: the _id of the tab or item the child belongs to.
atomicbooleanXEditor element: prints a single HTML element styled by its classes.
stylesobjectXEditor style layer, CSS property → value, per state: base, hover, focus, active, focus_visible.
interactionsarrayMotion effects: kind, trigger, effect, duration and delay in seconds (0–30), easing, iteration (1–20), repeat, threshold (0–1).
editor_settingsobjectEditor-only state that never changes what visitors see: label (name in the Navigator), hidden (hidden on the editor canvas), locked (cannot be moved, edited or deleted until unlocked).
exposedarray of stringsOn component instances: the settings that may be overridden.

Setting values

ControlStored as
Text, textarea, code, iconString.
Rich text (wysiwyg)HTML string, limited to what WordPress allows in posts.
NumberNumber, or "" when empty. Clamped to the control's range.
SliderA number (in the control's default unit), a string with a unit such as "24px" or "50%", "auto", or {"size": 24, "unit": "px"}.
SwitchBoolean.
Select, chooseString, one of the listed options.
ColorHex, rgb()/hsl(), or a global color such as var(--lb-color-primary).
URLString. javascript:, vbscript: and data: links are removed.
MediaAttachment ID (integer).
GalleryComma-separated attachment IDs.
Repeater (tabs, list items, slides)Array of row objects. Each row has a stable _id plus its fields.
Group controls (typography, border, box shadow…)An object with that group's fields.

Responsive values. A responsive setting holds either one value for all screens or an object keyed by breakpoint: widescreen, desktop, laptop, tablet_extra, tablet, mobile_extra, mobile. A breakpoint without its own value inherits one, the same way it does in the editor's device preview.

Reading and writing documents

RequestDoes
GET /wp-json/sidcraft-page-builder/v1/document/{id}The document of post {id}. Needs permission to edit that post.
POST /wp-json/sidcraft-page-builder/v1/document/{id}Save a document (JSON body). It is checked and normalized exactly like an editor save, then returned.
GET …/document/{id}/export, POST …/document/{id}/importExport and import one page.
GET …/document/{id}/revisionsSaved revisions, which can be previewed and restored.

Always write through the API (or SidcraftPageBuilder\Document\DocumentManager::save() in PHP), not straight into post meta: saving normalizes values, records a revision, refreshes the CSS and the readable copy, and skips all of it when nothing changed.

Converting from Elementor

The converter reads Elementor's own stored JSON and produces a document in this format. It never changes or deletes the Elementor data. Under Sidcraft → Tools, choose Convert for review: each converted page waits in Sidcraft → Review Conversions next to the current page, side by side, with a content check (any text from the old page that is missing on the new one), the widgets that could not be converted, and the dynamic data that needs re-linking. Nothing changes until you click Accept, and an accepted page can be reverted to its Elementor layout from the same screen.

Large sites convert in small batches. Progress is saved after every page, so a closed browser or a timeout never loses work; click Resume, or run wp sidcraft-page-builder convert-batch --resume. A page that fails is left untouched and listed with the exact element where it stopped, for example section#4f2a > column#9c1d > slides#77ab.

Format versions

A newer plugin reads every older version and upgrades it in memory; the upgraded form is written the next time the page is saved. The current version is in the document's version field and in the schema's x-version. Keys a version does not know are dropped on save, so validate against the schema for the version you target.