---
title: Filters
slug: cms-12/docs/filters
docTags: 
createdAt: 2026-08-10T15:55:57.000Z
---

## CurrentlyPublished

`CurrentlyPublished` checks whether the content is currently published in any language.

`SearchClient.Instance.Search<IContent>().CurrentlyPublished()`

## ExcludeDeleted

`ExcludeDeleted` excludes content that was moved to the trash (recycle bin). This method is important because, by default, content in the trash is indexed.

`SearchClient.Instance.Search<IContent>().ExcludeDeleted()`

## FilterForVisitor

`FilterForVisitor` is a group of filters including `ExcludeDelete`, `PublishedInCurrentLanguage`, and `FilterOnReadAccess`.

## FilterOnCurrentSite

`FilterOnCurrentSite` filters content of the current site that is being visited. This method uses `SiteDefinition.Current.Id` to determine which site is being visited.

`SearchClient.Instance.Search<IContent>().FilterOnCurrentSite();`

## FilterOnReadAccess

`FilterOnReadAccess` filters content to which the end user does not have access. This method uses `VirtualRoleRepository`, which includes users, roles, and visitor groups.

`SearchClient.Instance.Search<IContent>().FilterOnReadAccess()`

## PublishedInCurrentLanguage

`PublishedInCurrentLanguage` checks whether the content is published in the current language.

`SearchClient.Instance.Search<IContent>().PublishedInCurrentLanguage()`

## Filter results by access rights

When integrating Optimizely Search & Navigation with Optimizely Content Management System (CMS), the search engine does not filter documents (such as pages or files) according to access rights. However, the return values from the `IContent` extension methods `RolesWithReadAccess` and `UsersWithReadAccess` are indexed. You can use these methods to ensure only users with access rights to the supplied roles or users see the content.

**Example:**

```csharp
SearchClient.Instance.Search<StandardPage>()
    .For("Possibly secret stuff")
    .Filter(x => x.RolesWithReadAccess().Match("Everyone"))
    .GetContentResult();
```

:::hint{type="info"}
**Note**
Control access to UI features

- Members assigned to the roles of WebAdmins, Administrators, SearchAdmins, and SearchEditors can access the Search & Navigation user interface.
- Only WebAdmins, Administrators, and SearchAdmins can clear indexes.

See [Shell module](docId\:prd5_cCC_c8HF0jc0-5vQ).
:::
