Hey, where in the database (or phpMyAdmin) are my WooCommerce products stored? Sometimes you may have some reason to find directly any product in your database by name, id, custom taxonomy, type, tags, or attributes. Let’s show how to find products that you need and look at the relevant tables which contain your product data.
In newer WooCommerce (since 3.7+) versions are products stored in the following tables (mainly in the first two tables):
wp_poststable with a
wp_postmetatable with a
post_idas the relational index (the product ID)
product_idas the relational index (the post ID) | Allow fast queries on specific product data
product_idas the relational index (the post ID) | Allow fast queries to retrieve products on orders
SQL query on table wordpress.wp_posts:
SELECT * FROM `wp_posts` WHERE `post_type` LIKE 'product'
Product categories, subcategories, tags, attributes, or custom taxonomies are stored in the following tables (some additional plugins got their own tables):
object_idas the relational index (the product ID)
wp_woocommerce_attribute_taxonomies(for product attributes only)
wp_wc_category_lookup(for product categories hierarchy – since WooCommerce 3.7)
In fact, products are stored only as another post type. They can be found in the wp_posts table, under the product post type.
When you find the product that you need, copy its id and easily lookup for the remaining information under other tables.