where does woocommerce store orders? where does woocommerce store orders? wordpress wordpress

where does woocommerce store orders?


In woocommerce orders are modelled as a custom post type so they are stored in wp_posts as you found. See WooCommerce taxonomies and post types for a list of the custom post types that woocommerce uses. Orders are stored as the type shop_order

Separate items within an Order are stored as separate records in the custom table woocommerce_order_items


Updated plug-in version information 8/10/2018

Orders are a custom post type. From WooCommerce Post Types:

  • Shop Order (shop_order)

Orders live in the wp_posts table (post_type = 'shop_order'). More data is available by looking up the order's post_id in the wp_postmeta table.

In addition, from the WooCommerce GitHub Wiki Database Description

  • woocommerce_order_items – Stores line items which are associated with orders.
  • woocommerce_order_itemmeta – Stores meta data about order line items.

Currently the WordPress WooCommerce plug-in version is 3.4.x


WooCommerce orders are "custom post" they are stored in "wp_posts" under "post_type" -> ""shop_order"

if you want to select shop orders with sql query you can do something like below.

global $wpdb;$results = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE post_type = 'shop_order'", ARRAY_A );