Migrating WordPress to Statamic 6: what imports and what doesn't
· Menno-Paul Schreuder
I imported WordPress's own test content into Statamic 6 with the official importer. What came over cleanly, what needed work and what got lost.
- Statamic
Before I offer to move a website from WordPress to Statamic, I want to know where the work is. So I ran a test migration: not a client site, but the Theme Unit Test data (opens in a new tab) that WordPress publishes for theme developers. It's a public export full of edge cases: nested pages, posts with dozens of categories, old shortcodes, Gutenberg blocks of every kind and HTML that isn't quite valid. I ran the test with Claude Code, the AI coding tool I also use for upgrades. The numbers below come from that run.
The export (a WXR file, what Tools > Export gives you in WordPress) contains 58 posts, 21 pages, 37 media files, 68 categories, 110 tags, 33 comments and 70 menu items. Of the 58 posts, 39 were written in the classic editor and 19 with Gutenberg blocks.
The setup
A fresh Statamic 6 site (6.42) with the Importer (opens in a new tab): a free add-on made by Statamic itself, version 2.3.4. It imports entries, taxonomy terms and users from CSV or XML. There's no command-line version: you set up and run each import in the control panel, under Utilities > Importer. It keeps track of progress in a database, so the site needs one, even if the content itself lives in files. A new Statamic site comes with SQLite, which is enough.
Installing both took about 15 seconds, and each import run took under a minute, including downloading the images. The import isn't where the time goes: that's the preparation beforehand and the clean-up afterwards.
Before you import: split the file
The Importer wants one file per type of content: one for posts, one for pages. A WordPress export puts everything in one file. Import it as it is and the menu items become entries too, because the Importer skips media files but doesn't look at the post type.
The second catch is categories and tags. The Importer reads each item as a flat list of fields, so when a post has five categories, only the last one survives. In this export, 57 posts had more than one category or tag. The Importer does accept several values separated by a |, so a short script that splits the export per post type and joins the categories and tags fixes both problems.
The Importer's documentation recommends something else for real sites: export to CSV with a plugin like WP All Export. That's also the practical way to bring along custom fields from Advanced Custom Fields (ACF).
What came over cleanly
- All 79 posts and pages, with titles, slugs, dates and published status. The one draft and the one scheduled post came in unpublished.
- Categories and tags: 66 categories and 63 tags, created during the import. That's every one a post actually used.
- Classic editor content: paragraphs, headings, lists, quotes, bold, italic and links. Switch on Replace double line-breaks with p tags, or older posts come in as one long paragraph.
- Gutenberg blocks the Importer knows: paragraphs, headings, lists, quotes, tables, images, galleries, code and separators. The ten galleries became Bard sets.
- Images: 31 of the 34 image files in the content were downloaded into Statamic's asset container and linked in the text. This only works when the Bard field has an asset container set. Without one, the Importer skips the images without saying so.
What needed work
- The content model comes first. The Importer fills fields that already exist, so collections, taxonomies and blueprints have to be there before the first import. I added two fields to keep: the old WordPress ID and the old URL. The first lets you run the import again without creating duplicates, the second is the start of the redirect list.
- Shortcodes stay text.
[caption],[gallery]and[audio]came in as literal text in 7 posts and pages. You either write a transformer for them or fix them by hand. - Video and social embeds. A YouTube URL on its own line becomes a player in WordPress. In Statamic it's just a link until you build an embed block for it.
- Invalid HTML broke three pages. The test content has tags that are opened twice instead of closed, like
<strong>bold<strong>. The Importer turned that into text with the same formatting applied twice, and those three pages threw an error when they were displayed. I only found them by requesting every new URL. - Non-Latin slugs. WordPress stores a Greek slug URL-encoded, and Statamic turned it into
ceb5cf80ceafcf80ceb5ceb4cebf. Those need a new slug by hand. - Templates. As soon as content contains Bard sets, every set needs its own template. That's normal Statamic work, but it belongs in the estimate.
What didn't come over
- The page hierarchy. Thirteen pages have a parent in WordPress. I mapped the parent field to the old ID, ran the import twice, and all pages still ended up next to each other at the top level. The page tree has to be rebuilt by hand, and that changes the URLs of every child page.
- Blocks the Importer doesn't know. Cover, columns, group, media and text, pullquote, file and audio blocks, and embeds in the older
core-embed/youtubenotation, are left out without a warning. That happened in 14 of the 79 posts and pages. For each of those blocks you write a small hook that tells the Importer what to make of it. - Comments. All 33. Statamic has no comments of its own; keeping them means a separate solution.
- Featured images. Six posts had one. WordPress keeps them as metadata, and of the metadata only the last value per post survives the import, like the categories. A CSV export with the featured image as a column solves that.
- Menus. The 70 menu items have to be rebuilt in Statamic's navigation.
URLs and redirects
With the old URL stored on every entry, the redirect list is one query: old address next to new address. Of the 79 URLs, 71 changed. The other 8 only lost their trailing slash. Posts moved under /blog/, and the child pages lost their parent's part of the path.
Two things I learned here:
- Don't rebuild old URLs from the slug. In 11 posts the slug in the export didn't match the URL WordPress actually used, for example
/wp-6-1-design-category-blocks/against the slugdesign-category-blocks. Thelinkfield in the export is the real address. - Request every new URL before launch. Of the 77 published pages, 74 loaded and 3 threw the error above. Without that check, they would have gone live broken.
After launch, compare the redirects with the pages Google has indexed (Search Console lists them), so no old link ends in a 404.
What this means for a real migration
The import itself is the smallest part of the job: a few minutes once the content model is right. The work is in what comes before and after: a content model that fits the site, blocks and shortcodes the Importer doesn't handle, the page tree, the redirects and templates for every block.
A real WordPress site also has things this test doesn't: ACF fields, plugins that store their own data, and page builders like Elementor or Divi. I didn't test those, and they add work. That's why a migration starts with an inventory of what the current site actually contains.
Moving a site off WordPress? Here's how I approach a migration.