How To Import And Export Content In WordPress
In this tutorial, you will learn how to import and export content in WordPress using the WordPress Tools menu.
Refer to the following tutorials if you need help with this section:
- The WordPress Tools Menu
- The WordPress Dashboard
- WordPress Posts vs WordPress Pages Explained
- How To Use The WordPress Media Library
Here are just some of the reasons why you may want to move some or all the content from one WordPress site to another:
- Your site has changed focus or direction and some of its content is no longer relevant, so you decide to set up a new site and transfer content that no longer fits the old site to the new site.
- You acquire a site with a large library of content and decide to merge its content with the content on your existing site.
- You purchase content created and formatted for WordPress from a 3rd-party content provider (e.g. a freelance writer).
- You decide to sell the content on your WordPress site to another party.
- You own multiple WordPress sites, and one site isn’t performing well. So, you decide to let the underperforming site go, but you’ve poured a lot of work and energy into this site and don’t want to lose all the content you’ve created for it.
WordPress lets you easily import and export your site’s posts, pages, comments, custom fields, categories, tags, authors, media files, and more from and to other WordPress sites (and even different content management systems) using the built-in ‘Import’ and ‘Export’ tools.
Being able to import and export WordPress data has many uses.
- Making a quick backup of your WordPress content.
- Sharing posts, pages, or other content published on your WordPress site with other WordPress site owners (e.g. affiliates).
- Cloning, duplicating, or distributing content across different WordPress sites from a master site.
- Reimporting content to your existing site (e.g. after reinstalling your site from an old backup file)
- Importing and exporting content from and to other content management systems.
WordPress lets you access useful tools for importing and exporting content in WordPress.
You can access these tools by going to the WordPress Tools Menu and selecting one of the following:
Let’s go over how to use the Import and Export tools by showing you how to export all or part of a site’s content to a data file. We’ll then import or reimport this file back into WordPress.
How To Export Content In WordPress
Let’s say that you want to export all or just some of your site’s content (e.g. to transfer it to another WordPress site).
To export content in WordPress:
- Log into your WordPress admin
- Select Tools > Export from the main menu.
This brings you to the ‘Export’ screen.
The ‘Export’ screen lets you export all or some of your content to an export file.
You can use your exported file:
- To keep a backup of your data (note: the Export tool doesn’t create a full backup of your site, only of your content).
- To move content from one WordPress site to another.
The Tools > Export screen provides several export options:
- All content – Export all content, including posts, pages, comments, custom fields, categories, tags, authors, media files, and more.
- Posts – Export all or only some posts (filtered by categories, authors, dates, and status).
- Pages – Export all or only some pages (filtered by authors, dates, and status).
- Media – Export all or only some media (filtered by date).
These options are in the Choose what to export section of the Export screen.
You can select All content to export all your content…
Or export only selected content using the Export screen’s options and filters.
Depending on the plugins, themes, or custom post types installed on your site (e.g. an eCommerce or Membership plugin), the ‘Choose what to export’ section of the Export screen may display additional types of data that can be exported.
Select an option from the ‘Choose what to export’ section, then click on the ‘Download Export File’ button to export your selected content.
For this tutorial, we’ll export all content…
This will create a file that you can download and save to your computer or a portable drive.
WordPress saves export files in an XML format called WordPress eXtended RSS or WXR.
Depending on the option you have selected, this export file will contain data about your posts, pages, comments, custom fields, categories, tags, etc.
You can rename this file or just save it as is.
Choose where to save your file and click the ‘Save’ button in the Save As window browser that will open after you click the ‘Download Export File’ button.
Your export file will be saved to the specified location (e.g. your hard drive).
Exporting Content From Posts
If you choose to export content from posts only, you will be presented with the following filtering options:
- Categories – Export only posts from a selected category.
- Authors – Export only posts from a specific author.
- Start/End Date – Export only posts within a selected date period.
- Status – Export only posts assigned to a specific status.
To export all your site’s posts, select the ‘Posts’ option, leave all filters as they are, and click on the ‘Download Export File’ button.
Alternatively, use the filters to narrow down which posts you would like to include in your export file.
For example, you can export only posts that fall within a specific category by selecting a category from the Categories drop-down menu.
Similarly, you can use the Status drop-down menu to select and only export content from posts assigned to published, scheduled, draft, pending, or private status (with or without additional filtering options).
Combine the filter selections to narrow and refine your Posts’ export criteria.
Exporting Content From Pages
Exporting content from Pages is like exporting content from Posts.
Select the Pages option and leave all the menus as their default to export all your site’s pages, or use the filters to narrow down which pages you would like to include in your export file:
- Authors – Export only pages from a specific author.
- Start/End Date – Export only pages within a selected date period.
- Status – Export only pages assigned to a specific status.
Click the ‘Download Export File’ button to create your export file.
You can export the content stored in your Media Library.
To export only media content from your site, select the ‘Media’ option in the Choose what to export section, and either leave the filters as they are to export all media, or specify a start and end date period to narrow your selection.
Now that you know how to export content from a WordPress site, let’s look at how to import (or reimport) your exported data file.
How To Import Content In WordPress
As a precaution, we recommend backing up your WordPress site before importing any data.
Also, if you are trying to import a large file, the import script can run into your site’s configured memory limit for PHP, and you will get a “Fatal error” message stating that your allowed memory size has been exhausted.
If this happens, ask your web host to manually increase your PHP memory limit and then run the import script again.
For this tutorial, let’s import the content from the export file we’ve just created into a brand new WordPress site.
To import content into WordPress, log into your WordPress admin, and select Tools > Import from your main menu.
This brings up the Import screen.
The Import screen lets you import content from other content management systems, RSS feeds, and other WordPress sites into your existing WordPress website.
This section also includes the Categories and Tags Converter tool that was mentioned earlier.
Note: To learn how to import content into your WordPress site from other systems (i.e. not WordPress), refer to the official WordPress documentation here: WordPress Codex: Importing Content
To import content from another WordPress site, choose the WordPress Importer tool.
If this is the first time you are importing content using the WordPress Importer tool, you will need to install it on your site.
WordPress can automatically install this tool. Locate the WordPress option on the Import screen and click on Install Now.
Once the tool has been installed successfully, click on Run importer.
Note: If the WordPress Importer tool is already installed, you can click on the ‘Run Importer’ link directly from the Import screen.
Running the Importer tool brings up the ‘Import WordPress’ screen.
The next step is to choose the WXR (.xml) file you want to import into your site.
Click on the ‘Choose File’ button.
Locate and select a saved export file and click ‘Open’.
Once a file has been selected, click on the ‘Upload file and import’ button to begin importing the content from that file.
Once the file has been imported, you will be presented with the Assign Authors screen and asked to assign an author or authors to your imported content, depending on whether your import file contains a single or multiple authors.
You have the option of:
- Importing the original author – If you choose this option, WordPress will:
- Automatically create a new user using the details from your imported file and assign your posts to this user.
- Assign content to a new user – If you choose this option, WordPress will:
- Create a new user with the login name you enter into the ‘create new user with login name’ field) and assign your posts to this user.
- Randomly generate a new password for the new user.
- Set the new user’s role to subscriber.
- You will need to manually change the new user’s details if required.
- Assign imported posts to an existing user – If you choose this option:
- You can reassign the author of the imported item to an existing user of this site, such as your primary administrator account to make it simpler for you to edit and save the imported content (you can change post authors later), or
- make sure you have already created the user account you plan to assign your imported content to (if you need help with this step, see our tutorial on How To Manage WordPress Users)
In addition to assigning authors to your imported content, you also have the option to download and import file attachments.
If you want to import things like post images from the import file, then tick the checkbox next to ‘Download and import file attachments’ before clicking the Submit button.
If there are no issues, all data will be successfully imported, and you will see an “All done. Have fun!” message like the one shown below (and a reminder to update the passwords and roles of imported users).
Occasionally, if you’re reimporting data into an existing WordPress site, you may see a message letting you know that certain users or files already exist.
In this case, WordPress will go through the process and skip importing duplicate (i.e. existing) files.
After the import process is complete, you can check the results of your import.
To do this, click on the link on the screen to return to the WordPress dashboard.
You can see how many content items have been added to your new WordPress site in the dashboard ‘At a Glance’ section.
As a final check, we recommend visiting different areas of your site’s admin section (e.g. posts, pages, comments, tags, categories, etc.) to view and inspect the imported content.
Congratulations! Now you know how to use the WordPress Tools menu to export and import content from and to your site.