Back to blog
Blog

Migrate from WordPress to Cosmic: A Complete Developer Guide

Tony Spiro's avatar

Tony Spiro

April 8, 2026

Migrate from WordPress to Cosmic: A Complete Developer Guide - cover image

WordPress got you here. It powers a massive share of the web, and for good reason: it's flexible, well-documented, and has a plugin for nearly everything. But somewhere along the way, the CMS becomes the project. You're managing PHP versions, auditing plugin CVEs, fighting Gutenberg's half-baked block editor, and wondering why a content problem turned into infrastructure work.

This guide is for teams ready to move on. We'll walk through how to map your WordPress content model to Cosmic, export your data via the WP REST API, import it into Cosmic using the REST API and JavaScript SDK, and ship your new frontend in Next.js, Nuxt, or Astro. No servers to manage. No plugin update treadmill.

If you're still evaluating your options, see our full WordPress alternative comparison for a side-by-side breakdown.


1. Why Teams Migrate from WordPress

Plugin Bloat and a Relentless CVE Stream

The average production WordPress site runs dozens of plugins. Each one is a dependency with its own release cycle, compatibility matrix, and security surface area. When a critical CVE drops in a popular plugin, you're patching under pressure or taking the site down. The National Vulnerability Database lists hundreds of WordPress plugin vulnerabilities every year. Maintaining a secure WordPress site is a part-time job.

Cosmic has no plugins. The platform is managed, maintained, and secured by the Cosmic team. You consume the API; we handle everything else.

PHP and MySQL Scaling Walls

WordPress runs on PHP and MySQL. At moderate traffic levels this works fine. At scale, it requires careful configuration: object caching with Redis or Memcached, query optimization, read replicas, and a well-tuned reverse proxy in front of it all. Get any of it wrong and you get 502s under load.

Cosmic's REST API is served from a globally distributed CDN. Cached API responses come back in milliseconds regardless of traffic volume. There are no databases for you to tune, no PHP workers to scale, and no server to restart at 2am.

WP-Admin as a Content Bottleneck

WordPress editorial workflows often become developer bottlenecks. Content editors need help with Custom Field configurations. Developers get pulled in to fix layout-breaking Gutenberg blocks. Page builders introduce drag-and-drop complexity that looks flexible but generates unmaintainable markup.

Cosmic's dashboard is structured around clean content objects. Editors create and update content without touching layout. Developers own the presentation layer in code. The two teams work in parallel without blocking each other.

Maximilian Wuhr, Co-Founder at FINN, describes exactly this outcome:

"Cosmic is: us never having to ask a developer to change anything on the backend of our website."

Gutenberg's Failed Headless Pivot

WordPress has made moves toward headless: the WP REST API, block-based editing, and the FSE (Full Site Editing) initiative. But Gutenberg's block format is tightly coupled to WordPress's rendering layer. When you try to go headless with WordPress, you're either parsing serialized block markup on the frontend or working around an API that wasn't designed for decoupled consumption.

Cosmic was built API-first from day one. Every piece of content is a clean, structured JSON object. There's no legacy rendering layer to work around, no block serialization format to parse, and no wp_posts table to query.

Performance Overhead

Out of the box, WordPress is a PHP application that generates HTML on every request. Even with page caching, you're still loading plugins on every uncached request, running database queries, and fighting a startup time that grows with every plugin you add. Modern frontend performance demands (Core Web Vitals, edge rendering, ISR) are bolted onto a CMS that wasn't designed for them.

With Cosmic, your frontend fetches clean structured data via the REST API and renders it however your framework handles it best: static at build time, server-rendered at the edge, or client-side with SWR. The CMS doesn't touch your rendering layer at all.


2. Content Model Mapping

WordPress and Cosmic share the same fundamental concept: structured content with fields. The terminology is different, but the mapping is practical.

WordPress ConceptCosmic Equivalent
PostsObjects (type: )
PagesObjects (type: )
Custom Post TypesObject Types
ACF Fields / Meta FieldsMetafields
ACF RepeaterRepeater Metafield
ACF RelationshipObject / Objects Metafield
Media LibraryCosmic Media (served via imgix CDN)
CategoriesObject (type: ) + relationship metafield
TagsObject (type: ) + relationship metafield
Post Status (draft/publish)Object Status (draft/published)
AuthorObject (type: ) + relationship metafield
Permalinks / SlugsSlug field (auto-generated or custom)

Mapping Example: Blog Post

WordPress Post + ACF Fields:


Cosmic Object (blog-posts type):


Cosmic metafields support: , , , , , , , , , , , , , , , and more. ACF field types map cleanly.


3. Step-by-Step Migration

Step 1: Export WordPress Content via the WP REST API

WordPress exposes your content through its built-in REST API. Use it to export posts, pages, custom post types, and media before you start.


For sites with authentication (private posts, draft content), use an Application Password:


For large sites, paginate through all records:


Step 2: Create Object Types in Cosmic

Log into your Cosmic dashboard and create Object Types that match your WordPress post types. You can also do this via the Cosmic REST API.

For a standard WordPress blog, you'll create:

  • with metafields: (html-textarea), (file), (textarea), (object), (object), (date)
  • with metafields: (html-textarea), (file)
  • with metafields: (textarea), (file)

For Custom Post Types with ACF fields, model each field as the closest Cosmic metafield type.

Step 3: Install the Cosmic SDK and Import Data


Set your environment variables:


Write your import script:


Step 4: Migrate Media to Cosmic

With your Cosmic bucket configured, you can now upload your existing media files using the Cosmic SDK. This step walks you through the process of transferring your images, documents, and other files into Cosmic.

Install the Cosmic SDK


Initialize the Bucket Client


Upload Media Files

Use the method to upload each file to your bucket. You can optionally organize files into folders and attach metadata to keep your media library structured.


Migrate a Batch of Files

If you have a large collection of media to migrate, you can loop through your files and upload them in sequence.


Verify Uploaded Media

After migration, you can verify your files were uploaded successfully by retrieving the media list from your bucket.


Optimize Images with imgix

Once your media is in Cosmic, every image automatically receives an property. You can use this URL to apply on-the-fly image transformations such as resizing, compression, and format conversion, without storing multiple versions of the same file.


Upload limit: Each file uploaded to Cosmic can be up to 900MB in size, making it suitable for high-resolution images, video files, and large documents.

Step 5: Map Custom Fields (ACF) to Metafields

If you're using Advanced Custom Fields, the WP REST API exposes ACF data under the key on each post object (with the ACF to REST API plugin).



4. Framework Examples: Fetching from Cosmic

Once your data is in Cosmic, updating your frontend is the final step. Here are complete code examples replacing WordPress's query logic with Cosmic SDK calls.

Next.js (App Router)




Nuxt 3

Cosmic is a strong fit for Nuxt-powered projects. See our dedicated Nuxt headless CMS guide for deeper coverage.



Astro



Also building with Vue? Check out our Vue headless CMS guide for component-level examples.


5. Cosmic AI Agents: Replace What WordPress Plugins Were Trying to Do

WordPress plugins often exist to paper over gaps in the core CMS: SEO plugins, editorial workflow plugins, form plugins, image optimization plugins, content scheduling plugins. Each one adds fragility.

Cosmic AI Agents replace whole categories of plugin dependency with native, programmable automation:

  • Content Agents generate and update CMS content automatically. Need to schedule a batch of seasonal posts? Run a bulk import from an external data source? Publish on a recurring cadence? A Content Agent handles it without a plugin, a cron job, or a developer in the loop.

  • Team Agents live inside Slack, WhatsApp, or Telegram. Instead of logging into WP-Admin, your editorial team asks the agent to draft a post, update a product description, or check what's scheduled to publish. The agent reads and writes to Cosmic directly from your team's existing chat tools.

  • Code Agents connect to your GitHub repository and work on feature branches autonomously. Need to add a new content type to your frontend? The agent writes the code, opens a pull request, and waits for review.

  • Computer Use Agents automate browser-based tasks: recording demo walkthroughs, extracting content from external pages, and cross-posting media between platforms.

The result: the plugin-driven WordPress automation layer gets replaced by agents that are version-controlled, auditable, and don't break when you update a dependency.


6. Pre-Launch Checklist

Before you cut over from WordPress to Cosmic, run through this list:

  • All WordPress post types recreated as Cosmic Object Types with matching metafields
  • All posts and pages imported with correct titles, slugs, and content
  • Post statuses match: published posts are , drafts are
  • All featured images uploaded to Cosmic and references updated in content
  • ACF / custom field data mapped and confirmed in Cosmic metafields
  • Authors and categories created as Cosmic objects and linked via relationship metafields
  • Environment variables set in your frontend: ,
  • All API calls in the frontend updated — no remaining WordPress REST API or calls
  • Static paths regenerated ( in Next.js, in Nuxt)
  • 301 redirects configured for any URL structure changes (e.g. to )
  • Staging environment tested end-to-end with real content before production cutover
  • WordPress and XML-RPC blocked or access-restricted during transition
  • WordPress site kept live (read-only) for 2 to 4 weeks as a fallback reference

Pricing

Cosmic pricing is transparent with no hidden infrastructure costs:

PlanPriceBucketsTeam MembersObjects
Free$0/month121,000
Builder$49/month235,000
Team$299/month3520,000
Business$499/month51050,000
EnterpriseCustomCustomCustomCustom

Additional team members are $29/user/month. Compare that to the real cost of maintaining a WordPress stack: hosting, CDN, security scanning tools, plugin licenses, and the developer hours that disappear into maintenance.

Cosmic is backed by Y Combinator (W19). The platform is built for teams who want to ship content, not manage infrastructure.


Also Migrating from Another Platform?

If your team is also evaluating a move away from Strapi, see our complete Strapi migration guide and the Strapi alternative comparison for a full side-by-side.


Further Reading


Ready to Make the Switch?

Migrating from WordPress to Cosmic is a one-time project that pays back every day after. No more plugin CVEs, no more WP-Admin bottlenecks, no more PHP servers between your content and your users. Your editors get a clean interface. Your developers get a predictable REST API. And your team stops spending weekends on CMS maintenance.

Start for free — your first bucket is free, no credit card required.

Or if you want to walk through your specific WordPress setup and map out the migration path, book a 30-minute call with Tony. He'll help you scope the work and get moving.

Ready to get started?

Build your next project with Cosmic and start creating content faster.

No credit card required • 75,000+ developers