A WooCommerce developer knows where the store keeps its data, and which table to check first.
The bug
A client writes: “The In stock filter shows products that are out of stock.”
You open the product: stock 0, status “Out of stock”. Everything is correct. But the filter doesn’t read the product. It reads wc_product_meta_lookup, and nobody updated that table, because the nightly import wrote stock straight into wp_postmeta.
As long as WooCommerce is “posts with meta fields” to you, a bug like this takes hours to find.
Where the store keeps its data
| What | Where |
|---|---|
| Products | posts product / product_variation + wc_product_meta_lookup for filters and sorting |
| Guest cart | woocommerce_sessions; the cookie holds only the session key |
| Orders | HPOS tables wc_orders, wc_order_addresses, wc_order_operational_data, wc_orders_meta |
| Line items | woocommerce_order_items, woocommerce_order_itemmeta |
| Background jobs | Action Scheduler: actionscheduler_actions, actionscheduler_logs |
List the WooCommerce tables in your database:
SHOW TABLES LIKE '%wc\_%';
SHOW TABLES LIKE '%woocommerce\_%';
SHOW TABLES LIKE '%actionscheduler\_%';
The interview question
Where does WooCommerce store orders?
Weak answer. In
wp_postswith typeshop_order, and the data inwp_postmeta.
Strong answer. It depends on the setting. New sites since 8.2 use the HPOS tables (
wc_ordersand related). Older ones may usewp_postsor sync mode. That’s why my code never touches the tables directly, onlywc_get_order()and CRUD.
👉 The full chapter is in the course WooCommerce Development for Middle Devs: Module 1. WooCommerce as a System
🔔 More WooCommerce videos: youtube.com/@4wpdev