Understanding the order data archiving
Overview
The plugin automatically archives all essential WooCommerce order information required to fully reconstruct an order later.
This includes:
- Billing details
- Shipping details
- Order totals and taxes
- Payment information
- Order status and lifecycle timestamps
All information is stored as metadata.
When an order is archived:
- The data is copied exactly as it exists in WooCommerce
- The original meta_key and meta_value are preserved
- No information is modified
This ensures the archived order remains accurate and complete.
Where Order Metadata Is Stored #
WooCommerce stores order metadata differently depending on whether High-Performance Order Storage (HPOS) is enabled.
When HPOS Is Enabled #
Order metadata is stored in:
wc_orders_meta
This table contains:
- All default WooCommerce order metadata
- All custom metadata added by plugins or custom development
When HPOS Is Disabled (Legacy Storage) #
Order metadata is stored in:
wp_postmeta
This table contains:
- All WooCommerce order metadata (default and custom)
Automatic Table Detection #
You do not need to configure anything manually.
For each order, the plugin automatically:
- Detects whether HPOS is enabled
- Reads metadata from the correct table:
- wc_orders_meta (HPOS enabled), or
- wp_postmeta (HPOS disabled)
- Archives the data correctly
Default Metadata That Is Archived #
Below are the core WooCommerce metadata fields archived automatically.
Billing Address Fields #
These fields store the customer’s billing information:
- _billing_first_name → First name
- _billing_last_name → Last name
- _billing_company → Company name
- _billing_address_1 → Address line 1
- _billing_address_2 → Address line 2
- _billing_city → City
- _billing_state → State/Region
- _billing_postcode → Postal code
- _billing_country → Country
- _billing_email → Email address
- _billing_phone → Phone number
Shipping Address Fields #
These fields store the delivery details:
- _shipping_first_name → First name
- _shipping_last_name → Last name
- _shipping_company → Company name
- _shipping_address_1 → Address line 1
- _shipping_address_2 → Address line 2
- _shipping_city → City
- _shipping_state → State/Region
- _shipping_postcode → Postal code
- _shipping_country → Country
- _shipping_phone → Phone number
Core Financial & Order Status Fields #
These fields contain financial, transaction, and lifecycle information:
- _order_key → Unique identifier used for payment and order links
- _order_currency → Currency used
- _prices_include_tax → Whether product prices include tax
- _customer_user → Registered customer ID (0 for guest orders)
- _customer_ip_address → Customer IP address at checkout
- _customer_user_agent → Browser and device information
- _created_via → How the order was created (checkout, admin, API, etc.)
- _cart_discount → Cart discount amount
- _cart_discount_tax → Tax on cart discount
- _order_shipping → Shipping cost
- _order_shipping_tax → Shipping tax
- _order_tax → Total tax
- _order_total → Final order amount
- _payment_method → Payment gateway ID
- _payment_method_title → Display name of payment method
- _transaction_id → Payment gateway transaction reference
- _date_paid (or _paid_date) → Payment completion date
- _date_completed (or _completed_date) → Order completion date
Default Metadata Archiving Process #
For each order being archived:
- The plugin detects whether HPOS is enabled.
- It retrieves metadata from:
- wc_orders_meta (HPOS enabled), or
- wp_postmeta (HPOS disabled)
- All default metadata rows are copied to the archive database.
- The original meta_key and meta_value are preserved exactly.
This guarantees that archived orders remain structurally identical to the original data.
Custom Metadata Archiving #
What Is Custom Metadata? #
Custom metadata refers to any additional order data added by:
- Third-party plugins
- Custom development
- Extended checkout fields
- Payment gateway extensions
These fields are not part of WooCommerce’s predefined core metadata.
Examples of Custom Metadata #
- Subscription plugin data
- Custom checkout fields
- Additional payment gateway data
- Business-specific internal order fields
Where Custom Metadata Is Stored #
Custom metadata is stored in the same table as default metadata:
- HPOS Enabled → wc_orders_meta
- HPOS Disabled → wp_postmeta
WooCommerce does not use a separate table for custom order metadata.
What Qualifies as Custom Metadata? #
Any metadata entry that is not part of WooCommerce’s built-in core fields is treated as custom metadata.
These fields are typically created dynamically by:
- Third-party plugins
- Custom code
- Extended integrations
Custom Metadata Archiving Behavior #
When custom metadata archiving is enabled:
- The plugin retrieves all metadata rows for the order from:
- wc_orders_meta (HPOS enabled), or
- wp_postmeta (HPOS disabled)
- Archiving is not limited to predefined keys.
- Every additional meta_key → meta_value pair is included.
- Custom metadata is stored alongside default metadata in the archive table.
No additional configuration or separate storage logic is required.
Summary #
- The plugin archives all core WooCommerce order metadata by default.
- It automatically detects whether HPOS is enabled.
- All original meta_key and meta_value pairs are preserved exactly.
- When custom metadata archiving is enabled, all additional metadata is included.
- Default and custom data are archived using the same storage logic.
This ensures complete, accurate, and reliable order reconstruction when needed.
Add your first comment to this post