All posts
Platform migrations

How to Export a WordPress Site's Content for Migration

How to export WordPress content for a migration: WXR vs CSV vs REST API, custom fields, SEO metadata and media, with a step list and the mistakes to avoid.

By Mehdi Hassan7 min read

The short answer

To export WordPress content for a migration, use the built-in XML (WXR) export for a full snapshot, a CSV export plugin when the new CMS imports spreadsheets, or the REST API when you need rendered HTML, custom fields and media in a scriptable form. Export media separately, and capture URLs and SEO metadata before anything changes.

Key takeaways

  • The built-in Tools > Export file is WXR (XML): complete, but only WordPress reads it natively.
  • CSV is the easiest format for Webflow and Framer imports, but needs a plugin and cleanup.
  • The REST API gives rendered HTML with shortcodes resolved, which saves conversion work.
  • WordPress exports reference media by URL; they don't contain the image files.
  • Export SEO titles, descriptions and the full URL list, or you'll rebuild them by hand later.

Part of CMS Content Migration: How to Export, Clean and Import Content Between Platforms

How do you export WordPress content for a migration?

You export WordPress content by choosing a format that your new platform can read, then exporting posts, custom fields, taxonomies, SEO metadata and media as separate, checkable pieces. The built-in exporter is a start, not the whole job.

WordPress sites hide content in more places than their owners expect: page-builder markup, shortcodes, Advanced Custom Fields, SEO plugin settings and a media library full of resized copies. A clean export pulls each of those out on purpose. If this is part of a full platform move, our guide to CMS content migration shows where the export sits in the bigger plan.

Before exporting anything, decide what's worth keeping. A content audit before migration cuts the volume, and every post you drop is one you don't have to convert, re-host or redirect-test.

WordPress XML export, CSV or REST API: which should you use?

Use WXR when the destination is another WordPress install or a tool built to read it, CSV when the destination imports spreadsheets, and the REST API when a developer is scripting the migration. Many migrations use two: CSV or API for content, plus a separate media pull.

Method

What you get

Best for

Watch out for

WXR (Tools > Export)

XML with posts, pages, terms, authors, comments and custom fields

WordPress to WordPress, or an archive copy

Raw content with shortcodes and block markup; media by URL only

CSV export plugin

One row per post, chosen columns

Webflow or Framer CSV import

Serialized fields, line breaks in HTML, plugin quality varies

REST API

JSON with rendered HTML, terms, featured media and exposed fields

Scripted moves to Framer, Next.js, Astro or a headless CMS

Pagination, custom fields must be exposed, private content needs auth

WP-CLI

Exports and post lists from the server

Large sites with shell access

Needs hosting that allows it

Our default for marketing sites is the REST API for posts and a script that writes a clean CSV for the new CMS. It gets you rendered HTML instead of shortcodes, and it's repeatable when the content freeze slips.

How do you run the WordPress XML export?

Go to Tools > Export in the WordPress admin, choose All content or a single post type, and download the XML file. That file is your WXR export, and it's worth keeping even if you never import it, as an archive of the site as it was.

The filters let you limit by category, author, date range and status, which helps when a site is too large to export in one go. The file includes custom fields stored as post meta, so ACF values are in there, but in raw form: repeaters and flexible content appear as numbered meta keys, not structured data.

The WXR file doesn't contain images. It lists attachments with their URLs, and the WordPress importer downloads them when the destination is another WordPress site. Any other destination needs a separate media step. The WordPress documentation covers the export screen options if your install looks different.

How do you export WordPress to CSV with custom fields?

Export WordPress to CSV with an export plugin that lets you pick columns, including custom fields and taxonomies, then clean the file before importing. CSV is the most practical bridge to Webflow and Framer, both of which import spreadsheets into CMS collections.

  • Pick columns by destination field. Title, slug, date, author, categories, excerpt, body, featured image URL, SEO title and SEO description.
  • Flatten taxonomies. Export categories and tags as slugs, separated by a character the new CMS expects for multi-reference fields.
  • Unpack ACF fields. Simple fields export cleanly; repeaters and galleries usually need a script to turn them into separate items or HTML.
  • Resolve shortcodes. CSV exports usually carry raw post content, so shortcodes and block comments come along. Convert them or use rendered HTML instead.
  • Watch encoding. Save as UTF-8 so quotes, accents and em dashes survive.

From there, the import guides take over: importing a CSV into Webflow CMS and importing content into Framer CMS cover the destination side.

When should you use the REST API or WP-CLI?

Use the REST API when you need rendered HTML, structured custom fields or a repeatable script, and WP-CLI when the site is large and you have server access. Both suit developer-led migrations to code-based or headless platforms.

The posts endpoint returns content.rendered, which is the HTML after WordPress has processed shortcodes and blocks. That alone removes most conversion headaches. Adding the embed parameter brings featured images, authors and terms into the same response. Custom fields only appear if they're exposed to the API, which for ACF means turning on the REST API setting for each field group.

This is the route for moves like WordPress to Astro or into a headless CMS, where a script maps WordPress fields to a new content model and converts HTML into the target's rich text format.

What a scripted REST API export usually does

A typical script pages through each post type, as many items per request as the API allows. For each item it saves the slug, dates, status, rendered HTML, excerpt, author, terms and featured image URL, plus any exposed custom fields.

It then scans the HTML for image URLs, downloads every file once, and writes a map from old URL to new location. Finally it writes either a CSV for a visual CMS or JSON for a headless one. Keep the script in version control so you can re-run it after the content freeze.

How do you export WordPress posts with images?

Export images as a separate step: collect every image URL from featured images and post bodies, download the files, then re-upload or re-host them on the new platform. No standard WordPress export bundles the files themselves.

  1. List every image URL

    Pull featured image URLs from the API or CSV, and scan body HTML for inline images, including the resized variants WordPress generates.

  2. Download the originals

    Fetch the full-size files, or copy the uploads folder over SFTP if your host allows it. Don't import resized thumbnails as originals.

  3. Re-host on the destination

    Let the new CMS fetch images by URL during import, or upload them to its asset library or your own storage.

  4. Rewrite URLs in the body

    Replace old wp-content URLs in post HTML with the new asset URLs, using the map you built while downloading.

  5. Check alt text

    Alt text lives on the attachment, not always in the body HTML. Export it and carry it across.

What should you export besides posts and pages?

Export the URL list, SEO metadata, redirects and form setup, because these are what protect traffic and leads after the move. They're also the parts most often forgotten.

  • Every live URL. Use the sitemap plus a crawl, so the redirect map covers category, tag, date and author archives too.
  • SEO metadata. Yoast and Rank Math store titles, descriptions and canonicals in post meta; export them alongside the content.
  • Existing redirects. Redirection plugins hold rules you'll need to carry over or merge.
  • Forms. Note every form, its fields and where submissions go, then rebuild them with the steps in migrating website forms.

Destination-specific guides cover the rest: WordPress to Framer and WordPress blog to Webflow CMS. Migration work is scoped on the intro call, and we include redirects and SEO checks in any migration we take on.

Frequently asked questions

Does the WordPress export include images?
No. The built-in export lists media as attachments with their URLs, but it doesn't include the image files. A WordPress importer can download them when the new site is also WordPress. For any other platform, you download the files yourself, re-host them and rewrite the image URLs inside post content before launch.
Can I export a WordPress site built with Elementor or Divi?
You can export the content, but page-builder layouts don't transfer to other platforms. Their markup is stored as shortcodes or builder data that only that builder understands. Blog posts written in the standard editor usually export cleanly. Builder-made landing pages are better rebuilt from scratch on the new platform, using the old page only as a content reference.
How do I export Yoast SEO titles and descriptions?
Yoast stores SEO titles and meta descriptions as post meta, so a CSV export plugin that includes custom fields can export them as columns. Yoast also adds a yoast_head_json field to REST API responses. Export them with the content and map them to the new CMS's SEO fields, or every page loses its custom titles.
How long does it take to export a WordPress site?
The export itself takes minutes. Preparing it for a new platform takes longer: auditing which posts to keep, unpacking custom fields, converting shortcodes, re-hosting images and building the redirect list. That time depends on the number of posts, the page builder used and how much custom data the site has, so scope it after a quick audit.
Should I export comments when leaving WordPress?
Only if comments add real value to the posts and your new platform can display them. Most marketing sites on Webflow, Framer or Next.js don't have native comments, so teams usually archive them in the WXR file and drop them from the live site. If a few posts have useful discussion, fold the best points into the post itself.

· CEO & Design Director

Copywriter, designer and developer, and founder of Designify Studio. Over five years, 60+ projects across 14+ industries, for startups that have raised $300M+.

Want this done for you? Website, $8,000.

A multi-page marketing site, designed by us, developed in Next.js and animated. $8,000, one-time, up to 6 pages. Book a free 30-minute call to see if it fits.

Schedule Call