Skip to content
Advertisement

How do I correctly filter by a specific product attribute (Brand in this case) in Woocommerce backend

I have to be upfront and say I haven’t coded in around 10 years. My knowledge is close to zero coding PHP but being a IT professional I am not a “complete” idiot.

In the product list of Woocommerce (backend) I want to have a Brand filter. I made a product attribute called “Brand”. With the help of a few websites I compiled this bit of code in my Functions.php

JavaScript

I don’t know how to specify that I want to filter the brand product attribute.

Can anybody help?

Advertisement

Answer

based on this tutorial you could use something like this (place the code inside functions.php)

JavaScript

to find the correct Taxonomy you have to look in the URL for the GET parameter taxonomy see example below the bolt part is the correct taxonomy

yourdomain.com/wp-admin/edit-tags.php?taxonomy=product_brand&post_type=product

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement