Changing Product IDs in WooCommerce: Feeds and Migration Considerations

In a recent Business Bloomer Club discussion, a member faced a challenge with product IDs after migrating a WooCommerce store. During the import/export process, product IDs changed, impacting shopping feeds that relied on the original IDs for platforms like Google Shopping and Amazon.

While fixing the issue by changing product IDs in the live database might seem straightforward, it’s a complex and high-risk process, as WooCommerce and various plugins reference product IDs extensively across the database.

Here’s a breakdown of why this issue occurred, the possible solutions, and best practices for future migrations.

Problem Overview

During the migration, the marketing team configured XML shopping feeds based on product IDs rather than using a stable product identifier like SKU. This dependency on product IDs caused issues when IDs changed in the new store environment, as the feeds couldn’t correctly link to products.

Changing product IDs retrospectively across the database isn’t advisable, as it risks breaking relationships between orders, inventory, and other WooCommerce functionalities.

Solution Options

1. Reindex Feeds Using SKUs

One recommended solution is to update the feed rules to use SKUs, a more stable identifier that doesn’t change between imports and exports. SKUs are a reliable choice for product identification, particularly for platforms like Channable, Google Shopping, and Amazon. This approach avoids issues tied to database-specific product IDs and is the preferred long-term solution.

2. Manual Product ID Change (Not Recommended)

While possible, manually changing product IDs across the WooCommerce database is risky and complex. WooCommerce uses product IDs in numerous tables and by various plugins, so even minor errors in ID changes can cause functionality loss or data inconsistency. Unless you’re working on a brand-new site with no orders or visitor data, this approach isn’t advised.

3. Create a Backup and Reimport Products with Correct IDs (If No Orders Exist)

If the site has minimal or no new orders since the migration, another option is to delete the current products and reimport them with original IDs. This would involve emptying the database, ensuring products are exported with correct settings, and importing them to maintain IDs. This is feasible only if you can afford the downtime and lack of order history.

Final Thoughts and Best Practices

Using SKUs over product IDs for feed integration is the most stable and scalable approach. This scenario underscores the importance of communication with all teams involved in migrations to ensure critical data like feeds and external integrations are considered from the outset. For future projects, setting clear standards around product identification (favoring SKUs) can help avoid similar challenges.

Related content

Rodolfo Melogli

Business Bloomer Founder

Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli

Reply

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