Migrations

Migrate a site from a legacy CMS into WordPress

A content-migration plan for moving a decade-old custom PHP CMS site into WordPress, covering URL structure mismatches, incompatible password hashes, and encoding artifacts from the export.

Works with Claude / GPT63 uses 3.8

The prompt

migrations-legacy-cms-to-wordpress
I'm migrating [clientsite.com] off a custom PHP CMS built around 2012 (URLs look like
/article.php?id=482, no clean permalinks) into WordPress, with roughly [1,200] articles
and [400] registered user accounts that need to keep working. The old CMS export is a
raw SQL dump from its own custom schema, not anything WordPress understands.

Plan this migration as a content and account transformation, not a lift-and-shift,
addressing what a generic "import content into WordPress" guide misses:

1. Content mapping: how to map the old CMS's flat article table (with its own category
   and author ID columns) into WordPress's posts/postmeta/term structure, including
   what to do about custom fields the old CMS had that don't have a WordPress
   equivalent (store as postmeta, or drop, on a case-by-case basis).
2. URL preservation: since the old URLs are query-string based (/article.php?id=482)
   and the new WordPress site will use clean permalinks, explain how to build a
   redirect rule that maps old-style query URLs to new permalink slugs at scale (via a
   lookup table, not one redirect rule per article), so existing backlinks and search
   rankings aren't abandoned.
3. User accounts and passwords: the old CMS almost certainly hashed passwords with
   something WordPress's phpass implementation can't verify directly (e.g. plain MD5
   or a custom scheme). Explain the safe approach, importing accounts with a flag that
   forces a password reset on next login rather than guessing at hash compatibility,
   and why silently importing incompatible hashes creates a security problem, not just
   an inconvenience.
4. Encoding and formatting artifacts: how to check the SQL export for character
   encoding issues (Windows-1252 content mislabeled as UTF-8 is common in exports this
   old, and shows up as garbled apostrophes and quotes) and old CMS-specific markup
   (custom BBCode-like tags) that need conversion before the content is usable in the
   WordPress editor.
5. Verification: a sampling method to spot-check a handful of migrated articles against
   their live originals (checking images, formatting, and author attribution) before
   trusting a bulk import of all 1,200.

Give me the migration in an order that lets me validate the mapping on a small batch
before running it against the full 1,200 articles.

Legacy CMS migrations go wrong quietly, a mis-mapped author ID or a mislabeled encoding doesn’t throw an error, it just produces subtly wrong content that looks fine until someone notices weeks later. Testing the full pipeline on a small batch first catches that before it’s baked into 1,200 live articles.