Back to blog
14 min read AI

How to Export and Import WordPress Categories, Tags, and Custom Taxonomies

To export and import WordPress categories, tags, or custom taxonomy terms, export the terms to CSV with their taxonomy, names, slugs, descriptions, and parent references. On the destination site, choose Taxonomy Terms as the import type, map the columns, and match existing terms by slug. After importing, open the term lists and editors to check the hierarchy.

This tutorial uses Import Export by RockStarLab with its PRO add-on. The standard dashboard workflow comes first. The second part shows how a connected AI agent can perform the same task through the plugin’s WordPress abilities.

What this workflow transfers

A taxonomy is a classification system; a term is one entry in that system. category is a taxonomy, while Travel and Europe are terms. This distinction matters because importing a list of terms does not install the code that registers a custom taxonomy.

Data Included in this tutorial? What to check
Term names and slugs Yes The correct taxonomy contains each entry.
Descriptions Yes Punctuation and accented text survive the round trip.
Parent/child relationships Yes, for hierarchical taxonomies Parents resolve to destination terms, not copied source IDs.
Term metadata Simple metadata values Include Term Meta (JSON); inspect values after import.
Post or product assignments No Import the content and its taxonomy assignments separately.
Taxonomy registration and archive templates No The destination needs the relevant plugin, theme, or registration code.
Term images (WooCommerce category and brand thumbnails) Yes, with the Image URL column The import uses the same file in the destination media library or downloads it once. See How to Export and Import WooCommerce Product Categories.
Complex ACF references Requires separate configuration A copied numeric reference is not proof that its related object was transferred.

For a transfer that includes posts and their classifications, see syncing custom post types with ACF and taxonomies. For a store migration involving products, customers, orders, and related records, use the separate WooCommerce store data migration tutorial.

Before you start

  • Install and activate Import Export by RockStarLab and the PRO add-on on both sites. Taxonomy-term workflows require PRO.
  • Use a staging copy first and keep a current backup of the destination.
  • Confirm the taxonomy exists on both sites with the same technical name.
  • Choose whether the import should update matching terms or leave them untouched.
  • Include all parents required by the terms you export.

For built-in post categories, the taxonomy name is category. Post tags use post_tag. WooCommerce product categories use product_cat, and product tags use product_tag. These names are different even when the admin menu labels look similar.

If a custom taxonomy comes from a plugin, activate that plugin on the destination before importing. A CSV containing a taxonomy name does not reproduce its labels, supported post types, permissions, or URL rewrite settings. WordPress explains the registration layer in its custom taxonomy documentation.

Download the sample files

Use these files on a staging site to reproduce the examples. Their names have an RSL prefix so the test entries are easy to identify. The category and product-category files contain child rows before parent rows, which also exercises relationship resolution.

These are files exported by the plugin, not a universal interchange specification for every WordPress importer. Keep an untouched copy before editing them in a spreadsheet application.

Step 1: Choose Taxonomy Terms on the source site

Open Import Export by RockStarLab → Export. Select Taxonomy Terms and click Next Step. Choose Categories (category) in the taxonomy filter.

For a complete category export, select the taxonomy without a restrictive term filter. To narrow the selection, add Term Name → Contains and enter the relevant text. Categories do not need assigned posts to be exported.

Be careful with a filter that selects only a child. If you export Portugal but omit Europe and Travel, you no longer have a self-contained tree. Include the whole branch or plan how the missing ancestors will be resolved on the destination.

Taxonomy export filtered to Categories and term names containing RSL, showing four items
The source selection includes four categories. Keeping the complete branch makes the hierarchy portable.

Step 2: Select the fields needed for a portable export

At Select Fields, add identity, taxonomy, description and hierarchy columns. Use Add all to include the available fields, including Term Meta (JSON).

CSV column Purpose
name The display name; required for import.
taxonomy The destination classification system; required for import.
slug The stable value used for matching in this tutorial.
term_id The source identifier used when resolving relationships.
description The term’s descriptive text.
parent The source parent term ID; zero means a root term.
parent_slug An additional readable parent hint in the export.
term_meta A JSON object containing exported term metadata.
count A reference value about content usage, not a list of assigned posts.

The source’s term_id and term_taxonomy_id are not IDs to force onto the destination. A term can have a different ID after a successful migration. The relationship between the terms is what must survive.

Export structure containing term IDs, names, slugs, taxonomy, description, parent references and term meta
Include the source term ID and parent information when moving a hierarchy. Term Meta (JSON) is a separate field.

Step 3: Export CSV with a header row

Choose CSV, keep the comma delimiter, and enable First row contains column names. Give the file a recognizable name such as wordpress-categories-sample, then click Start Export.

If you open the CSV in Excel, use its text/CSV import controls when automatic delimiter or encoding detection gives an unexpected result. Keep slugs as text and preserve the JSON cell as a single value. Commas inside descriptions or JSON are quoted by the CSV writer; do not remove those quotes manually.

Successful taxonomy CSV export showing four exported items and a 913-byte file
Download the completed export, then check its preview on the destination before importing.

Step 4: Upload the file on the destination

On the destination, open Import Export by RockStarLab → Import, choose Taxonomy Terms, and upload the CSV. Set the delimiter to comma and keep the header-row option enabled.

The preview should show recognizable column names such as term_id, name, and taxonomy. If the column headings are actual data—such as “RSL Europe”—you have a headerless file with the header option enabled. Correct that before proceeding.

Check every row in this small example. Europe points to Travel’s source ID, Portugal points to Europe, and both root categories have parent zero. The descriptions include an accented character and an em dash so encoding errors are visible.

CSV preview showing four category records, parent IDs, parent slugs, descriptions and JSON metadata
The preview confirms the intended taxonomy and source relationships before any destination terms are created.

Step 5: Review the field mapping

Click Auto Map and review the mappings for name, taxonomy, slug, term_id, description, parent and term_meta.

Map source term IDs and parent IDs to preserve hierarchy. Do not map an unmatched column into an unrelated field merely to reach 100%.

The sample metadata contains editorial_note and display_priority. The exporter excludes keys beginning with an underscore and takes the first stored value per exported key; this is not a complete backup of private or repeated metadata.

For a general introduction to the mapping interface, see the WordPress CSV field-mapping guide.

Taxonomy importer showing nine automatically mapped fields out of eleven CSV columns
Review what is mapped, especially taxonomy, name, slug, source ID, parent, and term metadata.

Step 6: Set matching behavior and run the import

Set Check for Existing Items by Field to Slug. For this example, keep Update when a match is found and Create when no match is found. Slug matching is scoped to the row’s taxonomy: a post category and a product category are separate records even if they share a slug.

If existing destination terms must remain untouched, choose Skip for matches instead and test that policy with a small file. Do not use a different matching strategy on each run without checking what it will match.

Turn off automatic media import for text-only term metadata. Term images move with the Image URL column; ACF relationships require their own mapping.

Import options using Slug matching, Update for matches and Create for unmatched terms
Slug matching and a consistent repeat policy prevent this example from creating duplicate categories.

Click Start Import and wait for the final result. The first dashboard import created four categories with zero failed rows. A repeat import through the AI abilities processed the same four records without adding terms; the destination IDs remained 36, 37, 38, and 39.

Import result reporting four successful records, four created terms and zero failures
After import completes, inspect the categories in WordPress.

Step 7: Check the hierarchy in WordPress

Open Posts → Categories. The list should show Travel at the top level, Europe beneath it, and Portugal beneath Europe. Open Portugal’s editor and confirm that Parent Category is Europe. Also compare its slug and description with the source file.

Destination term IDs may differ from source IDs. Check that each child points to its destination parent rather than comparing the numeric IDs across sites.

Destination category editor showing RSL Portugal with RSL Europe selected as its parent
The destination editor confirms the parent and description, rather than relying solely on a successful job status.
WordPress category list showing Travel, nested Europe, and nested Portugal
The restored three-level tree uses destination term IDs. Gear remains a separate root category.

Check metadata through the interface that owns those fields, or use a read-only metadata inspection if no editor exists. WordPress’s standard category editor does not display arbitrary term meta. In this test, the two metadata values were compared separately; the category list and editor supplied the browser checks for visible content and hierarchy.

How to import WordPress tags and custom taxonomy terms

For tags, repeat the export using Tags (post_tag). Use the same import type, Taxonomy Terms, on the destination. The taxonomy column identifies the classification system. Tags are flat, so the two sample tags have parent zero.

After importing tags, open Posts → Tags and check their names, slugs, descriptions and metadata.

For WooCommerce categories, select Product categories (product_cat). Activate WooCommerce on the destination, then inspect the imported hierarchy under Products → Categories.

Product category terms do not create products or assign existing products to categories. Use the WooCommerce CSV or Excel product import tutorial for product records. If your catalog includes variations, follow the variable-product CSV tutorial for parent/variation data.

The same taxonomy-term workflow can be relevant to other registered custom taxonomies, but each provider may add its own metadata and behavior. Test the actual taxonomy you use rather than treating a product-category result as proof for every extension.

Export and import taxonomy terms with an AI agent

Connect the agent to the source and destination using the WordPress abilities and MCP setup guide. Both sites need the relevant plugin capabilities and PRO access. Give the sites unambiguous names; the agent must know which connection is the source and which is the destination.

Prompt 1: Inspect and export

On the source site, discover the available abilities and inspect the
input schemas for taxonomy export. Preview the category terms whose
names contain RSL, including empty terms. Confirm that all parents
needed for Travel → Europe → Portugal are included.

Export term_id, name, slug, taxonomy, description, parent, parent_slug,
and term_meta to CSV. Explicitly include a header row and use a comma
delimiter. Do not change source content. Wait for completion and
return the downloadable file and the final row count.

Read the schemas for rsl-ie-pro/get-content-schema, rsl-ie-pro/export-start, rsl-ie/job-get and rsl-ie/file-get. Set format_options.csv_include_header to true to include column names.

{
  "export_type": "taxonomy",
  "format": "csv",
  "fields": ["term_id", "name", "slug", "taxonomy", "description",
             "parent", "parent_slug", "term_meta"],
  "options": {
    "taxonomy": "post_tag",
    "search": "RSL",
    "hide_empty": false,
    "custom_export_file_name": "wordpress-tags-sample"
  },
  "format_options": {"csv_include_header": true, "csv_delimiter": ","},
  "request_id": "taxonomy-tags-your-unique-run-id"
}

Prompt 2: Prepare and import on the destination

Import the exported terms into the destination staging site.
First confirm that every taxonomy in the CSV is registered there.
Upload the file through the available file-upload abilities, using a
comma delimiter and a header row. Show the preview and validate the
mapping for term_id, name, slug, taxonomy, description, parent and
term_meta. Match by slug within the taxonomy; update matches and
create missing terms. Do not delete unrelated terms or alter posts.

Run the validated import, wait for completion, then check the actual
term lists and parent selectors in the browser. Report created,
updated, skipped and failed records and any mismatched relationships.

File IDs belong to the site that created them. A source export’s file_id cannot simply be passed to the destination importer. The agent downloads the source file, creates a destination upload session, transfers its bytes, completes the upload, and uses the resulting destination file ID.

Upload the file with rsl-ie/upload-create, upload-chunk and upload-complete, then validate and start the PRO import. For slug-based updates, use duplicate_check: "slug" and duplicate_mode: "update".

Prompt 3: Verify a repeat run

Repeat the same category import with the same slug-matching policy.
Record destination IDs before and after. Confirm that no additional
categories are created and that Travel → Europe → Portugal still
has the same parent relationships. Compare descriptions and the
editorial_note and display_priority metadata. Open the destination
category list and Portugal editor to verify the visible result.

Keep the same request ID when retrying one uncertain network request. Use a new request ID for an intentional new import. Background jobs depend on WP-Cron or the host’s cron runner; reading job status does not itself execute pending work.

Check the imported terms

Operation Observed result
Dashboard category export/import Four source categories; four destination terms created; zero failed rows.
Repeat category import Four successful rows; the same four destination IDs; hierarchy retained.
Tag import Two successful rows; both tags visible in the destination admin.
Product-category import Two successful rows; Backpacks nested beneath Outdoor in the browser.
Simple term metadata editorial_note and display_priority preserved across the eight terms.

The tests used WordPress 7.1.3, the installed Import Export 2.0.3 base plugin with PRO active, and WooCommerce 11.2.1 for product categories. They verify a small taxonomy transfer, including child-before-parent rows. They do not establish large-file performance, transfer of post assignments, arbitrary ACF relationships, term images, multilingual associations, or every possible update operation.

Troubleshooting

The import cannot find the taxonomy

Check its technical name and activate the plugin or theme that registers it. A visible label such as “Topics” is not necessarily the identifier expected in the CSV. Confirm the destination admin can manage that taxonomy before retrying.

A child appears at the top level

Check that the parent row is present, that both rows have the same taxonomy, and that source IDs and parent references are mapped consistently. Inspect the completed destination editor rather than an intermediate state while batches are still running.

Existing terms are not being matched

Compare the slugs and taxonomy values, then review the selected matching field. Changing a slug changes the identity used by this tutorial’s repeat policy. Do not assume that a renamed entry will still match through a different field.

The count column is zero after import

That is expected when only the terms have moved. A count is not a set of content relationships. Import and verify the posts or products separately before expecting category archive contents to match.

Metadata is missing or an image points to the wrong object

Confirm Term Meta (JSON) was selected and mapped. For category and brand thumbnails, export and map the Image URL column: the numeric thumbnail_id in Term Meta belongs to the source site and is not copied. Then check the exporter’s scope: private underscore-prefixed keys are excluded from this field, and related objects require more than copying an integer. Test the owning plugin’s editor and rendered output for the specific field type.

After the transfer

Keep the original export with your migration records. Compare a few leaf terms and root terms, check archive URLs where the site uses them, and decide whether content assignments need a separate transfer. If your next task is moving whole store records, continue with the store migration guide. Other workflows are grouped in the written documentation hub.

Frequently asked questions

Can I export WordPress categories to CSV?

Yes. Choose Taxonomy Terms in the export wizard, select Categories (category), add the fields you need, and export CSV with a header row.

Can I import categories and tags with the same importer?

Yes. Both use the Taxonomy Terms importer. The taxonomy column distinguishes category from post_tag; tags do not use a parent hierarchy.

Will importing terms assign categories to my posts?

No. This tutorial transfers the term records. Post and product assignments require a separate content workflow.

How do I preserve parent and child categories?

Include all required parent rows and map source term_id and parent values. After completion, check the destination parent selectors. Source and destination IDs can differ.

How do I avoid duplicates when importing the file again?

Use a consistent matching policy. This tutorial matches by slug within the taxonomy and updates matches.

Does the CSV create my custom taxonomy definition?

Do not rely on it for that. Install or activate the plugin, theme, or code that registers the taxonomy on the destination before importing its terms.

Does Term Meta (JSON) contain every metadata value?

No. Keys beginning with an underscore are excluded, and only the first stored value per key is exported.

Can an AI agent run taxonomy exports and imports?

Yes, when it is connected to the appropriate WordPress abilities and PRO workflows are available. The agent should inspect schemas, validate the mapping, monitor jobs, and verify destination content in the browser.

Dmitriy
About author

Dmitriy

WordPress Developer with 15+ years of commercial experience. Elite Author on ThemeForest and creator of custom WordPress plugins. Passionate about clean code, performance optimization, and building useful tools for the WordPress community.

JOIN THE CONVERSATION

Comments 0

Have a question or a tip to share? Leave it below.

Leave a comment

Your email address will not be published. Required fields are marked *

We store your name, email and comment to show and moderate it; your email is never published. Spam protection is provided by Cloudflare Turnstile and profile pictures by Gravatar. See our Privacy Policy.


Try the plugin with no risks!

New users get 1 month with access to all premium features. Experience the most powerful WordPress data engine today.

Download Now
Get PRO for FREE