{
  "doc": {
    "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": "/llm/markdown/accessibility/configuration/viewfilters.md",
    "version": "a76b2a262c508877f88464ce69558cb3d01b6132",
    "updated_at": "2026-05-14T14:39:51.688Z",
    "headings": [
      {
        "id": "accessibility/configuration/viewfilters#viewfilters",
        "text": "viewFilters",
        "level": 1
      },
      {
        "id": "accessibility/configuration/viewfilters#why-use-view-filters",
        "text": "Why use view filters?",
        "level": 2
      },
      {
        "id": "accessibility/configuration/viewfilters#scope",
        "text": "Scope",
        "level": 2
      },
      {
        "id": "accessibility/configuration/viewfilters#note-on-product-specific-behavior",
        "text": "Note on product-specific behavior",
        "level": 2
      },
      {
        "id": "accessibility/configuration/viewfilters#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "accessibility/configuration/viewfilters#options",
        "text": "Options",
        "level": 3
      },
      {
        "id": "accessibility/configuration/viewfilters#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "accessibility/configuration/viewfilters#excluding-urls-by-hostname",
        "text": "Excluding URLs by hostname",
        "level": 3
      },
      {
        "id": "accessibility/configuration/viewfilters#config",
        "text": "Config",
        "level": 4
      },
      {
        "id": "accessibility/configuration/viewfilters#visited-urls",
        "text": "Visited URLs",
        "level": 4
      },
      {
        "id": "accessibility/configuration/viewfilters#views-shown-in-ui",
        "text": "Views shown in UI",
        "level": 4
      },
      {
        "id": "accessibility/configuration/viewfilters#including-only-specific-urls",
        "text": "Including only specific URLs",
        "level": 3
      },
      {
        "id": "accessibility/configuration/viewfilters#config",
        "text": "Config",
        "level": 4
      },
      {
        "id": "accessibility/configuration/viewfilters#visited-urls",
        "text": "Visited URLs",
        "level": 4
      },
      {
        "id": "accessibility/configuration/viewfilters#views-shown-in-ui",
        "text": "Views shown in UI",
        "level": 4
      },
      {
        "id": "accessibility/configuration/viewfilters#excluding-error-pages",
        "text": "Excluding error pages",
        "level": 3
      },
      {
        "id": "accessibility/configuration/viewfilters#config",
        "text": "Config",
        "level": 4
      },
      {
        "id": "accessibility/configuration/viewfilters#visited-urls",
        "text": "Visited URLs",
        "level": 4
      },
      {
        "id": "accessibility/configuration/viewfilters#views-shown-in-ui",
        "text": "Views shown in UI",
        "level": 4
      }
    ]
  },
  "content": {
    "type": "root",
    "children": [
      {
        "type": "heading",
        "depth": 1,
        "children": [
          {
            "type": "text",
            "value": "viewFilters"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "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."
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Why use view filters?"
          }
        ]
      },
      {
        "type": "list",
        "ordered": false,
        "start": null,
        "spread": false,
        "children": [
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "Exclude Third-Party URLs: If your application integrates with third-party services, you might want to exclude their URLs from analysis."
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "Exclude Admin Pages: URLs that are not part of the user-facing application, such as admin pages, could be excluded from reports."
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "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."
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "Optimize Performance: Filtering out irrelevant URLs reduces the amount of data processed, speeding up analysis and improving report readability."
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Scope"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "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."
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Note on product-specific behavior"
          }
        ]
      },
      {
        "type": "list",
        "ordered": false,
        "start": null,
        "spread": false,
        "children": [
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "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."
                  }
                ]
              }
            ]
          },
          {
            "type": "listItem",
            "spread": false,
            "checked": null,
            "children": [
              {
                "type": "paragraph",
                "children": [
                  {
                    "type": "text",
                    "value": "In Cypress Accessibility, excluding a URL excludes all application snapshots from that URL from the reports, but has no other effects."
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Syntax"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "{  \"viewFilters\": [    {      \"pattern\": string,      \"include\": boolean,      \"comment\": string    }  ]}"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Options"
          }
        ]
      },
      {
        "type": "paragraph",
        "children": [
          {
            "type": "text",
            "value": "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."
          }
        ]
      },
      {
        "type": "table",
        "align": [
          null,
          null,
          null,
          null
        ],
        "children": [
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Option"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Required"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Default"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Description"
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`pattern`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Required"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": []
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "A string that matches URLs using "
                  },
                  {
                    "type": "link",
                    "title": null,
                    "url": "https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API",
                    "children": [
                      {
                        "type": "text",
                        "value": "URL Pattern API"
                      }
                    ]
                  },
                  {
                    "type": "text",
                    "value": " syntax."
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`include`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Optional"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`true`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "A boolean that determines whether matching URLs should be included in the report."
                  }
                ]
              }
            ]
          },
          {
            "type": "tableRow",
            "children": [
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "`comment`"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "Optional"
                  }
                ]
              },
              {
                "type": "tableCell",
                "children": []
              },
              {
                "type": "tableCell",
                "children": [
                  {
                    "type": "text",
                    "value": "A comment describing the purpose of this filter rule."
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "type": "heading",
        "depth": 2,
        "children": [
          {
            "type": "text",
            "value": "Examples"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Excluding URLs by hostname"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Config"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "{  \"viewFilters\": [    {      \"pattern\": \"https://app.okta.com/*\",      \"include\": false    }  ]}"
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Visited URLs"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "https://app.okta.com/loginhttps://cypress.io/homehttps://cypress.io/about"
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Views shown in UI"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "https://cypress.io/homehttps://cypress.io/about"
      },
      {
        "type": "thematicBreak"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Including only specific URLs"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Config"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "{  \"viewFilters\": [    {      \"pattern\": \"https://cypress.io/dashboards*\",      \"include\": true    },    {      \"pattern\": \"*\",      \"include\": false    }  ]}"
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Visited URLs"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "https://cypress.io/dashboardshttps://cypress.io/dashboards/1https://cypress.io/dashboards/2https://cypress.io/homehttps://cypress.io/login"
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Views shown in UI"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "https://cypress.io/dashboardshttps://cypress.io/dashboards/*"
      },
      {
        "type": "heading",
        "depth": 3,
        "children": [
          {
            "type": "text",
            "value": "Excluding error pages"
          }
        ]
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Config"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "{  \"viewFilters\": [    {      \"pattern\": \"http*://*/404\",      \"include\": false    },    {      \"pattern\": \"http*://*/error/*\",      \"include\": false    }  ]}"
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Visited URLs"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "https://cypress.io/homehttps://cypress.io/404https://cypress.io/error/500"
      },
      {
        "type": "heading",
        "depth": 4,
        "children": [
          {
            "type": "text",
            "value": "Views shown in UI"
          }
        ]
      },
      {
        "type": "code",
        "lang": null,
        "meta": null,
        "value": "https://cypress.io/home"
      }
    ]
  },
  "token_estimate": 639
}