How to convert a wordpress wxr export to json
- Step 1Export from WordPress Admin — Go to WordPress Admin →’ Tools →’ Export. Choose 'All content' or a specific post type (Posts, Pages, or a registered custom post type). Click 'Download Export File' to get the .xml WXR file.
- Step 2Upload the WXR file — Drop the .xml file into the converter. The tool detects the WXR namespace automatically and maps channel/item elements to a JSON post array.
- Step 3Filter by post type and status — Use the filter options to include only published posts of a specific type — for example only records where wp:post_type is 'post' and wp:status is 'publish' — to avoid importing drafts, revisions, and attachment records into your target CMS.
- Step 4Download and write the import script — Save the JSON and write an import loop that iterates the array and calls your target CMS's content API — Contentful's management API, Sanity's client.create(), or a custom REST endpoint — to create each content item.
Frequently asked questions
How is the post body (content:encoded) handled in the output?+
The content:encoded field — which contains the full HTML post body — is extracted as an HTML string in the content field of each JSON object. For headless CMS targets that require rich text or Portable Text (Sanity) or structured content (Contentful), run the HTML through an HTML-to-rich-text conversion library like @contentful/rich-text-from-markdown or sanity-blocks-vue-component after import.
What about media attachments and images referenced in posts?+
Attachment posts (where wp:post_type equals 'attachment') appear in the output with their file URL in the guid field. WordPress exports do not embed binary image data in the XML. You need to download the images separately by fetching each guid URL and re-uploading them to your new media storage.
Is the post content transmitted to JAD Apps?+
No. WXR parsing runs entirely in your browser using fast-xml-parser. Blog content, draft text, and author information are never transmitted to JAD Apps servers.
Privacy first
Conversion runs locally in your browser. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.