Where Does WooCommerce Keep Its Data? A Developer Check on 4wp.dev

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

WhatWhere
Productsposts product / product_variation + wc_product_meta_lookup for filters and sorting
Guest cartwoocommerce_sessions; the cookie holds only the session key
OrdersHPOS tables wc_orders, wc_order_addresses, wc_order_operational_data, wc_orders_meta
Line itemswoocommerce_order_items, woocommerce_order_itemmeta
Background jobsAction Scheduler: actionscheduler_actions, actionscheduler_logs

List the WooCommerce tables in your database:

TEXT
SHOW TABLES LIKE '%wc\_%';
SHOW TABLES LIKE '%woocommerce\_%';
SHOW TABLES LIKE '%actionscheduler\_%';

The interview question

Where does WooCommerce store orders?

Weak answer. In wp_posts with type shop_order, and the data in wp_postmeta.

Strong answer. It depends on the setting. New sites since 8.2 use the HPOS tables (wc_orders and related). Older ones may use wp_posts or sync mode. That’s why my code never touches the tables directly, only wc_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