WooCommerce × Metabase

How to build WooCommerce dashboards in Metabase

WooCommerce is the open-source store built on WordPress, and it keeps every order, product, and customer in a MySQL/MariaDB database you control. Metabase connects to MySQL natively — so unlike most SaaS tools, you can often point it straight at your store database and start building dashboards, no ETL required. This guide covers two complementary paths: a lightweight MCP + CLI route that pulls live data with the WooCommerce MCP and loads a CSV into Metabase with the Metabase CLI for quick analysis, and a durable direct-database route that connects Metabase straight to your store's database.

Key difference from hosted platforms: because WooCommerce data lives in your own SQL database, the "sync step" that Shopify or BigCommerce need is often optional. Metabase connects to databases and warehouses — including MySQL — so you can connect a read replica and query it directly.

How do you connect WooCommerce to Metabase?

Most teams combine both routes: use the WooCommerce MCP and Metabase CLI route to pull live data and stand up a quick analysis, and the direct-database route for the dashboards people depend on.

1 · MCP + CLI route (AI-assisted)

Live data in, quick analysis out

Pair a WooCommerce MCP server (to read live store data) with the Metabase CLI, whose upload command loads a CSV into Metabase as a ready-to-query table and model.

Best for
  • Quick lookups like "top products this week?"
  • Loading a WooCommerce CSV export into Metabase in seconds
  • Spot-checks and one-off analyses without wiring up the database
Trade-offs
  • Great for exploration, not governed reporting
  • Use read-only mode on the WooCommerce MCP to avoid accidental writes
  • CSV uploads are snapshots — connect the database directly for live, ongoing analysis
2 · Direct database (fastest)

Point Metabase at your store DB

WooCommerce runs on WordPress and stores everything in a MySQL/MariaDB database. Metabase connects to MySQL natively, so you can often query orders and products directly — no ETL required.

Best for
  • Self-hosted stores where you control the database
  • Getting to a first dashboard in minutes
  • Live operational reporting on a read replica
Trade-offs
  • Query a read replica, never the live production writer
  • Legacy schema hides data in wp_postmeta key/value rows
  • Managed hosts may restrict direct database access

What can you analyze from WooCommerce data in Metabase?

  • Sales — net revenue, orders, and AOV over time
  • Repeat purchase — how many buyers come back, and how fast
  • Product performance — top sellers, units, and refund rate
  • Coupons & discounts — usage and depth against revenue
  • Order status funnel — pending → processing → completed
  • Customer cohorts — revenue by acquisition month and channel

Which WooCommerce dashboards should you build in Metabase?

For: Store owners

Store overview

The daily pulse of sales and demand.

  • Net revenue vs. prior period (number + trend)
  • Orders per day (line)
  • Average order value (number + trend)
  • New vs. returning customer revenue (bar)
For: Merchandising

Product performance

What's selling, what's stuck.

  • Top products by net revenue (bar)
  • Units sold by product (table)
  • Refund rate by product (bar)
  • Stock status vs. sell-through (table)
For: Growth / retention

Customers & repeat purchase

Are buyers coming back?

  • Repeat-purchase rate by cohort (line)
  • Orders per customer distribution (bar)
  • Time between first and second order (histogram)
  • Revenue by acquisition month (cohort table)
For: Ops & finance

Discounts & refunds

Where revenue leaks.

  • Coupon usage and discount depth (line)
  • Refunds by week (line)
  • Payment method mix (bar)
  • Order status funnel (pending → completed) (bar)

How do you connect the WooCommerce database directly?

In Metabase, add your store's database under Admin → Databases → Add database → MySQL, using a read-only user against a replica. Then the whole schema is queryable. A few things to know about how WooCommerce stores data:

  • Table prefix — tables are usually prefixed wp_, but the prefix is configurable. Confirm yours before writing SQL.
  • Legacy vs. HPOS — older stores keep orders in wp_posts (post_type = 'shop_order') with fields spread across wp_postmeta. Modern stores use High-Performance Order Storage with dedicated tables like wp_wc_orders.
  • Analytics lookup tables — WooCommerce maintains reporting tables (wp_wc_order_stats, wp_wc_order_product_lookup, wp_wc_customer_lookup) that are far friendlier than raw postmeta. Prefer them.
Never query the production writer. Point Metabase at a read replica (or a nightly warehouse copy) so heavy analytical queries can't slow down the storefront.

How do you use the WooCommerce MCP server with the Metabase CLI?

Pair a WooCommerce MCP server with the Metabase CLI for fast, hands-on analysis. WooCommerce ships native MCP support in developer preview (enabled via the mcp_integration feature flag and the WordPress MCP Adapter); a managed connector such as Pipedream is the quicker route today. It reads live store data; the Metabase CLI's upload command loads a CSV into Metabase and creates a ready-to-query table and model. For analysis, use the WooCommerce MCP in read-only mode.

Example workflow

  • Ask the WooCommerce MCP which products or orders drove the most revenue this week.
  • Export the orders, products, or coupon usage you want to keep as a CSV.
  • Run mb upload csv to load it into Metabase as a table and model, then build questions and dashboards on top.

Be honest about the limits

  • The WooCommerce MCP is great for live lookups — not for scheduled or audited reporting.
  • A CSV upload is a point-in-time snapshot; refresh it with mb upload replace or connect the database directly for real history.
  • Use the WooCommerce MCP in read-only mode so analysis can't trigger writes; the native WooCommerce MCP is a developer preview, so verify availability.
  • mb upload csv needs an uploads database configured under Admin → Settings → Uploads.

How do you set up the WooCommerce MCP server and the Metabase CLI?

WooCommerce MCPdeveloper preview

Enable
mcp_integration feature flag + WordPress MCP Adapter
Transport
Streamable HTTP
Auth
WordPress application password / OAuth
Note
Native support is in developer preview — verify status.

WooCommerce via Pipedream managed

Endpoint
https://mcp.pipedream.net/v2
Transport
Streamable HTTP
Auth
Connect WooCommerce inside Pipedream, then use the URL
Scope
REST API actions — orders, products, customers

Metabase CLIofficial

Install
npm install -g @metabase/cli
Auth
mb auth login (browser OAuth on v62+, or an API key)
Load data
mb upload csv --file data.csv
Requires
An uploads database (Admin → Settings → Uploads)
Cursor~/.cursor/mcp.json or .cursor/mcp.json
{
  "mcpServers": {
    "woocommerce": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://mcp.pipedream.net/v2"
      ]
    }
  }
}
TerminalLoad a WooCommerce CSV with the Metabase CLI
# Install the Metabase CLI
npm install -g @metabase/cli

# Log in (opens your browser; requires Metabase v62+)
mb auth login --url https://your-metabase.example.com

# Load a WooCommerce CSV export — creates a table AND a model
mb upload csv --file woocommerce-orders.csv --collection root

# Refresh that same table later from a new export
mb upload replace <table-id> --file woocommerce-orders.csv

Connect your WooCommerce store inside Pipedream first, then use the static MCP URL. For the native route, follow the WooCommerce MCP developer docs. The Metabase CLI stores its credentials securely after mb auth login, and mb upload csv needs an uploads database enabled first.

Verify before shipping: confirm an uploads database is enabled under Admin → Settings → Uploads (Metabase docs) and the current WooCommerce MCP setup in the WooCommerce developer docs.

Can you generate a WooCommerce dashboard with AI?

Yes. Use the prompt below with any assistant that can run a WooCommerce MCP server and the Metabase CLI. It works end to end: if WooCommerce data already lives in Metabase — the connected store database or tables uploaded earlier — it analyzes that; otherwise it pulls the data over the WooCommerce MCP, loads it with mb upload csv, then builds the dashboard — detecting legacy vs. HPOS storage, preferring the analytics lookup tables, and skipping cards the data can't support.

Prompt for creating a WooCommerce Store Overview dashboard
Create a polished Metabase dashboard for WooCommerce ecommerce analytics.
Work end to end: get the data into Metabase if it isn't there yet, then build.

Goal: Help store operators understand sales, average order value, repeat purchase,
product performance, and discounts/refunds from WooCommerce data.

Step 1 — Find or load the data:
- First, check what already exists in Metabase (the connected WooCommerce store
  database, or WooCommerce tables and models uploaded earlier). If durable
  WooCommerce data is already present, use it and skip to Step 2.
- If nothing is there, pull it with a WooCommerce MCP server in read-only mode:
  recent orders, products, customers, and coupon usage. Write each result to a
  CSV, then load it with the Metabase CLI — run "mb upload csv --file <export>.csv"
  so each upload creates a table and a ready-to-query model. Use "mb upload replace
  <table-id> --file <export>.csv" to refresh an existing table instead of creating
  duplicates.

Step 2 — Inspect before querying:
WooCommerce CSV exports are usually flat and pre-aggregated (one row per order or
product). The WooCommerce database is raw: identify how orders are stored — the
legacy schema (orders in wp_posts with post_type 'shop_order' and fields in
wp_postmeta) or High-Performance Order Storage (HPOS) with dedicated tables such as
wp_wc_orders and wp_wc_order_stats. Prefer the WooCommerce Analytics lookup tables
when present: wp_wc_order_stats, wp_wc_order_product_lookup, and
wp_wc_customer_lookup. Inspect the actual tables and column names first; do not
assume exact names or the table prefix.

Important:
- Build on whatever data is present; don't claim Metabase connects natively to
  WooCommerce — it reads the underlying SQL database or CLI-uploaded tables.
- Build durable dashboards from database tables (a read replica if live).
- Report NET revenue: subtract refunds and discounts; state the definition.
- Count only paid/processing/completed orders, not pending, failed, or trash.
- Use order-level grain for AOV.
- Define a "repeat customer" once (2+ paid orders) and reuse it everywhere.
- Only build a card if its underlying column/metric exists in the data.
- A single CSV is a point-in-time snapshot: connect the database directly or upload
  multiple periods before building trend cards.

Dashboard title: WooCommerce Store Overview

Sections:
1. Executive summary (KPI cards): Net revenue last 30 days; Orders; AOV; Repeat-
   purchase rate; Refund rate.
2. Sales & demand: Net revenue by day; Orders by day; AOV trend; New vs returning
   revenue.
3. Product performance: Top products by net revenue; Units by product; Refund rate
   by product.
4. Customers & retention: Repeat-purchase rate by cohort; Orders per customer;
   Revenue by acquisition month.
5. Discounts & operations: Coupon/discount depth; Refunds by week; Order status
   funnel.

Filters: Date range, Product category, Coupon, Payment method, Customer type.

Reuse the models Metabase auto-created from uploaded CSVs, or (for the database)
create reusable models: modeled_woo_orders, modeled_woo_order_items,
modeled_woo_products, and modeled_woo_customers.

Output: Build the dashboard if you have permission; otherwise provide the exact
questions, SQL, model definitions, and layout. Include caveats for any metric
that cannot be calculated from the available data. Keep it practical, dense,
and executive-readable. Avoid vanity metrics.

How should you model WooCommerce data in Metabase?

Core tables (HPOS + Analytics lookups)

TableGrainKey columns
wp_wc_ordersone row per order (HPOS)id, status, total_amount, customer_id, date_created_gmt
wp_wc_order_statsone row per order (reporting)order_id, net_total, status, date_created, customer_id
wp_wc_order_product_lookupone row per lineorder_id, product_id, product_qty, product_net_revenue
wp_wc_customer_lookupone row per customercustomer_id, email, date_registered
wp_postsproducts (post_type='product')ID, post_title, post_status

Modeling advice

  • Prefer the wp_wc_* analytics tables — they pre-compute net revenue and avoid pivoting wp_postmeta.
  • Normalize order status (wc-processing, wc-completed) and decide which count as "paid."
  • Compute AOV at the order grain; define net revenue once.
  • Map the actual table prefix — it isn't always wp_.

Which WooCommerce metrics should you track in Metabase?

MetricDefinitionNotes
Net revenueGross − discounts − refunds.wp_wc_order_stats.net_total already nets much of this.
Average order value (AOV)Net revenue ÷ orders.Order grain; segment by category.
Repeat-purchase rateCustomers with 2+ paid orders ÷ all.Fixed window; watch by cohort.
Refund rateRefunds ÷ gross.Break out by product to find problem SKUs.
Coupon depthCoupon discounts ÷ gross sales.Tie to promotions to judge ROI.

What SQL powers WooCommerce dashboards in Metabase?

These assume a MySQL WooCommerce database. Adjust the table prefix and, on legacy stores, read from wp_posts/wp_postmeta instead.

Net revenue and orders per day (HPOS)PostgreSQL

Directly from the High-Performance Order Storage orders table.

-- High-Performance Order Storage (HPOS) schema
SELECT
  date_trunc('day', o.date_created_gmt)               AS day,
  COUNT(*)                                            AS orders,
  SUM(o.total_amount)                                 AS gross,
  SUM(COALESCE(o.discount_total_amount, 0))           AS discounts
FROM wp_wc_orders o
WHERE o.type = 'shop_order'
  AND o.status IN ('wc-processing', 'wc-completed')
  AND o.date_created_gmt >= CURRENT_DATE - INTERVAL '30 days'
GROUP BY 1
ORDER BY 1;
Average order value by week (Analytics tables)PostgreSQL

Using the WooCommerce reporting lookup tables — the friendliest source.

-- WooCommerce Analytics lookup tables (recommended)
SELECT
  date_trunc('week', s.date_created) AS week,
  COUNT(DISTINCT s.order_id)         AS orders,
  ROUND(
    SUM(s.net_total) / NULLIF(COUNT(DISTINCT s.order_id), 0),
  2)                                 AS aov
FROM wp_wc_order_stats s
WHERE s.status IN ('wc-processing', 'wc-completed')
GROUP BY 1
ORDER BY 1;
Top products by revenuePostgreSQL

Units and net revenue by product over 90 days.

SELECT
  p.post_title                       AS product,
  SUM(pl.product_qty)                AS units,
  SUM(pl.product_net_revenue)        AS net_revenue
FROM wp_wc_order_product_lookup pl
JOIN wp_wc_order_stats s ON s.order_id = pl.order_id
JOIN wp_posts p          ON p.ID = pl.product_id
WHERE s.status IN ('wc-processing', 'wc-completed')
  AND s.date_created >= CURRENT_DATE - INTERVAL '90 days'
GROUP BY p.post_title
ORDER BY net_revenue DESC
LIMIT 20;
Repeat-purchase ratePostgreSQL

Share of customers with two or more paid orders.

WITH customer_orders AS (
  SELECT
    customer_id,
    COUNT(DISTINCT order_id) AS paid_orders
  FROM wp_wc_order_stats
  WHERE status IN ('wc-processing', 'wc-completed')
    AND customer_id IS NOT NULL
  GROUP BY customer_id
)
SELECT
  ROUND(
    100.0 * COUNT(*) FILTER (WHERE paid_orders >= 2) / NULLIF(COUNT(*), 0),
  2) AS repeat_purchase_rate_pct
FROM customer_orders;

What are common mistakes when analyzing WooCommerce in Metabase?

Querying the live production database.→ Analytical queries can slow the storefront. Use a read replica or a warehouse copy.
Pivoting wp_postmeta by hand when lookup tables exist.→ The wp_wc_order_stats and lookup tables pre-compute what you need — use them.
Assuming the wp_ table prefix.→ The prefix is configurable; confirm it before writing SQL.
Counting pending, failed, or trashed orders as sales.→ Filter to processing/completed (your definition of paid).
Reporting gross revenue as net.→ Subtract discounts and refunds and state the definition on the dashboard.

Related analytics

Related integrations

FAQ

Can Metabase connect directly to WooCommerce?
Yes — WooCommerce data lives in a MySQL/MariaDB database, and Metabase connects to MySQL natively. Point it at a read replica (not the production writer) and you can query orders, products, and customers without any ETL.
What's the difference between legacy storage and HPOS?
Legacy WooCommerce stored orders in wp_posts with fields scattered across wp_postmeta. High-Performance Order Storage (HPOS) moves orders into dedicated tables like wp_wc_orders, which are much easier to query. Modern stores use HPOS; check which your store runs.
Is there an official WooCommerce MCP server?
WooCommerce has native MCP support in developer preview, enabled through the mcp_integration feature flag and the WordPress MCP Adapter. A managed connector such as Pipedream is the quicker route today.