
This is a guest post by Misha Rudrastyh of rudrastyh.com. If you like the content, make sure to thank him in the comments!
In this post, we will discuss different ways of syncing product stock levels between multiple WooCommerce stores, more specifically, we will take a look at the following topics:
- What is a multisite installation of WooCommerce stores, and what is the difference between syncing products across stores within a single multisite network and standalone stores?
- Is there any difference between when we do the sync after updating a product via the WooCommerce admin dashboard and when an order is created by a customer?
- Some caveats when working with orders which can contain lots of products.
- What do we need to do to run the bulk stock synchronization for all products on a WooCommerce store?
If you’re interested in syncing more product data, not just the stock information, you can take a look at this article.
This tutorial is mostly about using Inventory Sync for WooCommerce plugin, however, if you’re a developer, you will also find some hook and performance recommendations here.
Multisite vs Non-Multisite
If right now you’re just at the moment of starting your WooCommerce project, I would like you to consider using WordPress Multisite installation from the beginning. Let me show you key differences.
Option 1. WordPress Multisite (or WooCommerce Multisite)
Stores will be located on the same server and share the same database, which means that interaction between them (when synchronizing product stock levels) will be significantly faster.
If you’re ok, that your stores will be tied together within a single WordPress installation, then, of course, I would recommend considering this approach (but don’t worry, each store will have its administrator and a separate admin dashboard).
If you’re a WooCommerce developer, you probably already have an idea in mind how it may work under the hood – with the help of the switch_to_blog()
function and the WC_Product
object.
But if you’re not a developer, then you’re bound to use some WooCommerce plugin for this purpose.
For example, in Inventory Sync for WooCommerce plugin you will need to connect stores to maintain the stock level sync between them.

If you’re using the plugin on a multisite network, all you need to do is to select a target store from the dropdown list and then hit “Add new store” button:

Option 2. Standalone WooCommerce Stores
The interaction between standalone stores will be with the help of the WooCommerce REST API. Here is how the connection of standalone stores can be configured in the plugin:

Triggering the Stock Synchronization
Basically, there are two scenarios when the stock synchronization can be triggered:
- When a product is updated via the WooCommerce admin dashboard,
- When an order is created (or refunded) and the stock levels are changed.
Well, technically, there is also a third scenario – when you’re using a third-party plugin to edit products, maybe Advanced Bulk Edit plugin or another one. In that case, everything depends on the plugin: what hooks it has inside, and how it interacts with the WooCommerce database.
Right now, let’s take a look at WooCommerce hooks we can use for these purposes:
woocommerce_product_set_stock
– this is the simplest hook that we can use, it is triggered for each product individually when its stock levels are changed.woocommerce_variation_set_stock
– the same as the previous one, but only works for product variations.woocommerce_reduce_order_stock
– this one could be useful when we need to do something when the product stock levels are reduced when a new processing order is created.woocommerce_restore_order_stock
– when an order has been refunded.save_post
– we can also use this standard WordPress hook to synchronize the stock levels when we update a product via the admin dashboard.
But how can we connect the same products between stores? By SKU, of course.
Orders With Big Number of Products And How to Deal With Them
Let’s talk performance now.
When I was developing the inventory sync plugin, probably one of the first support requests was something like this “My store orders can have 50-100 products, can we increase the synchronization speed?”
The slow sync time is usually the result of excessive connections to the WooCommerce REST API. Once again – switching to the WordPress Multisite installation will fix this issue in a heartbeat.
If using a multisite network is not an option for you, there are some other solutions to this:
- Sending the API requests asynchronously. In WooCommerce we can easily do it with the help of Action Scheduler. For example, with the help of the
as_enqueue_async_action()
function. - Another solution is to decrease the number of API requests by combining them into a single one whenever possible. WooCommerce REST API allows us to do that with the
/wc/v3/products/batch
endpoint. - Using the “PHP Requests” library can also help to send multiple API requests much faster.
However, today the inventory sync plugin uses all of these methods.
Bulk Product Stock Synchronization
Let’s assume a situation when you need to push the product inventory information from “Store 1” to “Store 2” for all the products at the same time.
Of course, updating every product manually could be an exhausting task, even with the help of the bulk edit.
That’s why, the plugin also comes with the “Sync product inventory” tool which can be found in WooCommerce > Status > Tools.
