Quote from Alex Dovlatov on January 9, 2026, 13:42
Hello
Yes, it's possible to set the In Stock filter to be checked/enabled by default!
Solution
Add next code to your theme's functions.php file (child theme recommended):
add_filter('woof_get_request_data', 'woof_default_instock_on');
function woof_default_instock_on($data){
$data['stock'] = 'instock';
return $data;
}
How it works
This code uses the woof_get_request_data filter hook to automatically add stock=instock to the filter request data, making the In Stock checkbox checked by default when users land on your shop pages.
Where to add the code
- Recommended: Add to your child theme's
functions.php file:wp-content/themes/your-child-theme/functions.php
- Alternative: Use a plugin like "Code Snippets" to add the code safely
Important: Don't add this to the parent theme's functions.php as it will be overwritten when you update the theme!
This will make the In Stock filter active by default every time users visit your shop pages.
Also read: https://products-filter.com/manipulate-search-data-options/
Hello
Yes, it's possible to set the In Stock filter to be checked/enabled by default!
Solution
Add next code to your theme's functions.php file (child theme recommended):
add_filter('woof_get_request_data', 'woof_default_instock_on');
function woof_default_instock_on($data){
$data['stock'] = 'instock';
return $data;
}
How it works
This code uses the woof_get_request_data filter hook to automatically add stock=instock to the filter request data, making the In Stock checkbox checked by default when users land on your shop pages.
Where to add the code
- Recommended: Add to your child theme's
functions.php file:wp-content/themes/your-child-theme/functions.php
- Alternative: Use a plugin like"Code Snippets" to add the code safely
Important: Don't add this to the parent theme's functions.php as it will be overwritten when you update the theme!
This will make the In Stock filter active by default every time users visit your shop pages.
Also read: https://products-filter.com/manipulate-search-data-options/