I am wondering when I am importing posts from my old site into my new website, which has already some posts in it. Do the imported posts get a new ID or do they overrule the existing posts ID’s?
2 Answers
I can confirm that the imported post will get a new unique ID if (and only if) there already is an existing/conflicting ID in the target database.
Given a post to be imported with an ID of 7579
(represented in the WXR export file as <wp:post_id>7579</wp:post_id>
) and an existing post with that exact same ID already in the target database, the generated ID for the imported post was 7583
.
(As far why 7583
? I would have thought auto increment but 7579
was an existing post, 7580
a revision of that post and 7581
a draft of some sort. So not exactly sure why 7582
was skipped.)