In my current project I needed to know which fields are available for each product type. The list is below, hope it can be of use for your own project!
A word about post vs product type
In WooCommerce we have 2 main post types: “product” and “product_variation”. Post type “product” is used for all products that are visible on the category page such as simple, variable, grouped and external products. Post type “product_variation” is used for variations of a variable product and do not show on their own on the category page. Post types are core WP concepts and stored in the POSTS table. They can be used in WP_Query to filter which type of content is shown.
WooCommerce product types have 4 default types (more can be added by plugins): “simple”, “variable”, “external” and “grouped”. Product types are Woo fields; and stored in the POSTMETA table.
Explanation of Symbols
✅ = in use
❌ = not in use by this product type
⚠️ = see numbered notes
y = available but not used by WooCommerce product class
Post Fields
These fields are core WP and stored in the POSTS table. WooCommerce has its own Getter / Setter methods for retrieving and updating the fields, and these can differ from the column name in the database.
Database Field | Woo Get / Set Key | Simple | Variable | Variation | Grouped | External |
id | id | ✅ | ✅ | ✅ | ✅ | ✅ |
post_author | – | y | y | y | y | y |
post_date | – | y | y | y | y | y |
post_date_gmt | date_created 2 | ✅ | ✅ | y | ✅ | ✅ |
post_content | description | ✅ | ✅ | [empty] | ✅ | ✅ |
post_title | name | ✅ | ✅ | ⚠️ 1 | ✅ | ✅ |
post_excerpt | short_description | ✅ | ✅ | ⚠️ 1 | ✅ | ✅ |
post_status | status | ✅ | ✅ | ⚠️ 4 | ✅ | ✅ |
comment_status | reviews_allowed | ✅ | ✅ | y | ✅ | ✅ |
ping_status | – | y | y | y | y | y |
post_password | post_password | ✅ | ✅ | y | ✅ | ✅ |
post_name | slug | ✅ | ✅ | ⚠️ 1 | ✅ | ✅ |
to_ping | – | y | y | y | y | y |
pinged | – | y | y | y | y | y |
post_modified | – | y | y | y | y | y |
post_modified_gmt | post_modified | ✅ | ✅ | y | ✅ | ✅ |
post_content_filtered | – | [empty] | [empty] | [empty] | [empty] | [empty] |
post_parent | parent_id | y [0] | y [0] | ✅ | y [0] | y [0] |
guid | – | y | y | y | y | y |
menu_order | menu_order | ✅ | ✅ | ✅ | ✅ | ✅ |
post_type | – | ✅ [product] | ✅ [product] | ✅ [product_ variation] | ✅ [product] | ✅ [product] |
post_mime_type | – | [empty] | [empty] | [empty] | [empty] | [empty] |
comment_count 3 | – | y | y | – | y | y |
2 See WC_Product_Data_Store_CPT class
3 Duplicated as meta_key “_wc_review_count”
4 Post_status for Variations: “inherit” = enabled / “private” = disabled
Post Meta Fields
Post Meta fields are created by WooCommerce and stored in the POSTMETA table.
✅ = in use
❌ = not in use by this product type
Woo Getter / Setter Key | meta_key | Simple | Variable | Variation | Grouped | External |
variation_description | _variation_description | ❌ | ❌ | ✅ 4 | ❌ | ❌ |
sku | _sku | ✅ | ✅ | ✅ | ✅ | ✅ |
regular_price | _regular_price | ✅ | ✅ | ✅ | ❌ | ✅ |
sale_price | _sale_price | ✅ | ✅ | ✅ | ❌ | ✅ |
price | _price | ✅ | ✅ | ✅ | ❌ | ✅ |
date_on_sale_from | _sale_price_dates_from | ✅ | ✅ | ✅ | ❌ | ✅ |
date_on_sale_to | _sale_price_dates_to | ✅ | ✅ | ✅ | ❌ | ✅ |
total_sales | total_sales | ✅ | ✅ | ✅ | ❌ | ✅ |
tax_status | _tax_status | ✅ | ✅ | ✅ | ❌ | ❌ |
tax_class | _tax_class | ✅ | ✅ | ✅ | ❌ | ❌ |
manage_stock 2 | _manage_stock | ✅ | ✅ | ✅ | ❌ | ❌ |
stock_status | _stock_status | ✅ | ✅ | ✅ | ❌ | ❌ |
stock_quantity | _stock | ✅ | ✅ | ✅ | ✅ | ❌ |
backorders | _backorders | ✅ | ✅ | ✅ | ✅ | ❌ |
low_stock_amount | _low_stock_amount | ✅ | ✅ | ✅ | ✅ | ❌ |
sold_individually | _sold_individually | ✅ | ✅ | ❌ | ❌ | ❌ |
weight | _weight | ✅ | ✅ | ✅ | ❌ | ❌ |
length | _length | ✅ | ✅ | ✅ | ❌ | ❌ |
width | _width | ✅ | ✅ | ✅ | ❌ | ❌ |
height | _height | ✅ | ✅ | ✅ | ❌ | ❌ |
Woo Getter / Setter Key | meta_key | Simple | Variable | Variation | Grouped | External |
upsell_ids | _upsell_ids | ✅ | ✅ | ❌ | ✅ | ✅ |
cross_sell_ids | _crosssell_ids | ✅ | ✅ | ❌ | ❌ | ❌ |
children | _children | ❌ | ❌ | ❌ | ✅ | ❌ |
purchase_note | _purchase_note | ✅ | ✅ | ❌ | ❌ | ❌ |
attributes 1 | _product_attributes | ✅ | ✅ | ❌ | ✅ | ✅ |
default_attributes | _default_attributes | ❌ | ✅ | ❌ | ❌ | ❌ |
virtual | _virtual | ✅ | ❌ | ✅ | ❌ | ❌ |
downloadable | _downloadable | ✅ | ❌ | ✅ | ❌ | ❌ |
downloads | _downloadable_files | ✅ | ❌ | ✅ | ❌ | ❌ |
download_limit | _download_limit | ✅ | ❌ | ✅ | ❌ | ❌ |
download_expiry | _download_expiry | ✅ | ❌ | ✅ | ❌ | ❌ |
image_id | _thumbnail_id | ✅ | ✅ | ✅ | ✅ | ✅ |
gallery_image_ids | _product_image_gallery | ✅ | ✅ | ❌ | ✅ | ✅ |
rating_count | _wc_rating_count | ✅ | ✅ | ❌ | ✅ | ✅ |
average_rating | _wc_average_rating | ✅ | ✅ | ❌ | ✅ | ✅ |
review_count | _wc_review_count | ✅ | ✅ | ❌ | ✅ | ✅ |
product_url | _product_url | ❌ | ❌ | ❌ | ❌ | ✅ |
button_text | _button_text | ❌ | ❌ | ❌ | ❌ | ✅ |
_file_paths 3 | ||||||
_product_version 3 | ||||||
_wp_old_slug 3 | ||||||
_edit_last 3 | ||||||
_edit_lock 3 |
2 “Manage Stock” for variable products can be done at product and / or variation level
3 In use by WC_Product_Data_Store_CPT class but not in Product Class
4 For Getter / Setter use “get_description”. Method “get_variation_description” is deprecated since Woo 3.0
Taxonomies
WooCommerce uses taxonomies for categories and tags as well as visibility and shipping class. Attributes are also taxonomies, but the assignment of attributes to products is done as postmeta field in array format.
Woo Getter / Setter Key | Term | Simple | Variable | Variation | Grouped | External |
type | product_type | simple | variable | ❌ | grouped | external |
category_ids | product_cat | ✅ | ✅ | ❌ | ✅ | ✅ |
tag_ids | product_tag | ✅ | ✅ | ❌ | ✅ | ✅ |
shipping_class_id | product_shipping_class | ✅ | ✅ | ✅ | ❌ | ❌ |
product_visibility 1 | ✅ | ✅ | ❌ | ✅ | ✅ | |
catatalog_visibility [hidden, catalog, search, visible] 2 | [included above] | ✅ | ✅ | ❌ | ✅ | ✅ |
featured | [included above] | ✅ | ✅ | ❌ | ✅ | ✅ |
average_rating | [included above] | ✅ | ✅ | ❌ | ✅ | ✅ |
stock_status | [included above] | ✅ | ✅ | ❌ | ✅ | ✅ |
2 Catalog visibility is saved as product_visbility with terms exclude-from-search, exclude-from-catalog
Here is how the product_visibility is set in WC_Product_Data_Store_CPT:

Leave a Reply