WooCommerce Database Schema Blog featured image

WooCommerce Database Schema: Tables, Products & Orders Explained

The WooCommerce database schema defines how your store’s data—products, orders, customers, and settings—is stored across WordPress database tables like wp_posts, wp_postmeta, and WooCommerce custom tables.

In this guide, you’ll learn:

  • Complete WooCommerce database tables list
  • Where products and orders are stored
  • WooCommerce database structure (with explanation)
  • WooCommerce High-Performance Order Storage (HPOS) tables
  • Real SQL examples to query your data

Whether you’re a developer or store owner, this guide will help you understand and manage your WooCommerce database efficiently.

What Is a Database?

A database is an organized system that stores and manages data using tables made of rows and columns. It allows you to store, retrieve, update, and manage information efficiently.

In WordPress and WooCommerce, databases use MySQL, and most operations are performed using SQL (Structured Query Language).

WooCommerce Database Schema

WooCommerce does not rely on a single table. Instead, it uses a combination of WordPress core tables and custom tables.

Core Idea:

  • Products & orders → stored as posts
  • Extra data → stored as metadata
  • Relationships → handled through taxonomy tables

WooCommerce Database Schema Diagram (Conceptual)

Here’s how the structure works conceptually:

  • wp_posts → stores products & orders
  • wp_postmeta → stores product/order details
  • wp_terms → categories, tags, attributes
  • woocommerce_order_items → order line items
  • woocommerce_order_itemmeta → item details

Think of it like this:

  • Posts = main objects
  • Meta = additional data
  • Taxonomies = classification

WooCommerce Database Tables List

Plugins like WooCommerce add a slew of new tables to the database designed to provide useful functionality to website administrators. Let’s look at how these custom tables work and their functionalities.

Function NameFunctionality
actionscheduler_actionsTo complete a list of functions ‘Action Scheduler’ function is used.
actionscheduler_claims
actionscheduler_groups
actionscheduler_logsActions completed by ‘Action Scheduler’ are stored at ‘Action Scheduler Logs.’
woocommerce_sessionsContains the consumer’s cart.
woocommerce_api_keysAPI keys storage.
woocommerce_attribute_taxonomiesCategories, tags, etc.
woocommerce_downloadable_product_permissionsDownloads access permissions.
woocommerce_order_itemsLine items linked to orders.
woocommerce_order_itemmetaLine items meta-data.
woocommerce_tax_ratesManual setup of tax rate list.
woocommerce_tax_rate_locationsLocation-based tax rates data.
woocommerce_shipping_zonesList of custom shipping zones.
woocommerce_shipping_zone_locationsShipping zones location.
woocommerce_shipping_zone_methodsShipping methods for each zone.
woocommerce_payment_tokensPayment tokens for WooCommerce.
woocommerce_payment_tokenmetaMetadata of WooCommerce payment token.
woocommerce_logEvent log.
wc_webhooksWebhooks
wc_download_logDownload log
wc_product_meta_lookupMetadata of product’s lookup table. This function makes it quicker to search for products inside orders.
wc_tax_rate_classesTax classes
wc_reserved_stockReserved stock to ensure availability at checkout.

These tables extend WordPress functionality for eCommerce operations.
CTX-Feed-banner

WooCommerce Product Table in Database

WooCommerce products are stored in:

  • wp_posts → main product data (post_type = product)
  • wp_postmeta → price, stock, SKU, etc.
  • wp_terms → categories & attributes
  • wp_term_relationships → product-category mapping

This structure allows WooCommerce to stay flexible and extensible.

WooCommerce High-Performance Order Storage (HPOS)

WooCommerce introduced High-Performance Order Storage (HPOS) to improve performance.

New HPOS Tables:

  • wc_orders
  • wc_order_addresses
  • wc_order_operational_data
  • wc_order_meta

Why HPOS Matters:

  • Faster order queries
  • Reduced load on wp_posts
  • Better scalability for large stores

If you’re running a modern WooCommerce store, HPOS is highly recommended.

How WooCommerce Data Gets Stored in the WordPress Database

WooCommerce stores its data in a combination of WordPress database tables and custom tables. However, WooCommerce lacks a specific table for storing customer data. You can keep customers’ data in many database tables, making retrieving this data difficult.

Furthermore, depending on whether the consumer is a visitor or a registered user, there are two different ways to get customer data:

  • WordPress user data – this information is only available to registered WordPress users. 
  • Order-based customer data – this is the customer data that is saved for each order and is accessible to both visitors and registered users.
WooCommerce Database Schema

WordPress User Data

If you disable the “Guest checkout” option in WooCommerce, a WordPress user will be formed for each consumer. WooCommerce will store the customer data in the WordPress user tables in this scenario.

  • wp_users – Contains general user information such as email address and date registered.
  • wp_usermeta – Preferred billing/shipping data. WooCommerce records the order billing/shipping information as user meta. This information will be available for future orders and a faster checkout process.

The following image indicates how every customer data connects to the database:

Registered Users Data - WooCommerce Database Schema

Order Based on WooCommerce Customer Data

WooCommerce maintains the client data as part of each order by default. A customer’s information is always linked to the order, regardless of whether they are registered users or visitors.

This implies that if a consumer places many orders without updating their personal information, each order will include a duplicate of their customer information. While this may result in duplicated data, it also enables various personal details (such as billing address or contact number) to be provided for each order independently.

You can store customers’ data using the following graphical illustration:

Order Based Customer Data

WooCommerce Structured Data vs Database Schema

Many users confuse these two concepts:

TypePurpose
Database SchemaStores data internally
Structured Data (Schema.org)Helps search engines understand your content

Example:

  • Database → stores product price
  • Structured data → tells Google the price

Both are essential but serve completely different purposes. While the database schema stores product data internally, search engines rely on structured data to understand your products. To improve visibility in search results, follow our guide on WooCommerce product schema.

Example WooCommerce SQL Queries

Here are some practical SQL queries:

Get All Products

SELECT * FROM wp_posts WHERE post_type = ‘product’;

Get Orders

SELECT * FROM wp_posts WHERE post_type = ‘shop_order’;

Get Product Meta

SELECT * FROM wp_postmeta WHERE post_id = 123;

These queries help developers extract and analyze WooCommerce data.

Where Are WooCommerce Products Data Stored?

Quick summary:

  • Main data → wp_posts
  • Additional data → wp_postmeta
  • Categories → wp_terms
  • Attributes → custom taxonomies

There is no single “product table”—it’s a relational structure.

When to Use the WordPress Database

To effectively use the WordPress database in WooCommerce, you need to understand when and how to query it for accurate, actionable data.

For example, when analyzing orders, you can run database queries filtered by specific date ranges. This helps you track sales performance over time or quickly locate individual orders when needed. The same approach applies to other product data, such as filtering by attributes like weight, price, or category.

The WordPress database also becomes essential when you need to export WooCommerce data. Exporting allows you to work with your store’s information in external tools like spreadsheets, making it easier to handle tasks such as tax reporting, financial analysis, or customer insights.

To fully leverage the WordPress database, learning basic SQL is highly recommended. Since SQL is relatively beginner-friendly, even a foundational understanding can significantly improve how you manage, analyze, and optimize your WooCommerce store data.

Freequently Ask Questions

Where is WooCommerce product data stored?

In the WordPress database, mainly in wp_posts and wp_postmeta.

Is WooCommerce database separate from WordPress?

No, WooCommerce uses the WordPress database and extends it with custom tables.

What is HPOS in WooCommerce?

HPOS (High-Performance Order Storage) is a new system that stores orders in dedicated tables for better performance.

Do I need database knowledge to run WooCommerce?

Not required, but basic understanding helps in troubleshooting and optimization.

Final Verdict

The WooCommerce database schema is the backbone of your online store. It determines how products, orders, and customer data are stored, accessed, and managed.

Understanding this structure helps you:

  • Customize your store
  • Improve performance
  • Debug issues efficiently
  • Scale your business

If you’re serious about WooCommerce development or optimization, learning how its database works is a must.

Leave a Reply

8,282,454+ Downloads. 718+ plus 5-star ratings. Promote products on any platform you want.