Book a 20-min call

How to Migrate a Website with Claude Code (Step by Step)

The step by step method we use to move WordPress, Webflow, Wix and Squarespace sites with Claude Code: URL inventory, a rules file, copyable prompts, redirects, an SEO match check, DNS cutover and 30 days of monitoring.

Harish Malhi - founder of GoodspeedHarish MalhiFounder of GoodspeedUpdated13 min read

Written for: Claude Code 2.1, Next.js 16.4, Astro 7.4, Wrangler 4.170, Node.js 24

Why move at all

Most company websites hold the company back. A launch waits two weeks for a developer. The CMS was set up by someone who left. Plugins nobody can explain run next to the tracking. And now buyers ask ChatGPT, Claude and Perplexity before they ever visit, and those engines quote the cleanest page they can read, which is often a competitor's.

Claude Code changes the cost of fixing that. It can read a whole site, rebuild templates, write import scripts and generate a redirects file in an afternoon. What it does not change is what makes a migration safe: knowing every URL that earns traffic, moving content without rewriting it, and proving every old address still lands somewhere sensible. This guide is the method we use at Goodspeed, written so you can run it yourself.

The destination is a choice, not a default. We build in Framer when a marketing team wants to edit on a canvas, and in code (Next.js or Astro, with Sanity when editors need a CMS) when the site sits close to a product or carries a lot of content. The method below works for all of them.

What you need before you start

WhatWhyCost
Claude Code on a paid Claude planDoes the building, checking and fixing from a terminalYour Claude subscription
A GitHub repositoryEvery change saved, reviewed and reversibleFree
A host: Vercel, Cloudflare Pages or FramerPreview links for every change, then the live siteFree to start on Vercel and Cloudflare
Admin access to the old platformExports, redirects already set, form settingsWhat you pay today
Google Search Console and analyticsWhich pages earn traffic, and proof nothing droppedFree
Access to your domain's DNSThe cutover at the endWhat you pay today

Every step below carries one of three labels. You do this means logins, exports, payments and anything public facing. Claude does this means you paste a prompt into Claude Code and check the result. Claude drafts, you sign off means the decision stays with you. Claude never needs your passwords: you export, it works on files.

Step 1: Build the URL inventory

Claude drafts, you sign off

The URL list is the migration. Every line on it either lands at the same address on the new site or gets a 301 redirect to its closest match, and at the end you tick it off. Sitemaps miss pages, so add the URLs that earn clicks or links but were never in one.

You do this: export the Pages report from Search Console (last 16 months, clicks and impressions) and, if you have one, a backlinks export from Ahrefs or Semrush. Save them as migration/gsc-pages.csv and migration/backlinks.csv.

Terminal

mkdir -p migration && cd migration
# Every URL the sitemap lists (follow a sitemap index one level down)
curl -s https://example.com/sitemap.xml | grep -o '<loc>[^<]*' | sed 's/<loc>//' > sitemap-urls.txt
wc -l sitemap-urls.txt

Prompt for Claude Code

Read migration/sitemap-urls.txt, migration/gsc-pages.csv and migration/backlinks.csv.
Build migration/urls.csv with one row per unique URL and these columns:
url, source (sitemap, gsc, backlinks), clicks_16m, referring_domains, status_now, title_now.
Fetch each URL once to fill status_now and title_now, with a 1 second delay between requests.
Flag any URL that has clicks or links but is not in the sitemap. Do not change anything else.

Sort by clicks and referring domains. The top fifty rows are where a mistake costs real money, so they get checked by hand at the end.

Step 2: Get the content out

You do this

Content and design leave by different doors. Take the content through the platform's export, and rebuild the design from the live site. Download every image now, because image links on the old platform's CDN often break when the plan ends.

WordPress

Terminal

# Posts as JSON, 100 per request (repeat with page=2, 3 and so on)
curl -s "https://example.com/wp-json/wp/v2/posts?per_page=100&page=1" > posts-1.json
# Or the full XML export from Tools > Export, or with WP-CLI
wp export --dir=./export

Titles and descriptions from Yoast or Rank Math sit in post meta, not in the post body. Export them too, or every title will change silently.

Webflow

Export each CMS collection as CSV from the Designer; rich text arrives as HTML. For large sites, the Webflow Data API returns the same items as JSON, 100 per request. Webflow's code export needs a paid Workspace plan and carries no CMS content, so rebuild static pages from the live site instead. Copy the redirects already set in site settings, or old links break twice.

Wix

Wix has no page export, so the URL inventory is your only full record of the site. Blog posts can be read from /blog-feed.xml, CMS collections export to CSV, and images download from Wix's media servers.

Squarespace and Framer

Squarespace exports blog posts as a WordPress style XML file from Settings; pages are rebuilt from the live site. Framer CMS collections export as CSV, and static pages are rebuilt the same way.

See how each route handles this in detail: WordPress to Next.js, Webflow to Astro, Wix to Astro.

Step 3: Write the migration rules file

You do this

Write this before the first prompt. Claude Code reads CLAUDE.md at the start of every session, and it is the difference between a move and a rewrite. The failure mode in an AI migration is not broken code. It is content that quietly goes missing: a field treated as optional, an article summarised instead of moved, alt text dropped.

CLAUDE.md

# CLAUDE.md: migration rules

## Source of truth
- The live site and the files in /migration are the source of truth for content.
- Never rewrite, shorten, summarise or "improve" copy while moving it. Move it exactly. Edits come later, in separate commits.
- migration/urls.csv lists every URL that must survive. Each one resolves on the new site at the same path, or appears in migration/redirects.csv.

## How to work
- One template at a time. Build it, show me the preview link, wait for my sign off.
- Use the shared components in /components. No one-off styles per page.
- Keep every title, meta description, canonical, H1, image alt text and published date exactly as on the old page.
- Small commits with clear messages. Never commit to main.

## Never
- Never invent content, testimonials, numbers or links.
- Never delete a page because it looks unimportant. Ask.
- Never skip a field or a page silently. Write it to migration/MIGRATION-LOG.md with the reason.

## Commands
- Install: npm install
- Dev server: npm run dev
- Checks: npm run build && npm run lint

Every time Claude does something you did not want and a sentence would have stopped it, add the sentence.

Step 4: Pick the stack

You do this

If this matters mostPick
Your marketing team changes pages every week, without a developerFramer
The site shares logins, data or components with your productNext.js
Hundreds of structured pages, many editors or languagesNext.js with Sanity
A content heavy site where speed and search come firstAstro

Every option can be read and cited by AI assistants if the HTML is clean and the structured data is right, so pick on who edits the site and what it connects to. Our website migration page compares every route.

Step 5: Rebuild the templates, then the pages

Claude does this

Start a repository, connect it to your host so every push gets a preview link, and build templates before pages: home, a service page, a blog post, a listing. Most sites have fewer than ten templates and hundreds of pages.

Terminal

# Next.js
npx create-next-app@latest new-site
# or Astro
npm create astro@latest new-site
cd new-site && git init && claude

Prompt for Claude Code

Read CLAUDE.md and migration/urls.csv.
Group the URLs into templates by layout (for example home, service, blog post, blog index, case study, legal).
List the templates with three example URLs each and the content fields each one needs. Do not build anything yet.

Prompt for Claude Code

Build the blog post template from https://example.com/blog/example-post, using the shared components.
Match the heading structure, the order of content and every metadata tag on the live page.
Then open the preview and list anything on the live page you could not reproduce.

Read the diff before you merge, especially when it looks boring. The pages Claude found hard, long articles with embeds, tables and forms, are where it skips parts.

Step 6: Move the content

Claude does this

Import content with a script you can run twice, not by hand. If an editor publishes on the old site during the build, you rerun it.

Prompt for Claude Code

Write scripts/import.mjs that reads the exports in /migration and writes each item into the content folder (or the CMS through its API).
Keep slugs, published dates, authors, categories and alt text. Download every image to /public/media and rewrite the links.
It must be safe to run twice. At the end, print item counts per collection next to the counts in the export,
and write anything it could not import to migration/MIGRATION-LOG.md.

Compare the counts. A collection with 412 items in the export and 409 on the new site has three missing pages, and the log should say which.

Step 7: Build the redirect map

Claude drafts, you sign off

Every URL in the inventory gets a row: same path, or a 301 to its closest match. Not the home page. A redirect to the home page is treated by Google much like a missing page.

Prompt for Claude Code

Compare migration/urls.csv with the routes the new site builds.
Write migration/redirects.csv with columns old_url, new_url, reason for every URL whose path changes.
Use patterns for repeated paths (for example /post/:slug to /blog/:slug) and list one-off pages individually.
Never point a redirect at the home page. Mark anything without a clear match as NEEDS DECISION.

You sign off every NEEDS DECISION row and the top fifty URLs by traffic. Then Claude writes the file for your host:

public/_redirects

# public/_redirects (Cloudflare Pages or Netlify)
/post/:slug             /blog/:slug        301
/2023/04/:slug/         /blog/:slug/       301
/services.html          /services          301

next.config.ts

// next.config.ts (Next.js on Vercel); permanent: true sends a 308, which Google treats as a 301
async redirects() {
  return [
    { source: "/post/:slug", destination: "/blog/:slug", permanent: true },
    { source: "/services.html", destination: "/services", permanent: true },
  ];
}

On Framer, the same map goes into the Redirects panel in site settings. Keep chains out: every old URL should reach its final page in one hop.

Step 8: Run the SEO match check

Claude does this

Before launch, the staging site should match the old site on everything search engines and AI assistants read, page by page. Better design is fine. Different metadata is a ranking risk.

Prompt for Claude Code

For every URL in migration/urls.csv, fetch the old page and the matching staging page (following redirects.csv).
Compare: status code, title, meta description, canonical, robots meta, H1, hreflang, Open Graph title and image,
JSON-LD types, word count (flag a drop over 10 percent), internal links out and image alt text.
Write migration/seo-check.csv with one row per URL and a pass or fail per column. Fix the template causing each failure, then rerun.
  • One H1 per page, and the same H1 as before unless you chose to change it
  • Canonicals point at the new live domain, not at staging
  • Robots allows indexing on the live site and blocks it on previews
  • XML sitemap lists only live, indexable URLs, with real last modified dates
  • Structured data validates: Organization, Article, FAQPage and BreadcrumbList where they apply
  • An llms.txt that describes the company, its products and its key pages in plain words
  • Core Web Vitals at least as good as the old site on the top templates

Step 9: Reconnect forms, tracking and integrations

You do this

Forms on Webflow, Wix and most WordPress plugins stop working when the site leaves. Each one needs a new destination you own: a route in the app, a form service or your CRM's own form. Analytics, tag manager, consent banner, chat widgets and pixels are listed in the audit and re-added one by one.

Prompt for Claude Code

List every form, script, pixel and embed on the old site from the saved HTML in /migration.
For each one, say where it lives on the new site, or mark it MISSING. Then add the analytics and consent scripts to the layout,
loading them only after consent.

You do this: submit every form on staging and check the entry lands in the CRM with the right fields and source.

Step 10: Cut over the DNS

You do this

  1. Two days before, lower the TTL on the records you will change to 300 seconds.
  2. Freeze content on the old site, rerun the import, and run the SEO match check one last time.
  3. Point the domain at the new host. Keep the old platform running until the new site has been stable for a few weeks.
  4. Check a sample of old URLs from the live domain: each should answer 200, or 301 to its final page in one hop.
  5. Submit the new sitemap in Search Console and request indexing for the top pages.

Terminal

# Every old URL: status code and where it lands
while read -r url; do
  printf '%s %s\n' "$(curl -s -o /dev/null -w '%{http_code} %{redirect_url}' "$url")" "$url"
done < urls.txt > launch-check.txt
grep -v '^200\|^301\|^308' launch-check.txt

Do not change the platform and the domain on the same day. If traffic drops, you will not know which change caused it.

Step 11: Watch it for 30 days

Claude drafts, you sign off

  • Launch day: forms, tracking and the top fifty URLs checked on the live domain.
  • Week one: Search Console coverage and 404s compared with the old site; fix any URL that slipped through.
  • Weeks two to four: rankings and clicks for the top pages, crawl errors and redirect health. Problems often show up in week three, when Google recrawls the long tail.
  • AI answers: ask ChatGPT, Claude and Perplexity the questions your buyers ask and check how they describe you.

Prompt for Claude Code

Read migration/gsc-before.csv and migration/gsc-after.csv (Search Console Pages exports, same date range length).
List pages whose clicks fell by more than 20 percent, with their redirect and seo-check rows, and suggest the likely cause.

When to get help

This method works well for a marketing site of up to a few hundred pages, run by someone who is comfortable reading a diff. Get help when:

  • Organic search brings in a large share of your pipeline, and a ranking dip would cost more than the migration.
  • The site has thousands of URLs, several languages, or years of backlinks to pages nobody remembers.
  • It depends on deeply customised plugins, logins, stores or product data.
  • Nobody on the team can review code, or the marketing team needs to edit without a developer afterwards.
  • You need it done by a date, with someone accountable for the result.

That is the work we do. Every Goodspeed migration starts with a free audit of every live URL and a redirect map you sign off, then we build in Framer or in code using AI, with a senior review of every change, and watch rankings for 30 days after launch.

What this looks like on real migrations

  • Waste Logics moved from WordPress to Framer with zero ranking loss, and organic traffic rose 44%.
  • HighPath moved from Wix to Framer in six weeks.
  • Bent Pixels moved from Webflow to Framer in six weeks.
  • Wisk, the Boeing-backed autonomous aircraft company, went live in about two months.
  • Reka, the NVIDIA-backed AI company, got three new pages live in one week.

Route by route guides

Frequently asked questions

Can Claude Code migrate a website on its own?
It can do most of the mechanical work: build the URL inventory, rebuild templates, write the import script, generate the redirects file and run the SEO match check. It works on files and a terminal, not inside your old platform, so you still export the content, decide the redirects and review every change.
Will I lose my Google rankings if I migrate with AI?
Not because of the AI. Rankings drop when old URLs stop resolving, titles and descriptions change, or internal links break. Keep every URL or 301 it to its closest match, carry metadata across unchanged and watch Search Console for 30 days. Waste Logics moved from WordPress to Framer with zero ranking loss using this method.
What goes in a CLAUDE.md file for a migration?
Where the source content lives, the rule that copy is moved and never rewritten, the URL list every page must match, what to do with anything it cannot migrate (log it, never skip it silently), the shared components to use, and the commands to install, run and check the site.
Should I move to Framer, Next.js or Astro?
Framer when a marketing team edits pages every week without a developer. Next.js when the site shares data or logins with your product. Next.js with Sanity for lots of structured content and many editors. Astro for fast, content heavy sites. All of them can be read and cited by AI assistants.
How long does a website migration with Claude Code take?
A small personal site can move in a day or two. A company marketing site with sign off from several people usually takes several weeks: HighPath and Bent Pixels each took six weeks with us, and Wisk about two months. The size of the site matters less than how many people approve it.
How much does it cost?
Doing it yourself costs your Claude plan, your hosting and your time. With Goodspeed, migrations start from $10,000 after a free audit, which gives you the URL inventory, a stack recommendation, a fixed price and the risks for your move.

About the Author

Harish Malhi is the founder of Goodspeed. He left Google in 2019 to build his own product, and started Goodspeed to give other founders the same head start. Today the studio designs and builds websites and the whole digital experience around them for funded tech companies, at the moments that matter: a raise, a launch, a press cycle. Goodspeed is a Framer Enterprise Partner, was Bubble’s Agency of the Year in 2024-2025, and has shipped 300+ products, including launch pages for an NVIDIA-backed AI lab and a Webby-nominated site for a Boeing-backed aviation company. It holds a 5.0 rating from 47 reviews on Clutch.

Want this done for you?

Every Goodspeed migration starts with a free audit of every live URL and a redirect map you sign off. Built in Framer or in code using AI, then 30 days of ranking checks.