> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webstorio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate from WordPress

> Convert a WordPress site into a Webstorio CLI project with posts, pages, media, and WooCommerce products — via one AI prompt or the CLI.

Move an existing WordPress site into Webstorio. Most people should start with the **one-prompt AI agent** flow; use the CLI flags below when you want full control.

## Fastest path — one AI prompt

Paste a single prompt into your AI agent. The agent runs `webstorio migrate wordpress`, publishes, seeds content, and refines the layout.

**Full walkthrough + copy-paste prompt:** [Migrate WordPress with one AI prompt](https://docs.webstorio.com/developer/migrate-wordpress-with-ai.md)

## What gets migrated

| WordPress | Webstorio |
| - | - |
| Pages | React pages under `pages/` |
| Posts | CMS content type `blog_post` + fixtures in `data/` |
| Categories | CMS content categories |
| Media library / uploads | Files under `assets/wp/` (when downloaded) |
| Menus (when available) | Structural links in `_header` |
| WooCommerce products | Online Store products (via Woo REST) |

Themes, plugins, shortcodes, Contact Form 7, and WordPress users are **not** ported. Shortcodes are stripped and listed in `MIGRATION_REPORT.md`.

## Step 1 — Export or point at the live site

### Option A — WXR file (offline)

1. In WordPress admin open **Tools → Export**.
2. Choose **All content** and download the `.xml` file (WordPress eXtended RSS / WXR).

### Option B — Live REST URL

If the site is still online, pass `--url https://your-site.com`. The migrator reads the public WP REST API.

### WooCommerce products

WXR does not include a full product catalog. To import products, use `--url` with WooCommerce REST keys:

1. In WordPress: **WooCommerce → Settings → Advanced → REST API**
2. Create a key with **Read** permission
3. Pass `--woo-key` and `--woo-secret` (or set `WEBSTORIO_WOO_KEY` / `WEBSTORIO_WOO_SECRET`)

## Step 2 — Run the migrator

```bash theme={"dark"}
npx webstorio login
npx webstorio migrate wordpress \
  --from ./export.xml \
  --url https://your-site.com \
  --out ./my-site \
  --subdomain my-site \
  --woo-key ck_xxx \
  --woo-secret cs_xxx
```

Useful flags:

| Flag | Description |
| - | - |
| `--from <wxr.xml>` | Offline WXR export |
| `--url <https://site>` | Live WP REST (+ Woo) |
| `--out <dir>` | Output project directory (**required**) |
| `--include posts,pages,media,products` | Limit what to import |
| `--dry-run` | Parse and print a report without writing files |
| `--skip-media` | Keep remote media URLs (faster, fragile if the old host dies) |
| `--force` | Overwrite migration outputs in an existing project folder |

The command scaffolds a normal CLI project (`webstorio init` layout), writes pages/schemas/fixtures, downloads media, and adds:

* `MIGRATION_REPORT.md` — counts, warnings, permalink map
* `AGENTS.md` — instructions for an AI agent to refine the layout

## Step 3 — Push and seed

```bash theme={"dark"}
cd ./my-site
npm install
npx webstorio push --publish
npx webstorio seed
```

`push` syncs pages, features, branding, schemas, and assets. `seed` uploads CMS entries, categories, and store products (skipped if slugs already exist).

## Step 4 — Refine with AI

The migrator ships a **structural** site (readable content + nav), not a pixel-perfect theme clone. If you used the [one-prompt walkthrough](https://docs.webstorio.com/developer/migrate-wordpress-with-ai.md), refinement is already included.

Otherwise:

1. Open the project in your AI agent (or connect [MCP](https://docs.webstorio.com/developer/connect-mcp.md)).
2. Follow `AGENTS.md` — restyle header, footer, and homepage; keep `blog_post` field keys and product slugs stable.
3. Re-run `npx webstorio push` after TSX edits.

Suggested refine-only prompt:

> Refine this migrated WordPress site. Keep all CMS blog posts and store products. Improve the homepage hero, header nav styling, and typography. Avoid purple glow themes and dense card grids.

## Step 5 — Domain cutover

1. Add your custom domain in the Webstorio dashboard and complete DNS verification.
2. On the old host, set up redirects from legacy permalinks to the paths in `MIGRATION_REPORT.md` (for example `/hello-world/` → `/content/blog_post/hello-world`).
3. After traffic moves, retire the WordPress install.

## Troubleshooting

* **REST 401/404** — Confirm `/wp-json/wp/v2` is public (or reachable) on the source site.
* **No products** — WXR-only runs skip Woo products; add `--url` + Woo keys.
* **Plan limits** — Large catalogs may hit page/product/storage limits; see [Pricing](https://webstorio.com/pricing) or upgrade.
* **Broken images** — Re-run without `--skip-media`, or ensure the old host still serves `/wp-content/uploads`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.