CMS: Adding Filters and Sorts to Datasets to Control Live Site Content
Add filters to CMS (Content Management System) datasets to only show certain items in their connected page elements. To choose the order in which the items appear, add sort conditions to the datasets. In both cases, you choose which collection fields to use for filtering or sorting the collection items. Filters and sorts you add to the dataset have no effect on how items appear in your collection views. If you enable the "Mirror on Site" feature to use the collection's order on your live site, sorts you add to the dataset override the order from your mirrored collection. You can only apply filters and sorts to datasets that are set to the Read or Read & Write mode.In this article, learn more about: 
Adding filters to datasets to include or exclude items from your live site Adding sort conditions to control the order of items on your live site Frequently asked questions (FAQs)Adding filters to your datasetAdd filters to datasets to choose which collection items appear in the connected elements (e.g. repeaters, galleries, input elements). Dataset filters do not affect the items that appear in your collection views. You can add filters to your collection views if you want to only see certain items in the collections, without affecting live site content.For an overview of this process, check out our Ultimate CMS Guide video.Wix EditorStudio Editor
Go to the relevant page in your editor. Go to the relevant dataset settings:
    
Click CMS  on the left.  Click Manage Page Connections. Click the More Actions icon  next to the relevant dataset and select Dataset settings.    Click + Add Filter under Filter.  Click the Field drop-down and select the field you want to apply the filter to.  Click the Condition drop-down and choose the condition you want to use in the filter. The options vary based on the field type that is being filtered.  (If necessary) Select the Value source: 

Manual entry: Enter the value you want to filter by in the Value field.  Another dataset: Select the dataset and field you want to filter from the relevant drop-downs.    Click Add Filter. 
Publish your site when you are ready to make the changes go live. 
Go to the relevant page in your editor. Go to the relevant dataset settings:
    
Click an element that connects to the dataset you want to filter.  Click the Connect to CMS icon . Click Dataset Settings below the Choose a dataset drop-down.   
Click + Add Filter in the Filter section. Click the Field drop-down and select the field you want to apply the filter to. Click the Condition drop-down and choose the condition you want to use in the filter. (If necessary) Select the Value source: 

Manual entry: Enter the value you want to filter in the Value field.  Another dataset: Select the dataset and field you want to filter from the relevant drop-downs.  URL Slug: (Datasets connected to Wix app collections only) You must select the Slug (Text) field to use this filter. Learn how to use the URL slug filter to display collection content on your Stores Product Page or Bookings Pages.    Click Add Filter. 
Publish your site when you are ready to make the changes go live.Adding sort conditions to your datasetBy default, datasets sort items by creation date with the newest items appearing first in the connected page elements (e.g. repeaters, galleries, input elements). You can add sort conditions to datasets to control the order in which the items appear on your site. Dataset sorts override the order in any collections in which you've enabled the "Mirror on Site" feature. However, dataset sorts do not affect the order in which items appear in your collection views. Wix EditorStudio Editor
Go to the relevant page in your editor. Go to the relevant dataset settings:
    
Click CMS  on the left.  Click Manage Page Connections. Click the More Actions icon  next to the relevant dataset and select Dataset settings.    Click Add new sort in the Sort section. 
Tip: To edit an existing sort condition, hover over it, click the More Actions icon  and select Edit. Click the Field drop-down and select the field you want to sort.  Click the Order drop-down and choose the order in which you want the content to appear.  Click Add Sort. 
Publish your site when you are ready to make the changes go live. 
Go to your editor. Click an element that connects to the dataset you want to sort.  Click the Connect to CMS icon . Click Dataset Settings below the Choose a dataset drop-down. 
Click + Add new sort in the Sort section.
Tip: To edit an existing sort condition, hover over it, click the More Actions icon  and select Edit. Click the Field drop-down and select the field you want to sort. Click the Order drop-down and choose the order in which you want the content to appear.  Click Add Sort. 
Publish your site when you are ready to make the changes go live.FAQsClick below for answers to common questions about filtering and sorting items. Can I hide fields in my collection to prevent them from appearing on the page?Yes. In your collection settings, you can toggle on Control item visibility. This adds a new field in your collection where you can set individual items as "Hidden". These items do not get read by the dataset, so they cannot appear on your live site. With this feature, you can also set schedules that automatically show or hide collection items at specific dates and times.Learn more about controlling item visibility from your collection itself.  Keep in mind that hiding, showing, or reordering fields in your collection view, does not affect whether they can be connected to your page elements. Can I control the order in which the items display on my live site from my collection?Yes. You can enable the "Mirror on Site" feature to apply the order of your collection view to connected site elements. Keep in mind that any sorts added to datasets override the order set in the mirrored collection view. How can I sort my items in a more logical way when using a mixture of letters and numbers in a Text field type?When you're using a Text field type that contains both letters and numbers, the system applies an alphabetic sorting order. This means that Text field values are sorted in an alphabetic sequence. For example: 
P101 P120 P1200 P123While this is an expected behavior for an alphabetic sorting logic, you might prefer to sort these values in a numerical sequence.To achieve this, you can use a Number field type without any letters. By using a Number field type, the system will sort the same set of numbers as follows: 
101 120 123 1200This order aligns with a numerical sequence, offering a more intuitive understanding of your sorted data.Learn how to add sorts to your collection view to control the order of items in your collection. What happens if no collection items match my dataset filter criteria?If you add a filter to the dataset that returns no matching results from your collection, then the connected elements will not appear on the live site. After applying a dataset filter, the total number of items that can appear on the page displays next to Filter in the dataset settings. A zero appears if no items match the filter criteria.