How to migrate WordPress taxonomy terms for an auto blog cleanly: Move the terms first, then map posts to the same term IDs or slugs. That is the clean…
Last updated: November 27, 2026
Move the terms first, then map posts to the same term IDs or slugs. That is the clean way to migrate WordPress taxonomy terms for an auto blog without ending up with duplicate categories, broken tags, or orphaned custom taxonomies. If the target site already has posts imported, the taxonomies need a 2-part check: structure and assignment.
Key takeaways
- Export the taxonomy data separately from the post content so the term list stays intact.
- Match on
term_slugwhen names repeat or change, and useterm_idonly when the source and target share the same database history. - Categories, tags, and custom taxonomies do not all behave the same during import, so one blanket import can leave gaps.
- Duplicate terms happen when the same label is created twice under different IDs.
- A clean move ends with posts attached to the right terms, not just the right term names.
What does taxonomy migration mean?
Taxonomy migration means copying the WordPress term records and their relationships so categories, tags, and custom taxonomies still point to the right content after a move. In WordPress, that means checking wp_terms, wp_term_taxonomy, and wp_term_relationships, not just the visible labels in the dashboard.
For an auto blog, this matters more than it does on a small site because feeds often create many posts with the same 10 to 30 labels. If the terms are duplicated during import, the archive pages split apart and a tag like “news” can end up with 2 versions that look the same but are not the same term. WordPress documents custom taxonomies in its developer handbook and the term functions in the code reference:
https://developer.wordpress.org/plugins/taxonomies/working-with-custom-taxonomies/
https://developer.wordpress.org/reference/functions/wp_set_object_terms/
A clean migration is not the same as copying a CSV of names. The name is only part of the record. The slug, parent term, taxonomy type, and relationships to posts all matter. If any one of those gets rebuilt incorrectly, the archive still loads, but the site starts sorting content into the wrong buckets.
What should be exported first?
Export the term structure first, before you import content relationships. That means categories, tags, and any custom taxonomy definitions or term records that your auto blog depends on.
Use term_slug as the safest join key when the destination site may already have overlapping names. A slug such as world-news is more stable than a display name like World News, which can change case or spacing and still look “correct” in the dashboard. If the source and target are part of the same database move, term_id can stay useful, but it should not be trusted across separate imports.
The structure you want to preserve is simple to list:
- taxonomy name, such as
categoryor a custom taxonomy; - term name;
- term slug;
- parent term for hierarchical taxonomies;
- assigned post relationships.
If the migration tool only brings over post rows and ignores the term tables, the result is not a taxonomy migration. It is a content import with missing labels. That works for a test site with 5 posts and fails fast on an auto blog with hundreds or thousands of archive entries.
How do I move the terms without making duplicates?
Move the terms by importing the term records once, then matching every post to the existing term instead of creating a new one. The cleanest process is a 3-pass migration: terms, relationships, then verification.
-
WP-CLI: list the source terms. Export the categories, tags, and custom taxonomies with their slugs and parent IDs so you know what must exist on the target site. This gives you the reference set before any import changes the database.
-
WordPress admin: import the term structure. Load the term records into the target site so the taxonomy exists before the posts arrive. The result should be a visible term list with the same names and slugs, not a second copy of the same labels.
-
Database or import tool: map by slug, not label. Match each incoming term to the existing
term_slugand reuse that term instead of creating a new one. This is the step that stops duplicate “News” or “Tech” terms from splitting the archive. -
WordPress admin: attach imported posts to the existing terms. Reassign each post to the imported term ID that already exists in the target site. When this works, the post count on each archive page lines up with the source site.
-
WP-CLI: check the relationship count. Compare a small sample of term archives and confirm that the post totals match the source taxonomy set. If a term has 0 posts or 2 nearly identical versions appear, the mapping step needs another pass.
The biggest mistake is letting the importer create terms on the fly from post content. That creates two problems at once: duplicates and orphaned posts. It also makes cleanup harder, because deleting the wrong duplicate can remove relationships from posts that were already mapped.
How do categories, tags, and custom taxonomies differ?
Categories, tags, and custom taxonomies differ in structure, so they do not all survive a migration the same way. Categories are hierarchical, tags are flat, and custom taxonomies can follow either pattern depending on how they were built.
That difference matters during migration because a parent category can break if the child term is imported before the parent exists. A tag does not have that parent-child problem, but it can still duplicate by slug if the importer treats it as a new record. Custom taxonomies are the easiest place for trouble because they are often added by a plugin or theme, and the destination site may not have the same taxonomy registered yet.
| Taxonomy type | Main risk in migration | What to check before import | What failure looks like |
|---|---|---|---|
| Categories | broken parent chain | parent term exists first | child terms float at top level |
| Tags | duplicate slugs | slug matches an existing tag | 2 tags with the same label |
| Custom taxonomies | missing registration | taxonomy name is active on target site | terms appear in the database but not in the UI |

A plain import tool often handles categories and tags well enough for a small site, but custom taxonomies need more care. If the target site does not register the same taxonomy name, the terms can land in the database and still not appear where the editor expects them. That is why taxonomy migration is not just a content move.
What breaks after the move?
The first thing that breaks is usually term assignment, not the visible term list. A site can show the right category names and still attach posts to the wrong term_id, which leaves archive pages thin or empty.
Another common break is slug collision. If the source site has tech and the target already has tech with different data behind it, the importer may either create a second copy or attach posts to the wrong term. The safe fix is to compare slugs before import and decide which site owns the final version of each term.
A third problem is orphaned custom taxonomies. If the taxonomy plugin or theme code is not present on the target site, the terms may import but stay unusable. WordPress needs the taxonomy registration in place before the term relationships can behave normally.
The practical check is simple: open 3 to 5 archive pages after the move and compare the post count and term name against the source site. If the counts are off, do not start editing posts one by one. Fix the term mapping at the database or import layer, or the same mistake will keep reappearing every time new content lands.
This page is part of the larger process of moving an auto blog from one WordPress site to another. The rest of the move can handle posts, images, and link cleanup, but taxonomy integrity needs its own pass because it fails in a different way.
When is a clean migration not enough?
A clean taxonomy migration is not enough when the source site already has overlapping terms with different meanings. If two feeds both created “Updates” but one means product news and the other means industry news, one merged term can flatten the archive structure in a way that looks clean but reads wrong.
That trade-off matters on auto blogs with high term reuse. A single, tidy taxonomy tree is not always the right outcome if the source site used separate labels for a reason. In that case, keep both terms and map posts carefully instead of forcing a merge. The cost of a forced merge is a search archive that no longer matches the content pattern readers expect.
A clean move also stops helping if the destination site uses a different taxonomy model. If the source relied on 2 hierarchical category levels and the target site only needs a flat tag set, then copying the structure exactly can preserve clutter instead of clarity. The right move is to preserve meaning, not to preserve every old label just because it exists.
What is the safest cleanup check?
The safest cleanup check is to compare the source and target term slugs, then spot-check the archive pages for each major taxonomy. That gives you a fast answer without rebuilding the whole database.
Use this short check:
- confirm the taxonomy exists on the target site;
- confirm the slug list matches the source;
- confirm parent terms are in place for hierarchical categories;
- confirm posts show under the expected archive pages;
- confirm no duplicate labels were created during import.
If any one of those steps fails, the fix is usually in the mapping layer, not in the post editor. Editing posts manually hides the real problem and turns a database issue into a slow content problem. A clean taxonomy migration is built on the matching rule you choose at the start, and slug-based matching is the safest default when the site is not sharing the same database history.
How do categories and tags move in WordPress?
They move as taxonomy terms and relationships, not as simple labels. Categories and tags must be present on the target site before posts are attached to them, or WordPress can create new copies that look right but do not share the same term ID. Slugs are the safest way to match them.
How do I prevent taxonomy duplicates during migration?
Prevent duplicates by importing the term list once and mapping incoming posts to existing slugs. The duplicate usually appears when the importer creates a new term every time it sees a label in post content. Checking term_slug before assignment stops that pattern.
Can custom taxonomies break after a move?
Yes, custom taxonomies can break if the target site does not register the same taxonomy name or plugin setup. The terms may still exist in the database, but WordPress will not show them correctly in the admin screen or on archive pages. The fix is to register the taxonomy first, then migrate the terms and relationships.
Drafted with AI; not yet reviewed by a person.