Search Attributes for WooCommerce
Search Attributes for WooCommerce
Description
Search Attributes for WooCommerce is a WordPress Plugin that enables Product search form to look into Product Attribute Names.
E.g. as show in plugin screenshots, you can search products using color name.
Another useful example is, you can search products using Brand name if you have Brands assigned as attributes.
To use this plugin, please make sure that Woocommerce is installed and Activated.
Important Notes
- The plugin may not effect in case you are using some other product search related plugin for woocommerce.
- Choose your attributes carefully, because the more attributes you choose, the more it will effect on the search speed.
Contribute
If you want to fix a bug in the plugin or add new features, feel free to fork this github repo and follow the CONTRIBUTING.md file in the github repo for guidelines.
Installation
- Go to your admin area and select Plugins -> Add new from the menu.
- Search for “Search Attributes for WooCommerce”.
- Click install.
- Click activate. If woocommrce is not installed or activated then this plugin will also not activate.
Screenshots
Faq
- Go to WordPress “Admin > Woocommerce > Search Attributes for WooCommerce”.
- Select the attributes you want the search form to look into, select status to “Enable” and click “Save Changes”.
Yes. if you disable or delete the plugin, the changes you made will be undone. Also if you change the Status in plugin settings to “Disabled”, it will not search for attributes.
Reviews
Absolutely stunning!
By rozlity on September 5, 2025
Exactly what I was looking for! I needed a plugin that could search for book authors (who are listed as attributes). I highly recommend it to everyone and thank you!
Good Job!
By denizutku on March 23, 2024
Its Cool...
Search on hidden attributes
By tanduf on November 26, 2023
Great plugin !
Very easy to configure and use.
Allows searching on hidden attributes of products. Exactly what i was looking for.
Long life to this plugin.
does the job
By linascp on January 4, 2023
Very good, does the job.
Problem with translation
By Danny (daining1298) on July 1, 2022
Simple and effective (Mod: Exclude products where the variation is out of stock)
By sajetek on January 1, 2022
function wsatt_brands_where( $where = '' ) {
global $wpdb;
$product_ids = get_in_stock_IDS();
if($product_ids != "")
$where .= " OR $wpdb->posts.ID IN (".get_in_stock_IDS().")";
return $where;
}
function get_in_stock_IDS() {
global $wpdb;
$parent_ids = array();
$wsatt_attributes = @get_option('wsatt_attributes');
if(is_array($wsatt_attributes) && count($wsatt_attributes)>0){
foreach($wsatt_attributes as $attribute){
$parent_id_objects = $wpdb->get_results("SELECT $wpdb->posts.ID
FROM $wpdb->posts
LEFT JOIN $wpdb->term_relationships ON($wpdb->posts.ID = $wpdb->term_relationships.object_id)
LEFT JOIN $wpdb->term_taxonomy ON($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)
LEFT JOIN $wpdb->terms ON($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id)
WHERE $wpdb->posts.post_type = 'product'
AND $wpdb->posts.post_status = 'publish'
AND $wpdb->term_taxonomy.taxonomy = '$attribute'
AND $wpdb->terms.name LIKE '%".esc_attr( $_GET['s'] )."%'");
if(count($parent_id_objects) == 0) continue;
foreach($parent_id_objects as $parent_id_object) {
$children = get_option("_transient_wc_product_children_".$parent_id_object->ID);
if(is_array($children) && count($children['all']) > 0) {
$instock = $wpdb->get_var("SELECT s.meta_value as stock from $wpdb->postmeta LEFT JOIN $wpdb->postmeta as s ON s.post_id = $wpdb->postmeta.post_id AND s.meta_key = '_stock' WHERE $wpdb->postmeta.post_id IN (".implode(",", $children['all']).") AND $wpdb->postmeta.meta_key like '%".$attribute."' AND $wpdb->postmeta.meta_value LIKE '%".esc_attr( $_GET['s'] )."%' AND s.meta_value > 0");
if($instock != NULL) {
//Child is matched based on query string and stock is NOT zero so we add that parent id to be displayed
$parent_ids[] = $parent_id_object->ID;
}
}else {
$parent_ids[] = $parent_id_object->ID;
}
}
}
return implode(",", $parent_ids);
}
}
Results from attribute search, simple and effective
By andrescarvajal on November 2, 2021
Simply works!
By melebius on October 4, 2021
Extremely easy, light, does what it needs to do.
By paruno on March 30, 2021
Changelog
Version 1.3.6
- tested with wordpress version 6.8
- tested with woocommerce version 9.8.2
Version 1.3.5
- tested with wordpress version 6.7.1
- tested with woocommerce version 9.5.2
Version 1.3.4
- Make plugin compatible with HPOS ( High-Performance Order Storage )
- tested with wordpress version 6.4.0
- tested with woocommerce version 8.4.0
Version 1.3.3
- tested with wordpress version 6.1.1
- tested with woocommerce version 7.2.0
Version 1.3.2
- tested with wordpress version 5.9.3
- tested with woocommerce version 6.4.1
- added notes for developers for contributing to plugin
Version 1.3.0
- added global translation support
Version 1.2.0
- Secutiry fixes
- Refactoring of the code
- Updated the code to follow WPVIP coding standards
Version 1.0.0
- Initial release.


