The WordPress WooCommerce admin dashboard shows revenue of $87,400 for the quarter. The accounting export shows $84,920. The bookkeeper wants to know which is right and so does the operator. Both numbers are right — they just count differently. WooCommerce reporting has several quirks that show up when the numbers are reconciled: timezone, refund treatment, status inclusion, and the wc_order_stats cache that can lag behind the order data itself.
What’s happening
WooCommerce ships two reporting surfaces:
- Legacy reports.
WooCommerce → Reports. Querieswp_posts+wp_postmetalive. Slow on large stores; aggregated from raw data. - Analytics (the modern UI).
WooCommerce → Analytics. Querieswp_wc_order_stats,wp_wc_order_product_lookup, and the other analytics-prefixed tables. Fast, but the tables are a derived cache that is rebuilt on order events.
The two surfaces can disagree on the same store because:
- Status inclusion. Legacy reports include
completedandprocessingby default. Analytics is configurable; some installs includeon-holdandcancelledand some don’t. - Refund treatment. A $100 order refunded for $40. Legacy reports show $60 in revenue. Analytics shows $100 in gross and $40 in refunds. The “net” is $60 in both, but the gross differs.
- Timezone. Reports respect the WordPress site timezone (Settings → General). The accounting export from an accountant may use UTC. A midnight-Quebec order shows on different days in the two views.
wc_order_statslag. If Action Scheduler is behind, recent orders may not be in the lookup table yet. Analytics is missing them.- Tax inclusion. Whether the displayed revenue is tax-inclusive or tax-exclusive depends on the “Display prices” setting and a separate Analytics toggle.
How to verify
# Compare legacy vs analytics totals for the same window
wp wc shop_order list --status=completed --date_after=2026-01-01 --date_before=2026-04-01 --format=count
wp wc shop_order list --status=processing --date_after=2026-01-01 --date_before=2026-04-01 --format=count
# Raw total from postmeta — the canonical truth
wp db query "SELECT
SUM(CAST(pm.meta_value AS DECIMAL(10,2))) AS gross
FROM wp_posts p
JOIN wp_postmeta pm ON p.ID=pm.post_id
WHERE p.post_type='shop_order'
AND p.post_status IN ('wc-completed','wc-processing','wc-on-hold')
AND pm.meta_key='_order_total'
AND p.post_date >= '2026-01-01' AND p.post_date < '2026-04-01'"
# Same window from wc_order_stats (the analytics cache)
wp db query "SELECT
SUM(net_total) AS net,
SUM(total_sales) AS gross,
COUNT(*) AS orders
FROM wp_wc_order_stats
WHERE date_created >= '2026-01-01' AND date_created < '2026-04-01'
AND status IN ('wc-completed','wc-processing','wc-on-hold')"
# Are there orders missing from wc_order_stats?
wp db query "SELECT COUNT(*) FROM wp_posts p
LEFT JOIN wp_wc_order_stats s ON p.ID=s.order_id
WHERE p.post_type='shop_order'
AND p.post_status IN ('wc-completed','wc-processing')
AND p.post_date > NOW() - INTERVAL 90 DAY
AND s.order_id IS NULL"
# Are there orders in wc_order_stats but not in wp_posts?
wp db query "SELECT COUNT(*) FROM wp_wc_order_stats s
LEFT JOIN wp_posts p ON s.order_id=p.ID
WHERE p.ID IS NULL"
# Refund treatment — sum of refunds in the window
wp db query "SELECT SUM(CAST(pm.meta_value AS DECIMAL(10,2))) AS refunds
FROM wp_posts p
JOIN wp_postmeta pm ON p.ID=pm.post_id
WHERE p.post_type='shop_order_refund'
AND pm.meta_key='_refund_amount'
AND p.post_date >= '2026-01-01' AND p.post_date < '2026-04-01'"
# Timezone WordPress is set to
wp option get timezone_string
wp option get gmt_offset
The single most useful query is the orders-missing-from-stats check. If you see more than 5 orders missing, your Analytics cache is lagging and reports will undercount.
The fix
- Pick one canonical source of truth for revenue. Most operators pick the raw postmeta sum for accounting reconciliation. It is slower but always correct. The Analytics surface is for trends and the live dashboard, not for the quarterly close.
- Regenerate the order-stats lookup table after migration. If the lookup is stale or partially populated:
wp wc tool run regenerate_order_stats_table # or via admin: WooCommerce → Status → Tools → Regenerate the order stats lookup table - Document the report parameters in the export. When sending a quarterly export to the accountant, label it: “Status: completed + processing, Currency: CAD, Timezone: America/Toronto, Tax: exclusive, Refunds: not deducted.” Without the label, every quarter the accountant asks the same question.
- Watch the status transitions. Orders that flip between
on-holdandcompletedover the quarter boundary land in different reports depending on which date the report uses (created vs paid vs completed). Decide which date is canonical (we recommendpaid_date) and use it consistently. - Audit the Action Scheduler queue for
wc-admin_import_orders. If pending actions exist, recent orders are not yet in the lookup table. Drain them:wp action-scheduler list --status=pending --hook=wc-admin_import_orders --per_page=20 wp action-scheduler run --batch-size=25 --batches=10 - Reconcile against the payment gateway. Stripe / PayPal / Square dashboards are the authoritative payment record. Compare WooCommerce revenue to gateway-side gross less refunds. They should match within rounding. If they diverge, you have an unattributed refund or a fraud chargeback that WooCommerce did not know about.
For the data-integrity layer, pair with the WooCommerce HPOS migration article and the inventory-sync article in this set. Pair with Enterprise WordPress operations for the quarterly-close runbook.
Stack Harbor audits WordPress WooCommerce reporting under Enterprise WordPress — the canonical-source decision, the lookup-table hygiene, and the gateway reconciliation. If your dashboard and your accountant’s numbers do not agree, we can find the gap.