Website Building » WooCommerce » What Table Are WooCommerce Products Stored?

What Table Are WooCommerce Products Stored?

Last updated on October 1, 2022 @ 1:34 pm

WooCommerce products are stored in the wp_posts table in the WordPress database. The post_type for a product is ‘product’. If you look at the wp_posts table, you will see that there are a few additional columns for products, such as _sku (product SKU), _price (product price), and _stock (stock status).

In addition to being stored in the wp_posts table, product data is also stored in the wp_postmeta table. The wp_postmeta table contains meta data for all posts, not just products. So, you will need to use the meta_key ‘_sku’ to query only product data.

The product data in the wp_posts and wp_postmeta tables can be somewhat confusing. If you want to get a better understanding of how it is organized, I recommend you install the Data Explorer plugin. This plugin will allow you to visually explore the WordPress database.

PRO TIP: Please be aware that the WooCommerce Products Table is a database table used to store information about products in the WooCommerce shopping cart plugin. This table should not be modified or deleted without first backing up your database. Doing so could result in loss of data and/or malfunction of the WooCommerce shopping cart.

After installing the Data Explorer plugin, go to Tools > Data Explorer. Select the “Products” data type from the drop down menu. You will now see a list of all products in the database, as well as all the meta data for each product.

Now that you know where WooCommerce products are stored, you can start building custom queries to display them on your website. For example, you could create a custom page template that displays all products in a certain price range.

Or, you could create a shortcode that displays products from a specific category. The possibilities are endless!

Morgan Bash

Morgan Bash

Technology enthusiast and Co-Founder of Women Coders SF.