Work Pricing FAQ Blog Jobs Trending Book the AI Audit

HomeBlogAutomate WordPress Migration with Claude Code (2026 Guide)

Automate WordPress Migration with Claude Code (2026 Guide)

WordPress migration automation with Claude Code has become one of my most-requested services in 2026. I've helped a dozen Vancouver businesses move their sites — from old themes to new builds, from legacy platforms to WordPress, from one host to another — and every single project used to take 40+ hours of manual work. Now it takes about 6.

The bottleneck was never the database export or the file transfer. Those are mostly point-and-click. The time drain is the content mapping: making sure every post, custom field, taxonomy term, and media file ends up in the right place with the right structure. When you're moving 300 blog posts with Advanced Custom Fields and 15 custom taxonomies, doing that by hand is brutal.

Claude Code changed the entire process. Here's exactly how I do it now.

The Old Migration Workflow (And Why It Took So Long)

Before I automated this, a typical WordPress migration looked like this:

  • Export the old site's database via phpMyAdmin or WP-CLI
  • Open the SQL file and manually inspect the table structure to understand custom post types, meta fields, and taxonomies
  • Write a mapping document showing which old fields correspond to which new fields
  • Write custom PHP scripts or use a plugin like WP All Import to process the data
  • Run test imports, find edge cases (missing images, broken serialized arrays, taxonomy mismatches), fix them, and repeat
  • Manually verify 50–100 posts to confirm everything migrated correctly

The inspection and mapping alone used to take 8–12 hours on a moderately complex site. The scripting and testing added another 20–30 hours. And every site was different enough that I couldn't fully reuse scripts from one project to the next.

What Changed with Claude Code

Claude Code doesn't eliminate the steps — it compresses them. The inspection, mapping, and script generation that used to take 30 hours now takes about 90 minutes. The testing loop is faster because the scripts are more accurate on the first run. And I can reuse 80% of the logic across projects because Claude Code handles the site-specific variations automatically.

Step 1: Extracting and Analyzing the Source Database

The first step in any WordPress migration automation is understanding what you're working with. I export the database as SQL, then use Claude Code to parse the structure and identify:

  • All custom post types and their slugs
  • All post meta keys and their data types (text, serialized array, URL, etc.)
  • All custom taxonomies and their term counts
  • All ACF field groups and their field configurations
  • Media attachments and their attachment metadata

I give Claude Code the SQL file and a prompt that looks like this:

Analyze this WordPress database export. Identify:
1. All custom post types (wp_posts where post_type != 'post' or 'page')
2. All unique meta_key values in wp_postmeta with sample values
3. All custom taxonomies in wp_term_taxonomy
4. Any serialized PHP data structures in postmeta

Return a JSON schema showing the data model of this site.

Within a minute or two, I have a complete map of the site's content architecture. This used to take me half a day of manual SQL queries and spreadsheet building.

Step 2: Mapping Old Fields to New Fields

Once I know what's in the source database, I need to define how it maps to the destination. This is where most migrations break — a field that was called event_date in the old site needs to become start_date in the new site, and the format changes from m/d/Y to Y-m-d.

I create a mapping file in JSON that specifies every transformation. For a recent event site migration, it looked like this:

{
  "post_types": {
    "tribe_events": "event"
  },
  "meta_fields": {
    "event_date": {
      "new_key": "start_date",
      "transform": "date_format_mdy_to_ymd"
    },
    "event_location": {
      "new_key": "venue_name",
      "transform": "text"
    }
  },
  "taxonomies": {
    "tribe_events_cat": "event_category"
  }
}

Then I give Claude Code this mapping file plus the source database schema, and it generates a migration script that handles all the transformations. The script reads from the old database, applies the mappings, and writes to the new database in the correct format.

Step 3: Automating the Bulk Import with Claude Code

The actual data transfer happens in a Node.js script that Claude Code writes for me. It connects to both databases, reads the source content in batches, transforms it according to the mapping, and inserts it into the destination.

The key parts of the automation:

  • Batch processing — the script handles 50 posts at a time to avoid memory issues on large sites
  • Media URL rewriting — all internal image URLs get updated to match the new domain and file structure
  • Taxonomy term reconciliation — if a term exists in the new site, it gets reused; if not, it gets created
  • Error logging — any post that fails validation gets logged with the specific error, so I can fix it manually

For a 400-post site with 12 custom fields per post, the script runs in about 8 minutes. That's the part that used to take two full days of clicking through the WordPress admin.

The biggest time-saver is that Claude Code handles edge cases I wouldn't have thought to code for manually — like posts with missing featured images, or serialized ACF repeater fields with inconsistent array structures. It detects them during the first pass and adjusts the import logic automatically.

Step 4: Validation and Post-Migration Cleanup

After the bulk import finishes, I run a validation script that checks:

  • Post count matches between source and destination
  • All taxonomy terms were created or mapped correctly
  • All media files were transferred and URLs updated
  • All custom fields have values in the expected format

This catches 95% of issues before the client ever sees the migrated site. The remaining 5% are usually judgment calls — like whether a particular post should be migrated at all, or how to handle content that doesn't fit the new structure.

Real Project: Vancouver Fitness Studio Site Redesign

A Vancouver fitness studio hired me to rebuild their WordPress site on a new theme. The old site had 280 blog posts, 60 class schedule entries (custom post type), and a bunch of ACF fields for instructor bios and class metadata. They wanted everything moved to the new site without breaking any URLs or losing any content.

Using the Claude Code workflow I just described, I completed the migration in 6 hours:

  • 1 hour: database analysis and mapping file creation
  • 2 hours: Claude Code script generation and testing on a staging copy
  • 1 hour: bulk import execution and error resolution
  • 2 hours: validation, manual spot-checking, and URL redirect setup

The old way would have been 35–40 hours, minimum. And there's no way I would have caught all the edge cases without multiple rounds of client feedback and rework.

When Automation Isn't Enough

Claude Code can't automate everything in a WordPress migration. Here's what still requires human oversight:

  • Design decisions — if the new theme doesn't support a feature from the old site, someone has to decide how to handle it
  • Content strategy changes — if you're consolidating two post types into one, the automation can move the data but it can't decide which fields to prioritize
  • SEO redirects — the script can generate a redirect map, but you need to review it to make sure critical pages aren't getting 404s

But for the mechanical parts — extracting, mapping, transforming, importing — Claude Code is faster and more reliable than any manual process or WordPress plugin I've tried.

Getting Started with Your Own WordPress Migration Automation

If you're a developer or agency owner who does WordPress migrations regularly, here's how I'd recommend starting:

  1. Pick one past migration project where you have access to both the source and destination databases
  2. Export the source database and use Claude Code to generate the schema analysis
  3. Build a simple mapping file for 3–5 fields and have Claude Code generate the migration script
  4. Run it on a local copy and verify the output
  5. Expand the mapping to cover more fields and refine the script

Once you've done it once, you'll have a reusable template that works for 80% of migrations with minor adjustments. That's what I use now for most client projects.

If you want help building this for your specific use case, I walk through the full process in my WordPress content migration guide. And if you'd rather just hire someone to handle it, that's what I do — feel free to reach out and we can talk through your project.

For more on how I use Claude Code for different types of automation work, check out my posts on WordPress automation and automated content pipelines. And if you have questions about whether this approach makes sense for your situation, the FAQ page covers the most common ones.

Work with me

Want this kind of result for your business?

Start with the AI Audit — $1,500. One focused engagement. The 3 highest-ROI opportunities in your business, ranked. A working proof-of-concept of the #1. Credited toward your build if we go forward.

Book the AI Audit → Read the FAQ
← All posts Book the AI Audit →