Free tool · WordPress · Step 2 of 4: Convert
WordPress export to Markdown or MDX
Choose the .xml file from Tools, then Export. Pick Astro, Hugo, Jekyll or Eleventy. You get one Markdown or MDX file per post and page, named from its real address so no page overwrites another, with its shortcodes kept or mapped to components, and a redirect list from the old addresses to the new ones.
Runs in your browser. Nothing is uploaded or stored. No account. The files are a draft to review.
What it does
Three things a plain converter leaves to you
Paths from real addresses
Each file is named from the path of the post's own address, not its title. Two pages called "Contact" at /en/contact/ and /fr/contact/ become en/contact and fr/contact, not one file written twice. An ID-only address such as ?p=123 becomes post/123-slug. A path still taken gets -2, -3, and the report lists it.
Shortcodes kept or mapped
By default every shortcode is kept as text, so nothing is lost. With .mdx you can map tags to component names in a table that starts with the tags in your file: [note]…[/note] becomes <Note>…</Note>. Tags you leave out of the table stay as text. Every tag is counted.
A redirect list that fits
redirects.csv has each published post's old address and its new one, in the two columns our redirect workbench reads. Paste it there to check it and turn it into a host's redirect file. Addresses that stay the same are left out.
What is in the zip
- One .md or .mdx file per post and page that is published, draft or private. Media items, menu entries and revisions are skipped and counted.
- Front matter in YAML: title, date, slug, categories, tags, status, and language when the export has a Polylang language or WPML's language field. Every string is double-quoted and escaped.
- Headings, paragraphs, line breaks, bold, italics, links, images, nested lists, quotes, code and rules as Markdown. Tables, embeds and other HTML with no Markdown form are kept as raw HTML and counted. In .mdx that HTML is written as JSX: tags closed, class as className.
- migration-report/redirects.csv, images.csv (every image address and the posts that use it), report.csv (per file: raw HTML, shortcodes, path changes, custom field keys) and a README.
Free within a limit. One export file of up to 50 MB per run, as many runs as you like. With a tools pass this tool runs one export file of up to 200 MB: see the self-serve prices. Larger runs: request access.
Limits
How far you can trust it
- One file of up to 50 MB per run, read as text in your browser's memory.
- The files are a draft to review. We have not built them with Astro, Hugo, Jekyll or Eleventy. Run your site's build and fix what it reports.
- Images are not downloaded. The files point at the old site's image addresses, and images.csv lists them so you can move them.
- Mapped components are names only. You write each component and make it available to MDX the way your site does.
- Gutenberg blocks are written as their HTML; their settings are dropped. Page-builder layouts (Divi, WPBakery) arrive as shortcodes: take them out first with the WordPress export analyser if you do not want them.
- Comments, authors, menus and custom field values are not written. report.csv lists each post's custom field keys.
- The new addresses follow each layout's default. For Astro they assume routes at /blog/<path>/ for posts and /<path>/ for pages; Jekyll files carry a permalink.
- Bold or italic text right next to punctuation can come out as literal asterisks. Check a few posts.
- Tested on export files we wrote in the format of WordPress's own exporter, not on a library of real-world exports.
Other free tools
Tools that already do part of this
A WordPress export can already be turned into Markdown with free tools. Facts below were read on each tool's own page, checked 16 Nov 2026.
- wordpress-export-to-markdown (lonekorean): A Node.js command-line tool run with npx. Front matter field choice, a folder per post or single files, year or month folders, and image download. Open requests on its issue list ask for pages with the same title not to overwrite each other (#73), for .mdx output (#152) and for shortcodes to be kept (#159).
- WP to Markdown (seory): Runs in the browser: a WordPress export to a zip of .md files, as slug/index.md or flat files, with year folders and an optional date prefix. Images are not downloaded.
Open requests on the first tool's issue list, checked 16 Nov 2026: #73 Pages with the same name are overwritten, #152 Option to have posts as .mdx rather than .md, #159 Shortcodes kept in resultant markdown.
Sources
Where the rules come from
Each rule the tool applies was read on the vendor's or project's own page. Checked 16 Nov 2026.
| Rule | Source |
|---|---|
| The export file (WXR 1.2): the elements of each item, text in CDATA, the post's address in <link>. | WordPress core: wp-admin/includes/export.php |
| Classic-editor content is saved without <p> tags. wpautop() turns blank lines into paragraphs and single line breaks into <br />, and leaves <pre> alone. | WordPress code reference: wpautop() |
| Content that holds blocks is not passed through wpautop(). | WordPress code reference: do_blocks() |
| How a shortcode is written: [name], [name attribute="value"], [name /], [name]…[/name], and [[name]] for literal text. | WordPress core: wp-includes/shortcodes.php |
| Polylang keeps languages in a taxonomy named "language". In an export that is a <category domain="language"> on each item. | Polylang blog: Polylang 3.4 eases the translation of custom tables |
| WPML's import fields: _wpml_import_language_code holds the item's language code, such as en, fr or pt-pt. | WPML documentation: Multilingual content import |
| WPML Export and Import adds the language fields to files from WordPress's own exporter (Tools, then Export). | WPML documentation: WPML Export and Import |
| Any ASCII punctuation character may be escaped with a backslash, and a backslash at the end of a line is a hard line break. | CommonMark Spec 0.31.2 |
| In MDX a { or < in text must be escaped (\{, \<), HTML comments do not work, and a comment is written {/* ... */}. | MDX documentation: What is MDX? |
| Escapes in a YAML double-quoted string: \\, \", \n, \t, \xNN and \uNNNN. | YAML 1.2.2 specification: escaped characters |
| Astro reads .mdx files in a content collection when the MDX integration is added and the collection's loader matches .mdx. | Astro documentation: @astrojs/mdx |
| A Hugo leaf bundle is a folder with an index.md; a branch bundle has _index.md. | Hugo documentation: Page bundles |
| Hugo's default address matches the file's path within the content folder. | Hugo documentation: URL management |
| Jekyll posts in _posts are named YEAR-MONTH-DAY-title.MARKUP. | Jekyll documentation: Posts |
| A Jekyll permalink can be set in front matter. | Jekyll documentation: Permalinks |
| Eleventy's default address is the input path without its extension: posts/my-post.md becomes /posts/my-post/. | Eleventy documentation: Permalinks |
| Eleventy reads MDX from version 3.0.0, after it is registered in the Eleventy config. | Eleventy documentation: MDX |
Questions
Common questions
Is my export file uploaded?
No. The file is opened and converted by code running in your browser tab, and the zip is built in the same tab. No part of the file is sent to our server, and nothing is stored.
Why are the files named from the address and not the title?
Titles repeat: a multilingual site has one "Contact" page per language, and many sites have two posts with the same title. Named from the title, the second file overwrites the first. The address path is unique on the live site, so it is used instead, and any path that is still taken gets a number.
What happens to shortcodes?
WordPress runs shortcodes when it shows a page; a static site does not have them. Kept as text, they stay in the file as you wrote them, escaped so that Markdown or MDX shows them as text. Mapped, they become component tags in .mdx files, and you write those components in your new site.
Can I import Markdown back into WordPress with this?
No. This tool goes one way, from a WordPress export to Markdown or MDX.
Does the output build in Astro, Hugo, Jekyll or Eleventy straight away?
We do not promise that. The folders and front matter follow each tool's documented defaults, but your site's own setup (collections, schemas, permalinks, components) decides what builds. Treat the zip as a draft and run your build on it.
Where do I put redirects.csv?
Paste it into the redirect workbench on this site. It checks the list and writes the redirect file for your host. Nothing installs redirects for you.
Surge Migrate is not affiliated with WordPress, Polylang, WPML, Astro, Hugo, Jekyll, Eleventy, MDX or the tools named above.
Step 2 of 4: Convert
Free tools that go with this one
This tool does one job in the Convert step. Content into the target system's own format. Each result is a draft to review.
- WordPress export analyserShows the post types, custom fields, shortcodes, blocks, images the export does not list and duplicate slugs in a WordPress export, and takes Divi or WPBakery shortcodes out of a copy.
- Redirect workbenchFinds duplicates, loops, chains and lines a host will not take in a redirect list, then writes draft files for AEM as a Cloud Service, Edge Delivery Services, Shopify, Wix, Framer, Ghost, Apache, nginx and Netlify.
- WordPress export splitterCuts a large WordPress export into smaller export files of a size or item count you choose. Each part keeps the full header with every author, category and tag, each post stays with its media and child pages, and every part is checked against the original. A draft to review.
All free tools, by step and by who they are for →
Moving the whole site? Converted automatically. Checked before you install.
Enter your page addresses. Surge Migrate reads the public pages, converts them into the import format of the system you are moving to, and reports what it could not place. You check the result first, then run the import yourself.