wp_woocommerce_sessions

Static

Stores session data for tracking user or visitor state.

Column Definitions

ColumnTypeNullable
🔑session_idbigint(20) unsignedNO
session_keychar(32)NO
session_valuelongtextNO
session_expirybigint(20) unsignedNO
user_idbigint(20) unsignedNO
descriptionvarchar(200)YES
permissionsvarchar(10)NO
consumer_keychar(64)NO
consumer_secretchar(43)NO
nonceslongtextYES
truncated_keychar(7)NO
last_accessdatetimeYES
attribute_namevarchar(200)NO
attribute_labelvarchar(200)YES
attribute_typevarchar(20)NO
attribute_orderbyvarchar(20)NO
attribute_publicint(1)NO
download_idvarchar(36)NO
product_idbigint(20) unsignedNO
order_idbigint(20) unsignedNO
order_keyvarchar(200)NO
user_emailvarchar(200)NO
user_idbigint(20) unsignedYES
downloads_remainingvarchar(9)YES
access_granteddatetimeNO
access_expiresdatetimeYES
download_countbigint(20) unsignedNO
order_item_nametextNO
order_item_typevarchar(200)NO
order_idbigint(20) unsignedNO
order_item_idbigint(20) unsignedNO
meta_keyvarchar(255)YES
meta_valuelongtextYES
tax_rate_countryvarchar(2)NO
tax_rate_statevarchar(200)NO
tax_ratevarchar(8)NO
tax_rate_namevarchar(200)NO
tax_rate_prioritybigint(20) unsignedNO
tax_rate_compoundint(1)NO
tax_rate_shippingint(1)NO
tax_rate_orderbigint(20) unsignedNO
tax_rate_classvarchar(200)NO
location_codevarchar(200)NO
tax_rate_idbigint(20) unsignedNO
location_typevarchar(40)NO
zone_namevarchar(200)NO
zone_orderbigint(20) unsignedNO
zone_idbigint(20) unsignedNO
location_codevarchar(200)NO
location_typevarchar(40)NO
🔑instance_idbigint(20) unsignedNO
method_idvarchar(200)NO
method_orderbigint(20) unsignedNO
is_enabledtinyint(1)NO
gateway_idvarchar(200)NO
tokentextNO
user_idbigint(20) unsignedNO
typevarchar(200)NO
is_defaulttinyint(1)NO
payment_token_idbigint(20) unsignedNO
meta_keyvarchar(255)YES
meta_valuelongtextYES
timestampdatetimeNO
levelsmallint(4)NO
sourcevarchar(200)NO
messagelongtextNO
contextlongtextYES
statusvarchar(200)NO
nametextNO
user_idbigint(20) unsignedNO
delivery_urltextNO
secrettextNO
topicvarchar(200)NO
date_createddatetimeNO
date_created_gmtdatetimeNO
date_modifieddatetimeNO
date_modified_gmtdatetimeNO
api_versionsmallint(4)NO
failure_countsmallint(10)NO
pending_deliverytinyint(1)NO
timestampdatetimeNO
permission_idbigint(20) unsignedNO
user_idbigint(20) unsignedYES
user_ip_addressvarchar(100)YES
skuvarchar(100)YES
global_unique_idvarchar(100)YES
virtualtinyint(1)YES
downloadabletinyint(1)YES
min_pricedecimal(19,4)YES
max_pricedecimal(19,4)YES
onsaletinyint(1)YES
stock_quantitydoubleYES
stock_statusvarchar(100)YES
rating_countbigint(20)YES
average_ratingdecimal(3,2)YES
total_salesbigint(20)YES
tax_statusvarchar(100)YES
tax_classvarchar(100)YES
namevarchar(200)NO
slugvarchar(200)NO
product_idbigint(20)NO
stock_quantitydoubleNO
timestampdatetimeNO
expiresdatetimeNO
rate_limit_keyvarchar(200)NO
rate_limit_expirybigint(20) unsignedNO
rate_limit_remainingsmallint(10)NO
urlvarchar(256)NO
enabledtinyint(1)NO
order_idbigint(20) unsignedNO
product_idbigint(20) unsignedNO
variation_idbigint(20) unsignedNO
customer_idbigint(20) unsignedYES
date_createddatetimeNO
product_qtyint(11)NO
product_net_revenuedoubleNO
product_gross_revenuedoubleNO
coupon_amountdoubleNO
tax_amountdoubleNO
shipping_amountdoubleNO
shipping_tax_amountdoubleNO
tax_rate_idbigint(20) unsignedNO
order_item_idbigint(20) unsignedNO
date_createddatetimeNO
shipping_taxdoubleNO
order_taxdoubleNO
total_taxdoubleNO
taxable_amountdoubleNO
coupon_idbigint(20)NO
date_createddatetimeNO
discount_amountdoubleNO
namevarchar(255)NO
typevarchar(20)NO
localevarchar(20)NO
titlelongtextNO
contentlongtextNO
content_datalongtextYES
statusvarchar(200)NO
sourcevarchar(200)NO
date_createddatetimeNO
date_reminderdatetimeYES
is_snoozabletinyint(1)NO
layoutvarchar(20)NO
imagevarchar(200)YES
is_deletedtinyint(1)NO
is_readtinyint(1)NO
iconvarchar(200)NO
note_idbigint(20) unsignedNO
namevarchar(255)NO
labelvarchar(255)NO
querylongtextNO
statusvarchar(255)NO
actioned_textvarchar(255)NO
nonce_actionvarchar(255)YES
nonce_namevarchar(255)YES
user_idbigint(20) unsignedYES
usernamevarchar(60)NO
first_namevarchar(255)NO
last_namevarchar(255)NO
emailvarchar(100)YES
date_last_activetimestampYES
date_registeredtimestampYES
countrychar(2)NO
postcodevarchar(20)NO
cityvarchar(100)NO
statevarchar(100)NO
billing_phonevarchar(100)NO
shipping_phonevarchar(100)NO
category_idbigint(20) unsignedNO

CREATE TABLE Statement

CREATE TABLE wp_woocommerce_sessions ( session_id bigint(20) unsigned NOT NULL AUTO_INCREMENT, session_key char(32) NOT NULL, session_value longtext NOT NULL, session_expiry bigint(20) unsigned NOT NULL, PRIMARY KEY (session_id), KEY session_expiry (session_expiry), UNIQUE KEY session_key (session_key) ) $collate; CREATE TABLE wp_woocommerce_api_keys ( key_id bigint(20) unsigned NOT NULL auto_increment, user_id bigint(20) unsigned NOT NULL, description varchar(200) NULL, permissions varchar(10) NOT NULL, consumer_key char(64) NOT NULL, consumer_secret char(43) NOT NULL, nonces longtext NULL, truncated_key char(7) NOT NULL, last_access datetime NULL default null, PRIMARY KEY (key_id), KEY consumer_key (consumer_key), KEY consumer_secret (consumer_secret) ) $collate; CREATE TABLE wp_woocommerce_attribute_taxonomies ( attribute_id bigint(20) unsigned NOT NULL auto_increment, attribute_name varchar(200) NOT NULL, attribute_label varchar(200) NULL, attribute_type varchar(20) NOT NULL, attribute_orderby varchar(20) NOT NULL, attribute_public int(1) NOT NULL DEFAULT 1, PRIMARY KEY (attribute_id), KEY attribute_name (attribute_name(20)) ) $collate; CREATE TABLE wp_woocommerce_downloadable_product_permissions ( permission_id bigint(20) unsigned NOT NULL auto_increment, download_id varchar(36) NOT NULL, product_id bigint(20) unsigned NOT NULL, order_id bigint(20) unsigned NOT NULL DEFAULT 0, order_key varchar(200) NOT NULL, user_email varchar(200) NOT NULL, user_id bigint(20) unsigned NULL, downloads_remaining varchar(9) NULL, access_granted datetime NOT NULL default '0000-00-00 00:00:00', access_expires datetime NULL default null, download_count bigint(20) unsigned NOT NULL DEFAULT 0, PRIMARY KEY (permission_id), KEY download_order_key_product (product_id,order_id,order_key(16),download_id), KEY download_order_product (download_id,order_id,product_id), KEY order_id (order_id), KEY user_order_remaining_expires (user_id,order_id,downloads_remaining,access_expires), KEY idx_user_email (user_email(100)) ) $collate; CREATE TABLE wp_woocommerce_order_items ( order_item_id bigint(20) unsigned NOT NULL auto_increment, order_item_name text NOT NULL, order_item_type varchar(200) NOT NULL DEFAULT '', order_id bigint(20) unsigned NOT NULL, PRIMARY KEY (order_item_id), KEY order_id (order_id) ) $collate; CREATE TABLE wp_woocommerce_order_itemmeta ( meta_id bigint(20) unsigned NOT NULL auto_increment, order_item_id bigint(20) unsigned NOT NULL, meta_key varchar(255) default NULL, meta_value longtext NULL, PRIMARY KEY (meta_id), KEY order_item_id (order_item_id), KEY meta_key (meta_key(32)) ) $collate; CREATE TABLE wp_woocommerce_tax_rates ( tax_rate_id bigint(20) unsigned NOT NULL auto_increment, tax_rate_country varchar(2) NOT NULL DEFAULT '', tax_rate_state varchar(200) NOT NULL DEFAULT '', tax_rate varchar(8) NOT NULL DEFAULT '', tax_rate_name varchar(200) NOT NULL DEFAULT '', tax_rate_priority bigint(20) unsigned NOT NULL, tax_rate_compound int(1) NOT NULL DEFAULT 0, tax_rate_shipping int(1) NOT NULL DEFAULT 1, tax_rate_order bigint(20) unsigned NOT NULL, tax_rate_class varchar(200) NOT NULL DEFAULT '', PRIMARY KEY (tax_rate_id), KEY tax_rate_country (tax_rate_country), KEY tax_rate_state (tax_rate_state(2)), KEY tax_rate_class (tax_rate_class(10)), KEY tax_rate_priority (tax_rate_priority) ) $collate; CREATE TABLE wp_woocommerce_tax_rate_locations ( location_id bigint(20) unsigned NOT NULL auto_increment, location_code varchar(200) NOT NULL, tax_rate_id bigint(20) unsigned NOT NULL, location_type varchar(40) NOT NULL, PRIMARY KEY (location_id), KEY tax_rate_id (tax_rate_id), KEY location_type_code (location_type(10),location_code(20)) ) $collate; CREATE TABLE wp_woocommerce_shipping_zones ( zone_id bigint(20) unsigned NOT NULL auto_increment, zone_name varchar(200) NOT NULL, zone_order bigint(20) unsigned NOT NULL, PRIMARY KEY (zone_id), KEY zone_order_id (zone_order, zone_id) ) $collate; CREATE TABLE wp_woocommerce_shipping_zone_locations ( location_id bigint(20) unsigned NOT NULL auto_increment, zone_id bigint(20) unsigned NOT NULL, location_code varchar(200) NOT NULL, location_type varchar(40) NOT NULL, PRIMARY KEY (location_id), KEY zone_id (zone_id), KEY location_type_code (location_type(10),location_code(20)) ) $collate; CREATE TABLE wp_woocommerce_shipping_zone_methods ( zone_id bigint(20) unsigned NOT NULL, instance_id bigint(20) unsigned NOT NULL auto_increment, method_id varchar(200) NOT NULL, method_order bigint(20) unsigned NOT NULL, is_enabled tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (instance_id), KEY zone_id (zone_id), KEY method_id (method_id(20)) ) $collate; CREATE TABLE wp_woocommerce_payment_tokens ( token_id bigint(20) unsigned NOT NULL auto_increment, gateway_id varchar(200) NOT NULL, token text NOT NULL, user_id bigint(20) unsigned NOT NULL DEFAULT '0', type varchar(200) NOT NULL, is_default tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (token_id), KEY user_id (user_id) ) $collate; CREATE TABLE wp_woocommerce_payment_tokenmeta ( meta_id bigint(20) unsigned NOT NULL auto_increment, payment_token_id bigint(20) unsigned NOT NULL, meta_key varchar(255) NULL, meta_value longtext NULL, PRIMARY KEY (meta_id), KEY payment_token_id (payment_token_id), KEY meta_key (meta_key(32)) ) $collate; CREATE TABLE wp_woocommerce_log ( log_id bigint(20) unsigned NOT NULL AUTO_INCREMENT, timestamp datetime NOT NULL, level smallint(4) NOT NULL, source varchar(200) NOT NULL, message longtext NOT NULL, context longtext NULL, PRIMARY KEY (log_id), KEY level (level) ) $collate; CREATE TABLE wp_wc_webhooks ( webhook_id bigint(20) unsigned NOT NULL AUTO_INCREMENT, status varchar(200) NOT NULL, name text NOT NULL, user_id bigint(20) unsigned NOT NULL, delivery_url text NOT NULL, secret text NOT NULL, topic varchar(200) NOT NULL, date_created datetime NOT NULL DEFAULT '0000-00-00 00:00:00', date_created_gmt datetime NOT NULL DEFAULT '0000-00-00 00:00:00', date_modified datetime NOT NULL DEFAULT '0000-00-00 00:00:00', date_modified_gmt datetime NOT NULL DEFAULT '0000-00-00 00:00:00', api_version smallint(4) NOT NULL, failure_count smallint(10) NOT NULL DEFAULT '0', pending_delivery tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (webhook_id), KEY user_id (user_id) ) $collate; CREATE TABLE wp_wc_download_log ( download_log_id bigint(20) unsigned NOT NULL AUTO_INCREMENT, timestamp datetime NOT NULL, permission_id bigint(20) unsigned NOT NULL, user_id bigint(20) unsigned NULL, user_ip_address varchar(100) NULL DEFAULT '', PRIMARY KEY (download_log_id), KEY permission_id (permission_id), KEY timestamp (timestamp) ) $collate; CREATE TABLE wp_wc_product_meta_lookup ( `product_id` bigint(20) NOT NULL, `sku` varchar(100) NULL default '', `global_unique_id` varchar(100) NULL default '', `virtual` tinyint(1) NULL default 0, `downloadable` tinyint(1) NULL default 0, `min_price` decimal(19,4) NULL default NULL, `max_price` decimal(19,4) NULL default NULL, `onsale` tinyint(1) NULL default 0, `stock_quantity` double NULL default NULL, `stock_status` varchar(100) NULL default 'instock', `rating_count` bigint(20) NULL default 0, `average_rating` decimal(3,2) NULL default 0.00, `total_sales` bigint(20) NULL default 0, `tax_status` varchar(100) NULL default 'taxable', `tax_class` varchar(100) NULL default '', PRIMARY KEY (`product_id`), KEY `virtual` (`virtual`), KEY `downloadable` (`downloadable`), KEY `stock_status` (`stock_status`), KEY `stock_quantity` (`stock_quantity`), KEY `onsale` (`onsale`), KEY min_max_price (`min_price`, `max_price`), KEY sku (sku(50)), KEY global_unique_id (global_unique_id(50)) ) $collate; CREATE TABLE wp_wc_tax_rate_classes ( tax_rate_class_id bigint(20) unsigned NOT NULL auto_increment, name varchar(200) NOT NULL DEFAULT '', slug varchar(200) NOT NULL DEFAULT '', PRIMARY KEY (tax_rate_class_id), UNIQUE KEY slug (slug($max_index_length)) ) $collate; CREATE TABLE wp_wc_reserved_stock ( `order_id` bigint(20) NOT NULL, `product_id` bigint(20) NOT NULL, `stock_quantity` double NOT NULL DEFAULT 0, `timestamp` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `expires` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`order_id`, `product_id`), KEY product_id_expires (product_id, expires) ) $collate; CREATE TABLE wp_wc_rate_limits ( rate_limit_id bigint(20) unsigned NOT NULL AUTO_INCREMENT, rate_limit_key varchar(200) NOT NULL, rate_limit_expiry bigint(20) unsigned NOT NULL, rate_limit_remaining smallint(10) NOT NULL DEFAULT '0', PRIMARY KEY (rate_limit_id), UNIQUE KEY rate_limit_key (rate_limit_key($max_index_length)) ) $collate; $product_attributes_lookup_table_creation_sql CREATE TABLE wp_wc_product_download_directories ( url_id bigint(20) unsigned NOT NULL auto_increment, url varchar(256) NOT NULL, enabled tinyint(1) NOT NULL DEFAULT 0, PRIMARY KEY (url_id), KEY url (url($max_index_length)) ) $collate; $order_stats_table_schema CREATE TABLE wp_wc_order_product_lookup ( order_item_id bigint(20) unsigned NOT NULL, order_id bigint(20) unsigned NOT NULL, product_id bigint(20) unsigned NOT NULL, variation_id bigint(20) unsigned NOT NULL, customer_id bigint(20) unsigned NULL, date_created datetime $datetime_default NOT NULL, product_qty int(11) NOT NULL, product_net_revenue double DEFAULT 0 NOT NULL, product_gross_revenue double DEFAULT 0 NOT NULL, coupon_amount double DEFAULT 0 NOT NULL, tax_amount double DEFAULT 0 NOT NULL, shipping_amount double DEFAULT 0 NOT NULL, shipping_tax_amount double DEFAULT 0 NOT NULL, PRIMARY KEY (order_item_id, order_id), KEY order_id (order_id), KEY product_id (product_id), KEY customer_id (customer_id), KEY date_created (date_created), KEY customer_product_date (customer_id, product_id, date_created) ) $collate; CREATE TABLE wp_wc_order_tax_lookup ( order_id bigint(20) unsigned NOT NULL, tax_rate_id bigint(20) unsigned NOT NULL, order_item_id bigint(20) unsigned NOT NULL DEFAULT 0, date_created datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, shipping_tax double DEFAULT 0 NOT NULL, order_tax double DEFAULT 0 NOT NULL, total_tax double DEFAULT 0 NOT NULL, taxable_amount double DEFAULT 0 NOT NULL, PRIMARY KEY (order_id, tax_rate_id, order_item_id), KEY tax_rate_id (tax_rate_id), KEY date_created (date_created) ) $collate; CREATE TABLE wp_wc_order_coupon_lookup ( order_id bigint(20) unsigned NOT NULL, coupon_id bigint(20) NOT NULL, date_created datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, discount_amount double DEFAULT 0 NOT NULL, PRIMARY KEY (order_id, coupon_id), KEY coupon_id (coupon_id), KEY date_created (date_created) ) $collate; CREATE TABLE wp_wc_admin_notes ( note_id bigint(20) unsigned NOT NULL AUTO_INCREMENT, name varchar(255) NOT NULL, type varchar(20) NOT NULL, locale varchar(20) NOT NULL, title longtext NOT NULL, content longtext NOT NULL, content_data longtext NULL default null, status varchar(200) NOT NULL, source varchar(200) NOT NULL, date_created datetime NOT NULL default '0000-00-00 00:00:00', date_reminder datetime NULL default null, is_snoozable tinyint(1) DEFAULT 0 NOT NULL, layout varchar(20) DEFAULT '' NOT NULL, image varchar(200) NULL DEFAULT NULL, is_deleted tinyint(1) DEFAULT 0 NOT NULL, is_read tinyint(1) DEFAULT 0 NOT NULL, icon varchar(200) NOT NULL default 'info', PRIMARY KEY (note_id) ) $collate; CREATE TABLE wp_wc_admin_note_actions ( action_id bigint(20) unsigned NOT NULL AUTO_INCREMENT, note_id bigint(20) unsigned NOT NULL, name varchar(255) NOT NULL, label varchar(255) NOT NULL, query longtext NOT NULL, status varchar(255) NOT NULL, actioned_text varchar(255) NOT NULL, nonce_action varchar(255) NULL DEFAULT NULL, nonce_name varchar(255) NULL DEFAULT NULL, PRIMARY KEY (action_id), KEY note_id (note_id) ) $collate; CREATE TABLE wp_wc_customer_lookup ( customer_id bigint(20) unsigned NOT NULL AUTO_INCREMENT, user_id bigint(20) unsigned DEFAULT NULL, username varchar(60) DEFAULT '' NOT NULL, first_name varchar(255) NOT NULL, last_name varchar(255) NOT NULL, email varchar(100) NULL default NULL, date_last_active timestamp NULL default null, date_registered timestamp NULL default null, country char(2) DEFAULT '' NOT NULL, postcode varchar(20) DEFAULT '' NOT NULL, city varchar(100) DEFAULT '' NOT NULL, state varchar(100) DEFAULT '' NOT NULL, billing_phone varchar(100) DEFAULT '' NOT NULL, shipping_phone varchar(100) DEFAULT '' NOT NULL, PRIMARY KEY (customer_id), UNIQUE KEY user_id (user_id), KEY email (email) ) $collate; CREATE TABLE wp_wc_category_lookup ( category_tree_id bigint(20) unsigned NOT NULL, category_id bigint(20) unsigned NOT NULL, PRIMARY KEY (category_tree_id,category_id) ) $collate; $hpos_table_schema; $stock_notifications_table_schema; "; return $tables; } /** * Return a list of WooCommerce tables. Used to make sure all WC tables are dropped when uninstalling the plugin * in a single site or multi site environment. * * @return array WC tables. */ public static function get_tables() { global $wpdb; $tables = array( "wp_wc_download_log", "wp_wc_product_download_directories", "wp_wc_product_meta_lookup", "wp_wc_tax_rate_classes", "wp_wc_webhooks", "wp_woocommerce_api_keys", "wp_woocommerce_attribute_taxonomies", "wp_woocommerce_downloadable_product_permissions", "wp_woocommerce_log", "wp_woocommerce_order_itemmeta", "wp_woocommerce_order_items", "wp_woocommerce_payment_tokenmeta", "wp_woocommerce_payment_tokens", "wp_woocommerce_sessions", "wp_woocommerce_shipping_zone_locations", "wp_woocommerce_shipping_zone_methods", "wp_woocommerce_shipping_zones", "wp_woocommerce_tax_rate_locations", "wp_woocommerce_tax_rates", "wp_wc_reserved_stock", "wp_wc_rate_limits", "wp_wc_product_attributes_lookup", "wp_wc_stock_notifications", "wp_wc_stock_notificationmeta", /* * No longer created: the abandoned cart recovery feature that owned this table was * removed in 11.2.0. It stays listed here so that a site which uninstalls before the * removal migration has run is not left with an orphaned table. */ "wp_wc_email_unsubscribes", // WCA Tables. "wp_wc_order_stats", "wp_wc_order_product_lookup", "wp_wc_order_tax_lookup", "wp_wc_order_coupon_lookup", "wp_wc_admin_notes", "wp_wc_admin_note_actions", "wp_wc_customer_lookup", "wp_wc_category_lookup", "wp_wc_order_fulfillments", "wp_wc_order_fulfillment_meta", // HPOS. "wp_wc_orders", "wp_wc_order_addresses", "wp_wc_order_operational_data", "wp_wc_orders_meta", );

Safe to delete?

If you have uninstalled WooCommerce, this table is generally safe to remove. However, always back up your database first.

Note: Some plugins share tables or are dependencies of other plugins. Verify nothing else depends on this table before dropping it.

How to remove this table

DROP TABLE IF EXISTS `wp_woocommerce_sessions`;

Run this query using phpMyAdmin, Adminer, or your MySQL client. Back up first.

Other tables from WooCommerce