How to import content into WordPress
For content from another WordPress site, use Tools → Import with a WordPress XML export. CSV, XML, custom fields and scheduled updates usually need an importer plugin or custom code. For repeat or large imports, use WP-CLI or a mapped import tool rather than uploading everything manually.
- 01Check the source and destination
- 02Prepare the content structure
- 03Use the built-in importer
- 04Map and test imported records
- 05Handle large imports safely
- 06Choose an importer for repeat jobs
What you need
- Administrator access to the destination site
- A backup of the destination site
- A WXR, CSV or XML source file
- The destination post types, taxonomies and custom fields already created
Check the source and destination
Identify what you are importing: posts, pages, media, users, comments, taxonomies, custom post types or custom fields. A WordPress export uses the WXR XML format and can contain posts, pages, custom post types, comments, custom fields, categories, tags, custom taxonomies and users.
Back up the destination site first. If an import stops halfway, WordPress may already have created some records, so running it again can create duplicates.
Prepare the content structure
Install and activate the theme and plugins that provide any required custom post types, taxonomies or custom fields before importing. Otherwise, imported values may have nowhere to go or may appear as ordinary post content.
For a CSV or general XML file, clean the data before uploading it. Give each record a stable identifier, check date formats, remove empty rows and make sure image URLs are publicly reachable from the destination server.
Use the built-in importer
For content exported from another WordPress site, open Tools → Import. Under WordPress, install the importer if it is not present, select Run importer, choose the WXR XML file and upload it. WordPress then asks you to map authors to existing users or create new ones.
Select the option to download and import file attachments if you want WordPress to fetch linked media. This can fail when the old site is protected by a login, blocks requests or has unreachable image URLs, so check the media library after the import.
Map and test imported records
For CSV or XML imports, map each source column to the destination title, content, slug, author, status, date, taxonomy and custom-field value. Import five to ten records first, then check the front end, edit screens, permalinks, featured images and taxonomy archives before importing the full file.
Do not assume that an image URL in a CSV means the image is attached to a post. The file must be downloaded into the Media Library and then assigned to the relevant content or custom field.
Handle large imports safely
Large WXR files can exceed the server's memory limit. Split the XML into smaller files or ask your host to increase the available PHP memory. WordPress documents this as a common cause of failed imports.
If you have shell access, the faster route for a WXR file is wp import content.xml --authors=create. WP-CLI can also map authors, skip attachments, rewrite old URLs and show more detail when an import fails.
Choose an importer for repeat jobs
The native importer is fine for a one-off WordPress-to-WordPress move. For recurring CSV or XML imports, field mapping, custom post types, scheduled synchronisation or import logs, use an importer plugin instead of rebuilding the process each time.
Fast way: install MEC - Advanced Importer Addon, upload the CSV or XML file, map its fields to posts, events or custom post types, run a small preview import and then schedule the job if the results are correct.
Let MEC - Advanced Importer Addon do it
Bulk CSV/XML imports with field mapping and scheduled syncs, best for events, posts, and custom post types.
Sources
- wordpress.org /documentation/article/tools-export-screen/?utm_source=opena…
- developer.wordpress.org /advanced-administration/wordpress/import/?utm_source=openai
- wordpress.org /support/topic/failed-to-import-media-14/?utm_source=openai
- developer.wordpress.org /cli/commands/import/?utm_source=openai
Questions
- Can WordPress import a CSV file without a plugin?
- No, WordPress's native content importer is intended for WordPress WXR XML files, not arbitrary CSV files. A CSV normally needs a dedicated importer plugin, a custom script or a command-line process that converts each row into a WordPress post, page or custom post type. WooCommerce provides its own CSV importers for products and tax rates when WooCommerce is installed.
- What happens to images during a WordPress import?
- Images are imported only when WordPress can download the referenced files and the importer is told to fetch attachments. Check that the old site is publicly accessible, image URLs still work and the destination server can make outbound requests. Featured images can fail separately from images embedded in post content, especially with custom post types or unusual attachment metadata.
- Why did my import create duplicate posts?
- Duplicate posts usually appear when an import failed after creating some records and you started the same file again. Review the destination before retrying, remove partial records or restore the backup, then import a smaller file. Test with a few records first and keep the original file unchanged so you can identify which items were already created.
- Is WP-CLI quicker than importing from the dashboard?
- WP-CLI is usually the quicker and more controllable route for a WXR import when you have shell access. The <code>wp import</code> command supports author handling, attachment options, URL rewriting and detailed output. It does not by itself turn an arbitrary CSV into WordPress content, so CSV imports still need a suitable importer or custom script.