Setup & site building · Guide
How to Export and Import WordPress Content

Short answer
Export WordPress content from Tools, then Export, which downloads a WXR file with your posts, pages, comments, custom fields, categories and tags. On the destination site, go to Tools, then Import, install the WordPress Importer, upload the file and map the authors. Themes, plugins, settings and media files do not move with it.
Key takeaways
- A WXR export holds posts, pages, comments, custom fields, categories and tags, but not themes, plugins, settings or media files.
- The export file is not a full backup, and it skips auto-draft posts and post types that do not allow export.
- The WordPress Importer installs from Tools, then Import, and version 0.9.7 was updated on 20 October 2026.
- Tick Download and import file attachments during import, and keep the source site online until the media downloads.
- A failed import may leave partial content behind, so remove those records before you retry.
- WP-CLI wp export splits output at 15 MB per file by default, and wp import can rewrite URLs to the new address.
What does the WordPress export tool move, and what stays behind?
The export tool moves your content records, such as posts, pages, comments, custom fields, categories and tags, in one XML file called WXR.
WXR stands for WordPress eXtended RSS. The Learn WordPress Tools: Import and Export lesson states that the file holds posts, pages, comments, custom fields, categories and tags. It also carries terms, navigation menus and custom posts when you pick “All content”.
The file is not a copy of your site. The export code itself warns that the file “is not intended to serve as a complete backup of your site”, as shown in the export_wp() reference. Your theme, plugins, settings and media files stay behind.
WP-CLI's wp export documentation states the same limit: WXR files hold authors, terms, posts, comments and attachments, but not site configuration or the attachment files themselves.
| What moves in a WXR export | What stays behind |
|---|---|
| Posts, pages and custom post types | Themes and theme settings |
| Comments and custom fields | Plugins and plugin settings |
| Categories, tags and terms | Site settings and options |
| Navigation menus | Media files themselves (URLs only) |
| Authors | Database and server files |
The export also skips posts with the auto-draft status, and it only exports post types that allow export, as the export_wp() reference states.
Because the export is only content, pair it with a real backup before any move. The guide to how to back up WordPress covers a full backup of files and database.
How do you export WordPress content from the dashboard?
Go to “Tools → Export”, pick what to export, then click “Download Export File” and save the XML file.
Follow these steps:
- Log in as an administrator on the source site.
- Go to “Tools → Export” in the left menu.
- Pick “All content” for the full set, or pick one type such as posts, pages or media.
- Set the filters if you picked one type, such as author, category, date range or status.
- Click “Download Export File” and save the file on your computer.
The Learn WordPress Tools: Import and Export lesson states that “All content” holds all posts, pages, comments, custom fields, terms, navigation menus and custom posts.
Post filters cover category, author, date range and status. Page filters cover author, date range and status, and media filters cover date range only.
The file name follows the pattern shown in the export_wp() reference: your site name, then “WordPress”, then the date, then “.xml”. Keep the file safe until the import is done.
Note one gap: media items in the Media Library that are not attached to a post or page are not included in the XML export, as the Learn WordPress Tools: Import and Export lesson states. Move those files by hand if you need them.
How do you import a WXR file on the destination site?
Go to “Tools → Import”, click “WordPress”, install the WordPress Importer, run it, upload your WXR file and click “Upload file and import”.
Follow these steps:
- Log in as an administrator on the destination site.
- Go to “Tools → Import” in the left menu.
- Find “WordPress” at the bottom of the list and click “Install Now”.
- Click “Activate Plugin & Run Importer” when the install finishes.
- Click “Choose File”, pick your WXR file, then click “Upload file and import”.
The WordPress Importer plugin page gives these exact four steps for the quickest install.
The importer brings in posts, pages and other custom post types, comments and comment meta, custom fields and post meta, categories, tags and terms from custom taxonomies, and authors, as the WordPress Importer plugin page states.
The current release is version 0.9.7, updated 20 October 2026, as the WordPress Importer plugin page shows.
If the destination site uses a different theme, install and activate the source site's theme first. The Learn WordPress Tools: Import and Export lesson states that the content moves without the design, so templates and menus may look wrong until the theme matches.
How do you map authors and import media during import?
On the import settings screen, map each author in the file to a user on the new site, tick “Download and import file attachments” if you want the media, then click “Submit”.
The import handbook states that you are first asked to map the authors in the export file to users on the blog, as the Importing Content handbook explains. For each author, you may map to a user who already exists or create a new user.
Map authors before the import runs, or posts may land under the wrong user.
The same handbook states that you can import attachments by checking the “Download and import file attachments” option, as the Importing Content handbook explains. With that box ticked, WordPress fetches each image from the source site and saves a copy in the new Media Library.
That fetch only works while the source site stays online. The WordPress.com import guide notes that the import does not delete or overwrite content already on the new site.
What should you do when the import file is too large?
Split the export into smaller files, raise the PHP memory limit, or ask your host to run the import, since a large file can run out of memory.
The Importing Content handbook warns that a file that is too large may run out of memory, and you may see an error such as “Fatal error: Allowed memory size of 8388608 bytes exhausted.” That number is 8 MB, a common limit on older shared hosting.
You have three ways forward:
- Split the export into smaller files and import each one in turn.
- Edit the
php.inifile to raise the memory limit, if you have access to it. - Ask your hosting provider to raise the limit or run the import for you.
The WordPress Importer plugin page gives the same advice: break a large XML file into smaller pieces and run the import one piece at a time.
A failed import may still create some content before it stops. The Importing Content handbook warns that a failed import may create some content, and trying again may create duplicate data. Check Posts and Pages after a failed run and remove the partial records before you retry.
Large exports from WordPress.com need care too. The WordPress.com import guide states that an export with more than about 1,000 pages or posts arrives as a zip holding several XML files, to import one by one.
The All-in-One WP Migration import limit guide covers the size limits of a common migration plugin if you go that route instead.
How do you export and import with WP-CLI?
Run wp export to write WXR files from the command line, then run wp import with the file name to load them into the destination site.
WP-CLI is the command-line tool for WordPress. The WP-CLI site states that anything you can do in the admin can be done from the terminal, including importing content.
To export, run a command such as:
wp export --dir=/tmp/export --post_type=post --start_date=2026-01-01
The wp export documentation states that one export file holds at most 15 MB by default, and you can pass --max_file_size=-1 for no limit. The file name follows the pattern {site}.wordpress.{date}.{n}.xml.
You can export named posts by ID with --post__in=123,124,125, as the wp export documentation shows.
To import, run a command such as:
wp import export.xml --authors=create
The wp import documentation states that --authors=create makes any users from the file that do not exist yet, while --authors=skip maps posts to existing users only. You can also pass --skip=attachment to skip media, or --skip=image_resize to skip thumbnail generation and save time.
The same page notes that --rewrite_urls changes imported URLs to the new site address, and it needs WordPress Importer version 0.9.1 or newer.
When should you use a migration plugin instead of the built-in tools?
Use a migration plugin when you need to move the whole site, including theme, plugins, settings and media files, since the built-in tools move content records only.
The built-in export and import suit a content move between two working sites. A migration plugin suits a host move, a domain change, or a full copy of a site. Pick by what has to move, not by habit.
| Method | Moves | Best for |
|---|---|---|
| Tools → Export and Import | Content records only | Moving posts and pages to a live site |
| WP-CLI wp export and wp import | Content records only | Scripted or filtered content moves |
| Migration plugin | Files, database, theme, plugins, media | Moving a whole site to a new host |
| Manual SFTP plus database copy | Everything, by hand | Large sites or full control |
The Learn WordPress Tools: Import and Export lesson states that moving content does not include the site's design, themes or plugins, and that a migration plugin can move the whole site.
The guide to how to migrate WordPress to a new host covers the full move in order. Read it before you move a live site to new hosting, since a content export alone will not carry the design over.
How do you check the import worked?
Open Posts, Pages, Media and Comments on the destination site and count the records, open a few posts, and click the images to confirm they load.
Compare the counts of posts, pages and comments on both sites. A gap points at a skipped post type or a failed run.
Open a few posts at random and check the text, the featured image and the author name. Then open the Media Library and confirm the images are local files, not links to the source site. Images that still point at the old address will break when the source site goes away.
What mistakes should you avoid?
Do not treat a WXR file as a backup, do not delete the source site before you check the import, and do not retry a failed import without removing the partial records first.
Other mistakes to avoid:
- Exporting only posts when you also need pages, menus and comments.
- Forgetting to tick “Download and import file attachments”, which leaves images pointing at the old site.
- Mapping every author to one user, which loses the bylines on multi-author sites.
- Importing a full export twice, which creates duplicate posts and pages.
- Switching off the source site before the media download finishes.
Frequently asked questions
Is a WordPress export file a full backup of my site?
A WXR file is not a full backup. It holds content records such as posts, pages, comments, custom fields and terms, but it leaves themes, plugins, settings and media files behind. Use a full backup of files and database before any site move.
Will my images move with a WordPress export?
Yes, if you tick Download and import file attachments during import. WordPress then fetches each image from the source site and saves it in the new Media Library. Keep the source site online until the import finishes, or the download has nowhere to fetch from.
What should I do if my WordPress import fails halfway?
A failed import may create some content before it stops, so check Posts and Pages and remove the partial records before you retry, or you may get duplicates. If the file is large, split it into smaller files or ask your host to raise the PHP memory limit.
Can I export and import WordPress content with WP-CLI?
Yes. WP-CLI gives you wp export with filters for post type, author, category, status and date range, plus wp import with author mapping and URL rewriting. It suits scripted moves and large sites where the dashboard export is too slow.
When should I use a migration plugin instead of the built-in tools?
The built-in tools move content records only. Use a migration plugin when you need the theme, plugins, settings, media files and database as well, such as a move to a new host or a change of domain name.
Does the export include unattached media files?
No. Media items in the Media Library that are not attached to a post or page are left out of the export. Check for unattached files before you move, and copy any you still need by hand or with a migration plugin.
Sources
- Tools: Import and Export Learn WordPress
- Importing Content WordPress Developer Resources
- WordPress Importer WordPress.org
- wp export WordPress Developer Resources
- wp import WordPress Developer Resources
- Import content to WordPress from another site WordPress.com Support
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.


