--- title: Filter rules for recommendations slug: o8rk0050 canonical_url: https://docs.coveo.com/en/o8rk0050/ collection: coveo-merchandising-hub source_format: adoc --- # Filter rules for recommendations In the [Coveo Merchandising Hub (CMH)](https://docs.coveo.com/en/o5290573/), merchandisers can define _filter_ rules to control the products that are displayed in product [recommendation slots](https://docs.coveo.com/en/o9b80563/). Recommendation filter rules let merchandisers define the conditions that products must meet to appear in or be excluded from a recommendation slot. For example, a merchandiser can create a filter rule to exclude all products that are out of stock from being recommended in a slot. filter rules can also be scheduled for a specific time, letting merchandisers plan and execute strategies effectively. > **Note** > > Currently, recommendation filter rules can only apply to specific recommendation slots. ![Filter rules for recommendation slots | Coveo](https://docs.coveo.com/en/assets/images/coveo-for-commerce/images/cmh/cmh-recs-create-filter-rule.png) ## Use case examples Filter rules can be used to address a variety of use cases. Here are a few examples: * **Exclude out-of-stock products**: Prevent out-of-stock products from appearing in a slot. * **Highlight specific products**: Ensure that only specific products are displayed in recommendation slots. For example, you could create a rule that guarantees products from a particular brand are being recommended. * **Exclude specific products**: Exclude certain products from being recommended in specific contexts. For example, you might exclude products from a specific category from being recommended when a related product is being viewed. ## Prerequisites Before you create rules in the [Coveo Merchandising Hub (CMH)](https://docs.coveo.com/en/o5290573/): * [Create query pipelines](https://docs.coveo.com/en/o48e0216#storefront-associations-and-query-pipelines). * [Choose the correct property](https://docs.coveo.com/en/o6lb0453#property-and-locale-selectors) to ensure that your changes affect the intended recommendation slots. ## Create a filter rule You can create two types of filter rules. Depending on the type of filter rule that you want to create, refer to the following articles for specific instructions: * [Only show](https://docs.coveo.com/en/o8rk6538/): Only products that meet the conditions will be displayed in recommendation slots. * [Exclude](https://docs.coveo.com/en/o8rk7308/): Products that meet the conditions won't be displayed in recommendation slots. > **Note** > > If a product meets the conditions of both an only show rule and an exclude rule for the same slot, the exclude rule takes precedence. > For details, see [Priority of rule operations](https://docs.coveo.com/en/o4nh0046#priority-of-rule-operations).