Export and Import

Move a CanAI site design between sites as one JSON file, from wp-admin, MCP or WP-CLI.

What it is

An export is a portable JSON backup of your CanAI work. Use it to move a design from a staging site to production, keep a restore point before big changes, or copy a build to a second site.

An export contains:

Pages written as blocks (wpcanai/write-page, or create-page with format: "blocks") are not in the bundle yet.

The file records wpcanai_export_version (currently 1.1), the time and the source site URL.

Export and import from wp-admin

  1. Open CanAI → Tools → Export / Import.
  2. Under Export, click Download export file (.json).
  3. On the other site, open the same page, choose the file under Import, and click Preview import.
  4. Check the preview, then click Run import.

From an agent (MCP)

// wpcanai/export  (summary:true returns ids, titles and hashes, no content)
{ "summary": true }

// wpcanai/import  (dry_run previews without writing)
{ "json": "<the bundle as a string>", "dry_run": true }

import accepts the bundle as data (an object) or json (a string, tolerant of stray text around it).

From WP-CLI

wp wpcanai export /tmp/canai-export.json
wp wpcanai import /tmp/canai-export.json --dry-run
wp wpcanai import /tmp/canai-export.json

The dry run prints the counts (templates created and updated, pages updated and skipped) without touching the database.

How import matches things

If something looks wrong

Every skipped item comes back as a warning in the import result.

Related