Skip to main content
CMSquestions

How to Migrate from WordPress to Sanity

IntermediateQuick Answer

TL;DR

Migrating from WordPress to Sanity involves exporting your WordPress content via the REST API or a database dump, defining matching Sanity schemas in code, transforming your content (especially converting HTML to Portable Text), and importing it using Sanity's CLI or mutation API. The process typically takes 2–8 weeks depending on content complexity, custom fields, and media volume.

Key Takeaways

  • Define your Sanity schema before importing — the schema drives everything downstream
  • Convert WordPress HTML body content to Portable Text using available converter libraries
  • Use `sanity dataset import` for bulk NDJSON imports; use the mutations API for incremental or scripted imports
  • Budget extra time for media: images must be uploaded to Sanity's asset pipeline separately from document content