wp2next migrate
Moves a WordPress site to Next.js + Sanity on Vercel, in 12 phases that each end with a checkpoint.
| Synopsis | wp2next migrate [<local-site-slug> | <domain> | <folder>] (Claude desktop and Claude Code plugin: /wp2next:migrate; Codex: $wp2next migrate; Cursor: /wp2next migrate) |
|---|---|
| Changes code | Yes. It creates a new project folder and builds the site there |
| Touches outside services | Yes, from phase 7 on: Sanity (project, dataset, tokens, CORS origins, Studio deploy), GitHub (repo), Vercel (project, environment variables, domain), a Sanity webhook, and DNS at cutover. It asks before creating or changing each one, saying what, where and under which account. WordPress is only ever read |
| Reads | The Local site: its database (read-only queries; never user, comment, form-entry or order tables), theme files and the rendered pages; your user config |
| Writes | A new repo folder: wp2next.json, content/ (snapshot), assets/, the monorepo (apps/web, apps/studio, packages/sanity, packages/brand), the project CLAUDE.md, docs/analytics/, docs/brand-signoff.md, reports under .wp2next/. (HANDOFF.md is written by handoff, which phase 12 offers at the end) |
What it does
Step 0, the interview. Before it touches anything, it asks about the site in six short batches:
the site and its Local copy, hosting and goals, team, timing and accounts, the tracking stack and
consent banner, forms and compliance, and quality and build setup. Most answers come pre-filled from
your init defaults. It shows everything in one table and waits for your yes, then writes
wp2next.json in the new project folder.
The 12 phases. The next phase doesn't start until the current one's checkpoint passes.
| # | Phase | In plain words |
|---|---|---|
| 1 | Inventory | Lists pages, posts, menus, forms, tracking, consent banner, fonts, breakpoints and redirects; matches a builder playbook. Read-only |
| 2 | Snapshot | Saves a copy of every page's HTML and the media |
| 3 | Scaffold | Creates the project (Node 24, pnpm 11.10.0, Next.js 16, Sanity, brand package) |
| 4 | Parity baseline | Screenshots and measurements of WordPress at 390, 1440, 1920 and 2560 px, plus a Lighthouse baseline |
| 5 | Tokens and chrome | Colors, fonts, header, footer and tracking wiring; the brand guide seeded from WordPress |
| 6 | Content contract | The shapes the pages read from Sanity |
| 7 | Sanity | Creates the Sanity project, schema and Studio, and copies the content in. Asks before creating |
| 8 | Blocks and routes | Every WordPress URL answers, or redirects; metadata, sitemap, the contact form route; first seo parity run |
| 9 | Parity loop | Compares the new site with WordPress on a production build until you sign off |
| 10 | Mobile and quality | Phone and tablet layouts, design critique and accessibility audit |
| 11 | Infrastructure | GitHub repo, Vercel project and environment variables, the Sanity webhook; a real test submission per form. Asks before each resource |
| 12 | CLAUDE.md and cutover (go-live) | Client CLAUDE.md and cutover checklist; tracking on in Vercel Production (still noindex); gates A (compliance), B (Lighthouse) and C (SEO parity) on the production deployment with tracking on; NEXT_PUBLIC_SITE_INDEXABLE=true; domain and DNS; post-launch compliance re-scan; then it offers handoff and report. Gates: no open high compliance finding (A), no Accessibility or SEO Lighthouse drop vs WordPress (B), no unapproved SEO regression (C). Have whoever controls DNS on hand |
Modes. You pick one in the interview; it's saved as mode in wp2next.json:
pixel: the desktop site matches WordPress within 0.5 px; the mobile layout is redesigned.faithful: same look, checked by visual review instead of measurement.facelift: a new design with the same content, URLs, SEO, forms and tracking (seefacelift). There is no parity gate; content parity is checked instead.
Resuming. If the project folder already has a wp2next.json, migrate shows its table, asks
only for what's still blank, and picks up where status says the build is.
Secrets go only through the secret store (your password manager or another backend you chose in
init). They're never printed, never written to wp2next.json or .env.example, and never pasted
into chat.
Once phase 12 passes, it offers handoff and, once, report (opt-in). Along the way it suggests side
commands where they help: optimize after parity sign-off, tracking, seo parity and
compliance before launch, contribute for lessons learned.
Arguments and options
| Argument | Effect |
|---|---|
| (none) | Asks which Local site to move. With no user config yet, it first offers init |
<local-site-slug> | The Local site, for example acme for https://acme.local |
<domain> | The live domain; used to pre-fill the interview and find the Local copy |
<folder> | A Local site folder |
Typing wp2next with no command, or wp2next followed by a site, also runs migrate.
If the site isn't in Local yet, migrate pauses and points you to
Getting WordPress into Local. A REST-only route exists for
sites you can't copy, with limits.
Examples
/wp2next:migrate acme/wp2next:migrate acme$wp2next migrate acme/wp2next migrate acmewp2next migrate mysite.local: start from the Local host name.wp2next migrate example.com: start from the live domain.- Plain language: "move mysite.local to Next.js".
- Run it again in the same project folder to resume after a break.
Related
- Step 6: Rebuild your site (migrate) (what each pause asks you to approve) · Step 7: go live
- Concepts: phases, checkpoints, modes, the parity gate
status·seo·compliance·handoff·optimize- Guides: Accounts and plans · Forms and CRM · Tracking and search · Troubleshooting
- Agent instructions:
references/commands/migrate.md (external site)