Support » Fixing WordPress » Importing two other WP sites into a third, merging categories

  • I have a client who want to move two WP sites into a third. Would it be a good idea to have the categories aligned on all three sites before the imports? I’m wondering if the category names would merge automatically or are they going to be separate due to the category id numbers? I can’t seem to find any info in the codex about this.

    Would we need to run a category merging utility if there is one?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Assuming you are using the WP Export Import tools:

    When you import content, and an id already exists, a new id will be created. When you import posts with categories, the categories will get new id’s in the same way. Id’s must be unique. If the ‘slug’ of the Category already exists, that category slug on import will be appended with -2 (then sequentially for many).

    You can see this yourself on any site. Just create a category with a name and then repeat with same name and you will see the second has a unique id but will have slug name-2.

    Once imported, you can find the -2 category slugs and merge them to the first one.

    Same with other items like pages and posts, etc. Slugs must be unique.

    Any custom functions or templates that rely on specific id’s or slugs may need to be updated. Example: a custom page template that uses the id that was changed on import.

    Correct. I would be using the WP Export Import tools.

    So even if my client used the same category names on all three sites for posts, they would import and become three separate categories in the site where they would all reside when imported. So for example, if all three sites had a category of “lifestyle”, then I import the content into one site, there would be a “lifestyle”, “lifestyle-1” and “lifestyle-2” categories, correct?

    I would assume then that I’d need to run something to merge them together, correct?

    you can set default cat to lifestyle in writing (?). then delete cat LS 1, LS2 and all posts will be moved to LS. Any duplicate posts would end up LS/post-1, LS/post-2…

    That is what should happen, yes.

    I would run a test on a test site first and see how it goes, if all is well, fix the minor issues with the cats, then roll that out as the merged site.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Importing two other WP sites into a third, merging categories’ is closed to new replies.