Blogging & content · Guide
How to Import Categories in WordPress (Step by Step)
Short answer
To import categories, export content on the source site from Tools, then Export, and import the file on the new site with the WordPress Importer. It creates categories with their slugs, descriptions and parents. For a spreadsheet list, use a CSV import plugin or WP-CLI, and for products use the WooCommerce CSV importer.
Key takeaways
- WordPress has no core tool for importing a plain category list.
- The WordPress Importer creates categories from an export file.
- Existing categories with the same slug are reused.
- CSV imports need a plugin such as a term importer or WP All Import.
- WooCommerce uses a greater-than sign for category hierarchy.
- Create parent categories before their children.
How do you import categories in WordPress?
Export content from the source site under Tools, then Export, then import that file on the new site with the WordPress Importer, which creates the categories along with the posts.
WordPress has no button to upload a plain list of categories. The built-in route moves categories as part of a WordPress export file.
For other situations, such as a spreadsheet of categories or WooCommerce product categories, you use a CSV importer, a plugin or WP-CLI.
This guide covers each method and how to keep parent and child categories in the right order.
Which import method should you use?
Use the WordPress Importer when moving from another WordPress site, the WooCommerce importer for product categories, and a plugin or WP-CLI for a spreadsheet list of categories.
| Situation | Best method |
|---|---|
| Moving posts and categories between WordPress sites | Tools, Export, then WordPress Importer |
| Product categories in WooCommerce | WooCommerce product CSV importer |
| A spreadsheet list of category names | Term import plugin or WP-CLI |
| Converting tags into categories | Categories and Tags Converter |
| A handful of new categories | Add them by hand under Posts, Categories |
If you only need a few, adding them by hand is faster. Our guide on how to add categories in WordPress shows the manual steps.
Step 1: How do you export categories from the source site?
On the source site, go to Tools, then Export, choose All content or Posts, and download the export file, which includes the categories used by that content.
Choosing All content includes every category, even ones with no posts. Choosing Posts with a category filter only includes the categories attached to those posts.
The WordPress Tools Export screen documentation explains the options on this page.
The file is an XML document in WordPress's WXR format. Keep it somewhere safe until the import is finished.
Step 2: How do you import the file on the new site?
On the destination site, go to Tools, then Import, install and run the WordPress Importer, upload the export file, assign authors and submit.
The importer reads the categories and creates them, including names, slugs, descriptions and parent relationships.
Existing categories with the same slug are reused instead of duplicated. That makes it safe to merge content into a site that already has some of the same categories.
If you have not used the tool before, our guide on installing the import plugin in WordPress walks through each screen.
The plugin itself is listed as WordPress Importer on WordPress.org.
Step 3: How do you check the imported categories?
Open Posts, then Categories, and confirm the names, slugs, parents and post counts look right.
The Posts Categories screen documentation describes each column on that page.
Look for duplicates with slightly different slugs, such as news and news-2. These appear when the source and destination already had similar categories.
Merge or delete duplicates and reassign their posts. Our guide on removing categories in WordPress shows how to do that safely.
How do you import categories from a CSV file?
Use a plugin that imports taxonomy terms from CSV, or a CSV import tool such as WP All Import, and map columns for name, slug, description and parent.
WordPress core does not read CSV files for categories. A plugin is the usual route for site owners who keep category lists in a spreadsheet.
Prepare the CSV with one row per category and clear column headings. Include a parent column if you have nested categories.
Several term import plugins exist in the WordPress.org directory. Check that the one you choose is maintained and tested with your WordPress version.
WP All Import can import posts with categories assigned from a column, creating any missing categories as it goes.
How do you import categories with WP-CLI?
Run the wp term create command for each category, or loop through a list of names in a shell script, which is fast for large sets on servers with WP-CLI.
A single category looks like this:
wp term create category "Recipes" --slug=recipes --description="Food and drink posts"
To create a child category, add the parent's term ID with the --parent option.
The wp term create reference lists every option. WP-CLI is documented in full at wp-cli.org.
This method suits developers and agencies setting up many sites with the same structure.
How do you turn tags into categories?
Install the Categories and Tags Converter from Tools, then Import, open it, pick the tags you want to convert and run the conversion.
This tool is listed with the other importers, even though it works on content already on your site. It can convert in both directions.
It is handy after moving from a platform that only had tags or labels. Blogger labels, for example, usually arrive as categories or tags depending on the importer.
Convert carefully. A site with hundreds of tags should not turn them all into categories, since categories work best as a short list of main topics.
Back up the database first. Bulk changes to terms are hard to undo by hand.
How do you import categories from another platform?
Use the importer for that platform under Tools, then Import, since most of them bring the platform's labels, sections or tags across as WordPress categories or tags.
Importers exist for Blogger, Tumblr, LiveJournal and Movable Type, among others. Each maps its own grouping system to WordPress terms in a slightly different way.
Platforms without an importer often export to RSS or CSV. A CSV import tool can then assign categories from a column.
Plan your category structure before you import. Cleaning up a messy structure after the content arrives takes far longer.
How do you import WooCommerce product categories?
Use the WooCommerce product CSV importer under Products, then Import, and put product categories in the Categories column, using a greater-than sign to show hierarchy.
A value like Clothing > Shirts creates Clothing as a parent and Shirts as a child, then assigns the product to Shirts.
Separate several categories for one product with commas. The importer creates any categories that do not exist yet.
WooCommerce documents the column format in its product CSV importer guide.
To create a sample file, export your current products first. Our guide on exporting WooCommerce products explains how.
How do you keep parent and child categories in order?
Make sure every parent category exists before its children are created, either by importing parents first or by using a tool that handles hierarchy automatically.
The WordPress Importer handles this for you. CSV plugins and WP-CLI scripts may not, depending on how they are built.
If a child is created before its parent, it ends up as a top-level category. You can fix it later by editing the category and choosing the right parent.
Sort your CSV so parents come first. It is a simple step that prevents most hierarchy problems.
Keep the depth shallow too. Two levels, such as a main topic and a few subtopics, are easier for readers to browse than four or five nested levels.
Why did the category import fail?
Most failures come from a broken or incomplete export file, upload size limits, timeouts on large files, or CSV columns that do not match the plugin's expected format.
Open the export file in a text editor and check that it ends with a closing tag. A cut-off file stops the import early.
For CSV imports, save the file as UTF-8. Special characters in category names can break otherwise valid files.
If a large import times out, split it into smaller files and run them one after another.
What should you do after importing categories?
Review category slugs and descriptions, set up redirects if URLs changed, and decide which category archives should be indexed by search engines.
Category pages are public archive pages. Thin or duplicate archives can be a problem for SEO.
Our guide on handling category and tag pages for SEO covers indexing choices.
If you are unsure whether some terms should be tags instead, see categories vs tags in WordPress.
Frequently asked questions
Can I import only categories without posts?
Yes, in a few ways. Export All content and the file includes every category, though it also includes posts. A CSV term import plugin or WP-CLI lets you create categories alone. For a handful of categories, adding them by hand under Posts, Categories is quickest.
Will importing create duplicate categories?
The WordPress Importer reuses categories that already exist with the same slug, so it usually avoids duplicates. Similar names with different slugs can still create near duplicates, such as news and news-2. Check the Categories screen after importing and merge any extras.
How do I import categories from Excel?
Save the sheet as a UTF-8 CSV file with columns for name, slug, description and parent. Then use a plugin that imports taxonomy terms from CSV, or a tool like WP All Import, and map each column to the matching category field.
How do I import WooCommerce product categories?
Use the product CSV importer under Products, then Import. Put categories in the Categories column, separate several with commas, and show hierarchy with a greater-than sign. The importer creates missing categories and assigns products to them.
Do category IDs stay the same after import?
Not always. The importer creates new terms on the destination site, which get new IDs. Slugs and names stay the same. Update any menus, widgets, shortcodes or code that refer to categories by ID after the import.
Sources
- Tools Export Screen WordPress.org Documentation
- WordPress Importer WordPress.org
- Posts Categories Screen WordPress.org Documentation
- wp term create WordPress Developer Resources
- Product CSV Importer and Exporter WooCommerce
- WP-CLI WP-CLI
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.



