What is the WordPress Export and Import feature?
WordPress has a built-in feature that allows you to export and import data from the admin panel.
The export feature allows you to output data such as posts, pages, custom post types, media, and taxonomies as an “XML file.”
The import feature, on the other hand, is used to bring that XML file into another WordPress environment.
By using this feature, you can easily transfer data from a production environment to a local environment or hand over data to another site.
However, some data, such as media files (actual images), are not included in the XML file, so separate migration work is required.
- Export feature: Available from Admin Panel [Tools] → [Export].
You can output XML files for each required data type. - Import feature: Available from Admin Panel [Tools] → [Import].
Requires installation of the WordPress Importer (plugin).
For large amounts of data, special custom posts, or plugin-specific data migration, additional measures or different tools may be required. Details will be explained in the latter half of this article.
When transferring data from a WordPress production environment to a local environment, you may use the export/import feature in the admin panel to split and migrate data.
However, if you don’t import in the proper order considering data dependencies, errors or inconsistencies are likely to occur. Also, for media (such as image files), care must be taken with file handling.
This article explains the recommended order for split imports, how to migrate media files, and important points to watch out for.
1. Recommended import order
WordPress data such as posts, pages, custom post types, custom fields, and taxonomies (categories and tags) are often complex and interrelated.
Therefore, importing in the following order will make the process smoother.
- Taxonomies (categories, tags, etc.)
Since these are classification data for posts and custom posts, register them first. - Field groups and fields (e.g., custom field settings)
Preparing the custom field structure first ensures proper linkage to posts. - Post types (custom post type definitions)
If custom post types are not registered first, those posts cannot be imported. - Posts (standard blog posts)
- Pages
- Custom posts (e.g., “Achievements,” “Customer Testimonials”)
- Plugin settings such as contact forms
- Media (images, files)
* Actual files often need to be migrated separately (details explained later).
2. How to migrate media
In WordPress’s export/import feature, the post XML data contains image URLs, but not the actual image files.
Therefore, for images to appear in the local environment after import, you must place the image files in the same location.
Generally, you download the wp-content/uploads
folder from the server via FTP or SFTP and upload it to the same location in the local environment. This ensures images display correctly and remain linked to the posts.
What about retrieving images using the admin panel import feature?
If you select the “Download and import file attachments” option during import, images can be retrieved automatically. However,
- Processing is extremely slow if there are many images
- High risk of the process stopping midway
- Prone to failure
Therefore, it’s not recommended for large-scale sites.
3. Common issues and solutions
Re-saving permalink settings
In the local environment, re-saving the “Permalink Settings” once will regenerate the .htaccess file correctly and make page links work properly.
Notes on migrating plugins
Some plugins are difficult to migrate, and errors may occur due to version differences. Check plugin compatibility and configuration methods before migration.
Direct database migration
For large amounts of data or many custom posts, exporting and importing the database via phpMyAdmin can be effective.
4. Migration steps summary
Order | Data Type | Notes |
---|---|---|
1 | Taxonomies (categories, tags) | Classification information for posts, etc. |
2 | Field groups and fields | Custom field structure |
3 | Post types (custom post type definitions) | Register post types first |
4 | Posts (blog posts) | Standard posts |
5 | Pages | Page content |
6 | Custom posts | Custom post content |
7 | Plugin settings such as contact forms | Export each plugin’s settings |
8 | Media (images, files) | Copy uploads via FTP, then import “Media” |
During migration, check progress at each step and pay special attention to media migration and plugin settings. If errors occur, consult the official documentation or contact the plugin developer.