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.
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.
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.
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.
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.
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.
