When importing products to your WooCommerce website, you may have encountered with an error with the error message “Importing post ID Conflicts with an Existing ID” or “Post is not a Product”. This error occurs when the post ID already exists in the WooCommerce website to which the products are being imported to.
During an import, if you are updating existing product data, then do not forget to check the Update existing products tick box. Otherwise, it will generate the error of an existing ID.
Also, if the ID used in the CSV is not a product ID in the site to which it is imported to, then it can generate a conflict. For every product, WordPress creates a unique ID. It’s not just the products that are given unique IDs. They are given to tags, comments, categories, pages, and user ID as well to identify that particular item. All these are stored in WordPress in the wp_posts table. So the imported post ID can generate conflicts with these existing IDs also.
One way to avoid this type of error is to ensure that the post ID does not already exist as an Order ID, Page ID, Attachment ID etc. Another way to solve this problem is, when importing new products do not map ID column you can map with SKU and Parent_SKU columns instead. WordPress will assign a Post ID for the products that don’t have one.
In case of order import, there may be instances of ID mismatch. We can resolve this by reserving the IDs.
Reserving IDs for importing orders
When you create a new order, a new row will be created in the wp_posts table with a unique ID. However, if that ID conflicts with an existing post ID(due to content change), the next available ID will be assigned. This can sometimes result into ID mismatch.
As a solution to this, you can reserve the IDs for future orders. For reserving IDs, modify the next order’s row ID to a bigger number, if you don’t have much extra rows after your last order.
Example: The last order ID is 5000, and the new order created will have ID 5001. Here, if we modify the order’s row ID to 8001, then the new order ID will start from 8002, reserving 3000 IDs for future orders.