Setup & site building · Guide
How to Open WordPress XML (Step by Step)

Short answer
Open the export in a code editor such as VS Code or Notepad++ to read and search it, or drag it into a browser to check it is valid. To see the content as real posts and pages, import it into a test WordPress site with Tools > Import > WordPress.
Key takeaways
- A WordPress XML export is plain text in the WXR format.
- Code editors are the easiest way to read and search it.
- Browsers quickly show whether the XML is valid.
- The file lists image URLs but does not contain the images.
- Import into a test site to see the content as posts and pages.
- Keep an untouched copy before editing by hand.
How do you open a WordPress XML file?
Open a WordPress XML export in a code editor to read it, in a browser to check its structure, or import it with Tools > Import to see it as normal posts and pages.
The file you get from Tools > Export is a WordPress eXtended RSS file, usually called a WXR file. It ends in .xml and holds your posts, pages, comments, categories, tags and custom fields as plain text.
Because it is plain text, you do not need special software. The best way to open it depends on what you want to do:
| Goal | Best way to open it |
|---|---|
| Read or search the content | Code editor such as VS Code or Notepad++ |
| Check it is valid and complete | Web browser or XML validator |
| Edit a few values | Code editor, with care |
| See it as a website | Import into a WordPress or local site |
| Work with it as a spreadsheet | Convert to CSV, or use an import plugin |
If you do not have the file yet, our guide on getting your WordPress XML file explains how to export it.
How do you open the XML file in a text editor?
Right-click the file, choose Open with, and pick a text or code editor; a code editor is better than Notepad because it colours tags and handles large files.
Basic editors such as Notepad or TextEdit can open the file, but WordPress exports put a lot of text on long lines. A code editor makes it much easier to read.
Good free options:
- Visual Studio Code on Windows, Mac and Linux.
- Notepad++ on Windows.
- Any editor with XML syntax highlighting.
Steps in VS Code:
- Open VS Code.
- Go to File > Open File and choose your
.xmlexport. - If it opens as plain text, click the language label in the bottom bar and choose XML.
- Use Find to search for a post title or URL.
On a Mac, avoid editing in TextEdit with rich text on. It can change quotes and break the file. Use plain text mode or a code editor.
How do you view the XML file in a browser?
Drag the file into Chrome, Firefox, Edge or Safari, and the browser shows it as a tree of tags or an error if the XML is broken.
This is a quick way to check the file is valid. Browsers refuse to display XML with errors and point to the line where parsing failed.
Steps:
- Open a new browser tab.
- Drag the
.xmlfile into the window, or use File > Open. - Expand and collapse the tags to explore.
Some browsers show the file as an RSS feed or plain text instead of a tree. That is fine. If you see an error message with a line number, the file is damaged or incomplete, which often happens when an export times out.
Our guide on fixing WordPress export errors covers why exports break.
What is inside a WordPress XML file?
A WordPress XML file is an RSS feed with extra WordPress tags, where each post, page, attachment and menu item is an item element holding its title, content, dates, status and custom fields.
The rough structure looks like this:
<rss version="2.0">
<channel>
<title>Your Site</title>
<wp:author>...</wp:author>
<wp:category>...</wp:category>
<item>
<title>Hello world!</title>
<link>https://example.com/hello-world/</link>
<content:encoded>Post content, wrapped in a CDATA section</content:encoded>
<wp:post_id>1</wp:post_id>
<wp:post_type>post</wp:post_type>
<wp:status>publish</wp:status>
<wp:postmeta>...</wp:postmeta>
</item>
</channel>
</rss>
Useful tags to search for:
<wp:post_type>tells you if an item is a post, page, attachment, menu item or custom type.<content:encoded>holds the post content, including block markup.<wp:status>shows publish, draft, private or trash.<wp:postmeta>holds custom fields, such as SEO data or product details.<wp:attachment_url>lists media file URLs.
If you want to understand XML itself, MDN's introduction to XML is a clear starting point.
Does the XML file contain images?
No, the XML file only lists image URLs; the actual image files stay on the original server and are downloaded during import if that site is still online.
This surprises many people who expect a full backup. The export includes attachment entries with their URLs, titles and captions, but not the files.
What this means:
- If the old site is still live, the importer can download images using those URLs.
- If the old site is gone, you need a copy of the
wp-content/uploadsfolder from a backup. - Opening the XML in an editor will not show any pictures.
For a full copy of a site, including files and settings, a backup or migration plugin is a better tool. Our guide on whether you can export a WordPress site compares the options.
How do you open the XML file in WordPress?
To see the content as real posts and pages, import the file into a WordPress site using Tools > Import > WordPress, ideally on a local or test site first.
Steps:
- Set up a test site. A local tool such as Local works well.
- Go to Tools > Import.
- Under WordPress, click Install Now, then Run Importer.
- Choose your XML file and upload it.
- Assign authors and tick Download and import file attachments if you want images.
- Click Submit.
The WordPress Importer plugin page explains the importer's options. Our guide on importing a WordPress XML file covers errors and large files.
Importing to a test site first is safer than importing into a live site. You can check the content without creating duplicate posts on your real site.
Can you open WordPress XML in Excel?
Excel can open XML, but WordPress exports have nested tags and long HTML content, so the result is usually messy; a converter or an import plugin gives cleaner columns.
If you open the file directly in Excel, it may ask how to open it and then flatten the data into many rows and columns. Post content with HTML often breaks across cells.
Better approaches:
- Use an online or desktop XML to CSV converter, then open the CSV.
- Export from WordPress straight to CSV with an export plugin instead of using the XML file.
- Use an import plugin such as WP All Import, which reads the XML and lets you map fields.
Our guide on how to use WP All Import shows how field mapping works.
Is it safe to edit the XML file by hand?
Small edits such as fixing a URL or removing an item are fine in a code editor, but always keep an unedited copy, because one broken tag stops the whole import.
Tips for safe edits:
- Back up first. Save a copy of the original file before you change anything.
- Use search and replace carefully. For example, change an old domain to a new one in image URLs.
- Keep tags balanced. Every
<item>needs its matching</item>. - Do not touch CDATA markers. The CDATA wrappers around titles and content protect text with special characters.
- Validate after editing. Open the edited file in a browser to check it still parses.
Avoid editing serialized data inside <wp:postmeta> values. Changing the length of serialized text breaks it, and the importer may skip those fields.
Why will the XML file not open?
If the file will not open, it is usually very large, incomplete because the export failed, saved with the wrong extension, or blocked by your computer's default app settings.
Common fixes:
- Very large file: use a code editor built for big files, or split the export by post type or date range in Tools > Export.
- Cut-off file: if the end of the file is missing
</channel>and</rss>, the export did not finish. Export again. - Wrong app: right-click and choose Open with to pick a text editor rather than a browser or spreadsheet.
- Zipped file: some hosts and tools deliver exports as
.zip. Extract it first.
The WordPress.org page on the Export screen shows the filter options that help you create smaller files.
If you want the importer to handle the file for you, our explainer on what the WordPress Importer is covers what it can and cannot bring across.
Frequently asked questions
What program opens a WordPress XML file?
Any text editor can open it because it is plain text. A code editor such as Visual Studio Code or Notepad++ is the most practical choice because it highlights tags, handles long lines and lets you search the content quickly.
Why does my WordPress XML file have no images?
WordPress exports only include image URLs and details, not the files. During import, WordPress can download them from the original site if it is still online. Otherwise you need the uploads folder from a backup.
Can I convert a WordPress XML file to CSV?
Yes. You can use an XML to CSV converter, though nested data and HTML content may need cleaning. An easier route is to export directly to CSV with an export plugin, or read the XML with an import plugin that maps fields.
Can I open a WordPress XML file without WordPress?
Yes. You can read it in a text editor or browser without WordPress. To see posts and pages laid out as a website, though, you need to import the file into a WordPress install, such as a free local site.
Why is my WordPress XML file not valid?
The export may have stopped early because of a server timeout, leaving missing closing tags. Hand edits can also break tags or CDATA markers. Export again, or split the export into smaller files by post type or date.
Sources
- Tools Export Screen WordPress.org
- WordPress Importer WordPress.org
- XML introduction MDN Web Docs
- Visual Studio Code Microsoft
- Notepad++ Notepad++
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


