Woocommerce: Search by custom attribute

First verify your product attribute (meta_key) by running this query Note: Change table prefix according to your wordpress database mine is default wp_ SELECT * FROM wp_postmeta WHERE meta_key LIKE ‘%code%’; /* get attribute name example (_sku, _stock, _stock_status, height, width )*/ Now add this to your functions.php file function Add_custom_search( $query ) { if( … Read more