> For the complete documentation index, see [llms.txt](https://mpithemes.gitbook.io/unicorn-shopify-theme/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mpithemes.gitbook.io/unicorn-shopify-theme/faq/how-to-set-up-filters.md).

# How to set up filters?

{% embed url="<https://www.youtube.com/watch?v=dUK8yR5Pkjw>" %}

### Add default filters using the Shopify Search & Discovery app

Read the initial [<mark style="color:blue;">documentation</mark>](https://help.shopify.com/en/manual/online-store/search-and-discovery/filters) for filter configuration requirements.

Then, you can follow the listed steps to display filters:

#### **Step 1**

In your *Shopify admin -> Apps*, select the **Shopify Search & Discovery** app:

<figure><img src="/files/KCrVLgIlnNvf7AxkXdMt" alt=""><figcaption></figcaption></figure>

#### **Step 2**

Then, you can press the **"Filters"** item in the side menu to navigate to the needed chapter:

<figure><img src="/files/AfNfPB3PwSvH3dwTdjgn" alt=""><figcaption></figcaption></figure>

#### **Step 3**

Press the **"Add filter"** button to view all the available filters:

<figure><img src="/files/Ay9uiVnGcTj30ja2VXQl" alt=""><figcaption></figcaption></figure>

#### **Step 4**

In the "Source" selector, you can choose filters that should be available in a storefront.

<figure><img src="/files/NOa9Fiwhv3x4udvVW5Tp" alt=""><figcaption></figcaption></figure>

Add each filter one by one.

In the **"Filter label"** field, paste the name of the filter if necessary.

**Save the changes.**

{% hint style="warning" %}
**Note!** If you need to display filters for product options such as color, size, style, etc., add the desired options for products in *Shopify admin -> Products*:
{% endhint %}

<figure><img src="/files/Mmt7T5p0b0krUwbivt85" alt=""><figcaption></figcaption></figure>

#### **Step 5**

The filters will be displayed in the same order as you set them up at the back end. If you need to change the filter's position in the sidebar, change the order in the app by dragging filters up or down:

<figure><img src="/files/BKq0YsNVq8s2xcmqXVcA" alt=""><figcaption></figcaption></figure>

#### **Step 6**

Now you can go to *Theme Editor -> Collections -> Product grid ->* [*<mark style="color:blue;">Filtering</mark>*](https://mpithemes.gitbook.io/unicorn-shopify-theme/page-categories/collections/product-grid#filtering) to make sure the filters have been approved:

<figure><img src="/files/DbiEysXr9hQVYaiLFr5j" alt=""><figcaption></figcaption></figure>

### Create custom filters using metafileds

Previously in this article, you learned how to customize the standard filters on the storefront based on product information added in your admin, such as product vendor, type, and product variants. However, Shopify’s software has some limitations, allowing you to add up to three product variants in the admin for use as filters on the storefront. So, what if you need to add more filters that do not match product variants, or there is no need to display them as product variants in your store? This can be achieved using metafields.

To display custom filters in a store, follow the steps below:

#### Step 1

Create a metafield in your *Shopify admin -> Settings -> Metafields and metaobjects -> Metafield definitions -> Products* by hitting the **"Add definition"** button.

<figure><img src="/files/xu784hmOcl6pnkV7zBGv" alt=""><figcaption></figcaption></figure>

We will create a metafield to display a filter by gender. An example of the metafield settings can be viewed below:

* Name - **Specifics**
* **custom.specifics** (generated automatically)
* **Single line text** - **One value**

<figure><img src="/files/5fNgXL6MpdY7Z6cvml8V" alt=""><figcaption></figcaption></figure>

#### Step 2

Go to **"Products"** in your admin and assign filter items to products using the designed metafield.

<figure><img src="/files/GjUM1ZeTRgkFL1LsiPEF" alt=""><figcaption></figcaption></figure>

Add an appropriate value to each product that needs filtering.

#### Step 3

To display the filter on the storefront, add a filter to the list of filters in the Shopify Search & Discovery app. Go to **Apps**, select the app, and press the **"Filters"** tab. Then, hit the **"Add filter"** button.

<figure><img src="/files/Ay9uiVnGcTj30ja2VXQl" alt=""><figcaption></figcaption></figure>

#### Step 4

Next, select the filter by pressing the **"Source"** field.

<figure><img src="/files/3Ft2qXnGDe24zls85Fbs" alt=""><figcaption></figcaption></figure>

**Save the settings.**

Now, you can view the filter on the storefront:

<figure><img src="/files/BXppa8m1tFrVAtbFzcxy" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://mpithemes.gitbook.io/unicorn-shopify-theme/faq/how-to-set-up-filters.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
