---
id: accessibility/configuration/viewfilters
title: View Filters | Cypress Accessibility
description: >-
  The `viewFilters` property allows you to specify URL patterns for URLs that
  should be excluded from Accessibility.
section: accessibility
source_path: docs/accessibility/configuration/viewfilters.mdx
version: a76b2a262c508877f88464ce69558cb3d01b6132
updated_at: '2026-05-14T14:39:51.688Z'
---
# viewFilters

By default, every URL visited within a test run is included in reports. However, not all URLs are relevant for your analysis. The `viewFilters` property allows you to specify patterns for URLs that should be excluded, ensuring your reports focus on meaningful parts of your application.

## Why use view filters?

*   **Exclude Third-Party URLs**: If your application integrates with third-party services, you might want to exclude their URLs from analysis.
*   **Exclude Admin Pages**: URLs that are not part of the user-facing application, such as admin pages, could be excluded from reports.
*   **Reduce Noise**: Certain URLs visited during tests (e.g., error pages or redirects) may not represent meaningful user flows. Exclude these to clean up your reports.
*   **Optimize Performance**: Filtering out irrelevant URLs reduces the amount of data processed, speeding up analysis and improving report readability.

## Scope

**Note:** setting `viewFilters` impacts both Accessibility and UI Coverage reports. Nesting this property under an `accessibility` or `uiCoverage` key is supported, if you need to split them up.

## Note on product-specific behavior

*   In UI Coverage, excluding a URL excludes all application snapshots from that URL from the reports, and **also** excludes all links pointing to that URL from being counted towards coverage scores.
*   In Cypress Accessibility, excluding a URL excludes all application snapshots from that URL from the reports, but has no other effects.

## Syntax

```
{  "viewFilters": [    {      "pattern": string,      "include": boolean,      "comment": string    }  ]}
```

### Options

For every URL visited and link element found, the first `viewFilters` rule for which the `pattern` matches the URL is used to either include or exclude the URL based on the `include` value. URLs that do not match any rules are included by default.

| Option | Required | Default | Description |
| --- | --- | --- | --- |
| `pattern` | Required |  | A string that matches URLs using [URL Pattern API](https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API) syntax. |
| `include` | Optional | `true` | A boolean that determines whether matching URLs should be included in the report. |
| `comment` | Optional |  | A comment describing the purpose of this filter rule. |

## Examples

### Excluding URLs by hostname

#### Config

```
{  "viewFilters": [    {      "pattern": "https://app.okta.com/*",      "include": false    }  ]}
```

#### Visited URLs

```
https://app.okta.com/loginhttps://cypress.io/homehttps://cypress.io/about
```

#### Views shown in UI

```
https://cypress.io/homehttps://cypress.io/about
```

* * *

### Including only specific URLs

#### Config

```
{  "viewFilters": [    {      "pattern": "https://cypress.io/dashboards*",      "include": true    },    {      "pattern": "*",      "include": false    }  ]}
```

#### Visited URLs

```
https://cypress.io/dashboardshttps://cypress.io/dashboards/1https://cypress.io/dashboards/2https://cypress.io/homehttps://cypress.io/login
```

#### Views shown in UI

```
https://cypress.io/dashboardshttps://cypress.io/dashboards/*
```

### Excluding error pages

#### Config

```
{  "viewFilters": [    {      "pattern": "http*://*/404",      "include": false    },    {      "pattern": "http*://*/error/*",      "include": false    }  ]}
```

#### Visited URLs

```
https://cypress.io/homehttps://cypress.io/404https://cypress.io/error/500
```

#### Views shown in UI

```
https://cypress.io/home
```
