I want to add a new column for listing primary category in product list page (backend) of WooCommerce.
Also I want to fill the new column with primary category of each product.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can create a new custom column in admin product list page. We can use
manage_edit-product_columns
filter hook andmanage_product_posts_custom_column
action hook for create new column.“Primary category” is not a default woocommerce feature. It is comes from yoast seo plugin. This field is stored in
postmeta
table with “_yoast_wpseo_primary_product_cat
” meta_key.Add the following code in functions.php of your child theme.
This will create a new column with “Primary Category” as shown in the below screenshot.