{
  "doc": {
    "id": "accessibility/configuration/elementfilters",
    "title": "elementFilters: ignore elements in Cypress Accessibility",
    "description": "Ignore elements in Cypress Accessibility reports with elementFilters, so third-party widgets and out-of-scope elements stop counting against your accessibility score.",
    "section": "accessibility",
    "source_path": "/llm/markdown/accessibility/configuration/elementfilters.md",
    "version": "fbc9225067c51c52ee13224e3b702cf8a025ec12",
    "updated_at": "2026-08-14T12:36:26.878Z",
    "headings": [
      {
        "id": "accessibility/configuration/elementfilters#exclude-elements-elementfilters",
        "text": "Exclude elements - elementFilters",
        "level": 1
      },
      {
        "id": "accessibility/configuration/elementfilters#why-use-elementfilters",
        "text": "Why use elementFilters?",
        "level": 2
      },
      {
        "id": "accessibility/configuration/elementfilters#scope",
        "text": "Scope",
        "level": 2
      },
      {
        "id": "accessibility/configuration/elementfilters#setting-elementfilters",
        "text": "Setting elementFilters",
        "level": 2
      },
      {
        "id": "accessibility/configuration/elementfilters#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "accessibility/configuration/elementfilters#options",
        "text": "Options",
        "level": 3
      },
      {
        "id": "accessibility/configuration/elementfilters#how-are-elementfilters-rules-applied",
        "text": "How are elementFilters rules applied?",
        "level": 3
      },
      {
        "id": "accessibility/configuration/elementfilters#validation-rules",
        "text": "Validation rules",
        "level": 3
      },
      {
        "id": "accessibility/configuration/elementfilters#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "accessibility/configuration/elementfilters#ignore-a-third-party-widget",
        "text": "Ignore a third-party widget",
        "level": 3
      },
      {
        "id": "accessibility/configuration/elementfilters#config",
        "text": "Config",
        "level": 4
      },
      {
        "id": "accessibility/configuration/elementfilters#html",
        "text": "HTML",
        "level": 4
      },
      {
        "id": "accessibility/configuration/elementfilters#result",
        "text": "Result",
        "level": 4
      },
      {
        "id": "accessibility/configuration/elementfilters#ignore-elements-by-attribute",
        "text": "Ignore elements by attribute",
        "level": 3
      },
      {
        "id": "accessibility/configuration/elementfilters#config",
        "text": "Config",
        "level": 4
      },
      {
        "id": "accessibility/configuration/elementfilters#html",
        "text": "HTML",
        "level": 4
      },
      {
        "id": "accessibility/configuration/elementfilters#result",
        "text": "Result",
        "level": 4
      },
      {
        "id": "accessibility/configuration/elementfilters#ignore-dynamic-elements-by-pattern",
        "text": "Ignore dynamic elements by pattern",
        "level": 3
      },
      {
        "id": "accessibility/configuration/elementfilters#config",
        "text": "Config",
        "level": 4
      },
      {
        "id": "accessibility/configuration/elementfilters#html",
        "text": "HTML",
        "level": 4
      },
      {
        "id": "accessibility/configuration/elementfilters#result",
        "text": "Result",
        "level": 4
      },
      {
        "id": "accessibility/configuration/elementfilters#ignore-elements-inside-a-shadow-dom-or-iframe",
        "text": "Ignore elements inside a shadow DOM or iframe",
        "level": 3
      },
      {
        "id": "accessibility/configuration/elementfilters#config",
        "text": "Config",
        "level": 4
      },
      {
        "id": "accessibility/configuration/elementfilters#html",
        "text": "HTML",
        "level": 4
      },
      {
        "id": "accessibility/configuration/elementfilters#result",
        "text": "Result",
        "level": 4
      },
      {
        "id": "accessibility/configuration/elementfilters#when-to-use-include-true",
        "text": "When to use include: true",
        "level": 3
      },
      {
        "id": "accessibility/configuration/elementfilters#config",
        "text": "Config",
        "level": 4
      },
      {
        "id": "accessibility/configuration/elementfilters#html",
        "text": "HTML",
        "level": 4
      },
      {
        "id": "accessibility/configuration/elementfilters#result",
        "text": "Result",
        "level": 4
      },
      {
        "id": "accessibility/configuration/elementfilters#see-also",
        "text": "See also",
        "level": 2
      }
    ]
  },
  "chunks": [
    {
      "id": "accessibility/configuration/elementfilters#why-use-elementfilters",
      "doc_id": "accessibility/configuration/elementfilters",
      "heading": "Why use elementFilters?",
      "heading_level": 2,
      "content_markdown": "## Why use elementFilters?\n\n*   **Ignore third-party components**: Chat widgets, cookie banners, embedded media players, and other elements rendered by libraries or services you don't control can be ignored, since your team can't fix their violations.\n*   **Ignore out-of-scope elements**: Remove test-only controls or areas of the application that are outside the scope of your accessibility work.\n*   **Keep the score meaningful**: A score that only reflects elements you can fix makes progress and regressions easier to see and act on.\n\nIgnoring an element ignores all accessibility results for that element. To keep an element in your report but ignore specific rules for it, use the [`data-a11y-ignore` attribute](/llm/markdown/accessibility/configuration/ignoring-rules-per-element.md) instead. To ignore entire pages, use [`viewFilters`](/llm/markdown/accessibility/configuration/viewfilters.md).\n",
      "section": "accessibility",
      "anchors": [
        "why-use-elementfilters"
      ],
      "path": "/llm/json/chunked/accessibility/configuration/elementfilters.json",
      "token_estimate": 153
    },
    {
      "id": "accessibility/configuration/elementfilters#scope",
      "doc_id": "accessibility/configuration/elementfilters",
      "heading": "Scope",
      "heading_level": 2,
      "content_markdown": "## Scope\n\n**Note:** setting `elementFilters` at the root of your configuration impacts both Cypress Accessibility and UI Coverage reports. To configure the products separately, nest the property under an `accessibility` or `uiCoverage` key. A nested `elementFilters` completely replaces a root-level one for that product; the two lists are not merged.\n",
      "section": "accessibility",
      "anchors": [
        "scope"
      ],
      "path": "/llm/json/chunked/accessibility/configuration/elementfilters.json",
      "token_estimate": 67
    },
    {
      "id": "accessibility/configuration/elementfilters#setting-elementfilters",
      "doc_id": "accessibility/configuration/elementfilters",
      "heading": "Setting elementFilters",
      "heading_level": 2,
      "content_markdown": "## Setting elementFilters\n\nTo add or edit `elementFilters`, open the **App Quality** tab in your project settings in Cypress Cloud. See [Setting configuration](/llm/markdown/accessibility/configuration/overview.md#Setting-Configuration) for details, including how to regenerate past reports with a new configuration without rerunning your tests.\n",
      "section": "accessibility",
      "anchors": [
        "setting-elementfilters"
      ],
      "path": "/llm/json/chunked/accessibility/configuration/elementfilters.json",
      "token_estimate": 52
    },
    {
      "id": "accessibility/configuration/elementfilters#syntax",
      "doc_id": "accessibility/configuration/elementfilters",
      "heading": "Syntax",
      "heading_level": 2,
      "content_markdown": "## Syntax\n\nApp Quality Config\n\n```\n{  \"elementFilters\": [    {      \"selector\": string,      \"include\": boolean,      \"documentScope\": [string],      \"comment\": string    }  ]}\n```\n\nTo apply rules to Cypress Accessibility only, nest the property under the `accessibility` key:\n\nApp Quality Config\n\n```\n{  \"accessibility\": {    \"elementFilters\": [      {        \"selector\": string,        \"include\": boolean      }    ]  }}\n```\n\n### Options\n\n| Option | Required | Default | Description |\n| --- | --- | --- | --- |\n| `selector` | Required |  | A CSS selector that matches the elements to ignore. Supports standard CSS selector syntax, including IDs, classes, attributes, combinators, and functional pseudo-classes like `:has()`. The selector must match the element with the accessibility result itself, not just a container around it. |\n| `include` | Required |  | Whether elements matched by this rule appear as normal results in the report. Use `false` to ignore the matched elements. In Cypress Accessibility, `true` has no additional effect, because every element is included unless an exclude rule matches it. See [When to use include: true](#When-to-use-include-true). |\n| `documentScope` | Optional |  | An ordered array of CSS selectors that match document hosts (iframes or shadow DOM hosts) in the element's ancestor chain, from outermost to innermost. Use this to limit a rule to elements inside a specific iframe or shadow DOM. Hosts that aren't listed may appear between the ones that are. |\n| `comment` | Optional |  | A note about why this rule exists, for your team's benefit. Comments appear only in the configuration itself. They have no effect on filtering and are not displayed in reports. |\n\n### How are elementFilters rules applied?\n\n*   **Any matching exclude rule ignores the element.** An element is ignored when any rule with `include: false` matches it, regardless of where the rule appears in the list. Elements that no exclude rule matches stay in the report as normal results.\n*   **An `include: true` rule cannot protect or restore an element.** An include rule doesn't shield its elements from exclude rules elsewhere in the list.\n*   **The selector must match the element itself.** Accessibility results are reported per element, and each rule is evaluated against those elements using standard CSS matching. A rule with the selector `footer` ignores results on the `<footer>` element only, not on the elements inside it. To ignore a whole region, match the container and its descendants: `footer, footer *`.\n*   **Ignored elements stay visible in the report.** Elements with failed or incomplete checks that your configuration ignores appear under the **Ignored** [element status](/llm/markdown/accessibility/guides/run-level-reports.md#Elements) rather than disappearing, so the report always shows what your configuration is hiding. They don't count as failed or incomplete elements, and they don't affect the accessibility score.\n*   **The score changes once every failing element of a rule is ignored.** The [accessibility score](/llm/markdown/accessibility/core-concepts/accessibility-score.md) weighs each failed rule per snapshot, not each failing element. Ignoring some, but not all, of a rule's failing elements in a snapshot doesn't change that snapshot's score; the rule stops counting against the snapshot when all of its failing elements there are ignored.\n*   **Ignoring an element ignores all of its results.** An `elementFilters` rule applies to every accessibility rule for the matched element. To ignore only specific rules for an element, use the [`data-a11y-ignore` attribute](/llm/markdown/accessibility/configuration/ignoring-rules-per-element.md) in your application code.\n*   **Rules match in any document unless scoped.** A rule without `documentScope` can match elements in the main document, in iframes, and in shadow DOMs. Add `documentScope` to restrict a rule to one of those documents.\n\nIf a rule doesn't seem to take effect, see [Why is an element still failing after I added an elementFilters rule?](/llm/markdown/accessibility/faq.md#Why-is-an-element-still-failing-after-I-added-an-elementFilters-rule) in the Cypress Accessibility FAQ.\n\n### Validation rules\n\nCypress Cloud rejects a configuration when:\n\n*   Two rules have the same `selector` (with the same `documentScope`).\n*   A rule is missing `selector` or `include`.\n*   A `selector` or `documentScope` entry isn't valid CSS selector syntax.\n*   A rule contains a property other than the four listed above.\n",
      "section": "accessibility",
      "anchors": [
        "syntax"
      ],
      "path": "/llm/json/chunked/accessibility/configuration/elementfilters.json",
      "token_estimate": 881
    },
    {
      "id": "accessibility/configuration/elementfilters#options",
      "doc_id": "accessibility/configuration/elementfilters",
      "heading": "Options",
      "heading_level": 3,
      "content_markdown": "### Options\n\n| Option | Required | Default | Description |\n| --- | --- | --- | --- |\n| `selector` | Required |  | A CSS selector that matches the elements to ignore. Supports standard CSS selector syntax, including IDs, classes, attributes, combinators, and functional pseudo-classes like `:has()`. The selector must match the element with the accessibility result itself, not just a container around it. |\n| `include` | Required |  | Whether elements matched by this rule appear as normal results in the report. Use `false` to ignore the matched elements. In Cypress Accessibility, `true` has no additional effect, because every element is included unless an exclude rule matches it. See [When to use include: true](#When-to-use-include-true). |\n| `documentScope` | Optional |  | An ordered array of CSS selectors that match document hosts (iframes or shadow DOM hosts) in the element's ancestor chain, from outermost to innermost. Use this to limit a rule to elements inside a specific iframe or shadow DOM. Hosts that aren't listed may appear between the ones that are. |\n| `comment` | Optional |  | A note about why this rule exists, for your team's benefit. Comments appear only in the configuration itself. They have no effect on filtering and are not displayed in reports. |\n",
      "section": "accessibility",
      "anchors": [
        "options"
      ],
      "path": "/llm/json/chunked/accessibility/configuration/elementfilters.json",
      "token_estimate": 285
    },
    {
      "id": "accessibility/configuration/elementfilters#how-are-elementfilters-rules-applied",
      "doc_id": "accessibility/configuration/elementfilters",
      "heading": "How are elementFilters rules applied?",
      "heading_level": 3,
      "content_markdown": "### How are elementFilters rules applied?\n\n*   **Any matching exclude rule ignores the element.** An element is ignored when any rule with `include: false` matches it, regardless of where the rule appears in the list. Elements that no exclude rule matches stay in the report as normal results.\n*   **An `include: true` rule cannot protect or restore an element.** An include rule doesn't shield its elements from exclude rules elsewhere in the list.\n*   **The selector must match the element itself.** Accessibility results are reported per element, and each rule is evaluated against those elements using standard CSS matching. A rule with the selector `footer` ignores results on the `<footer>` element only, not on the elements inside it. To ignore a whole region, match the container and its descendants: `footer, footer *`.\n*   **Ignored elements stay visible in the report.** Elements with failed or incomplete checks that your configuration ignores appear under the **Ignored** [element status](/llm/markdown/accessibility/guides/run-level-reports.md#Elements) rather than disappearing, so the report always shows what your configuration is hiding. They don't count as failed or incomplete elements, and they don't affect the accessibility score.\n*   **The score changes once every failing element of a rule is ignored.** The [accessibility score](/llm/markdown/accessibility/core-concepts/accessibility-score.md) weighs each failed rule per snapshot, not each failing element. Ignoring some, but not all, of a rule's failing elements in a snapshot doesn't change that snapshot's score; the rule stops counting against the snapshot when all of its failing elements there are ignored.\n*   **Ignoring an element ignores all of its results.** An `elementFilters` rule applies to every accessibility rule for the matched element. To ignore only specific rules for an element, use the [`data-a11y-ignore` attribute](/llm/markdown/accessibility/configuration/ignoring-rules-per-element.md) in your application code.\n*   **Rules match in any document unless scoped.** A rule without `documentScope` can match elements in the main document, in iframes, and in shadow DOMs. Add `documentScope` to restrict a rule to one of those documents.\n\nIf a rule doesn't seem to take effect, see [Why is an element still failing after I added an elementFilters rule?](/llm/markdown/accessibility/faq.md#Why-is-an-element-still-failing-after-I-added-an-elementFilters-rule) in the Cypress Accessibility FAQ.\n",
      "section": "accessibility",
      "anchors": [
        "how-are-elementfilters-rules-applied"
      ],
      "path": "/llm/json/chunked/accessibility/configuration/elementfilters.json",
      "token_estimate": 457
    },
    {
      "id": "accessibility/configuration/elementfilters#validation-rules",
      "doc_id": "accessibility/configuration/elementfilters",
      "heading": "Validation rules",
      "heading_level": 3,
      "content_markdown": "### Validation rules\n\nCypress Cloud rejects a configuration when:\n\n*   Two rules have the same `selector` (with the same `documentScope`).\n*   A rule is missing `selector` or `include`.\n*   A `selector` or `documentScope` entry isn't valid CSS selector syntax.\n*   A rule contains a property other than the four listed above.\n",
      "section": "accessibility",
      "anchors": [
        "validation-rules"
      ],
      "path": "/llm/json/chunked/accessibility/configuration/elementfilters.json",
      "token_estimate": 68
    },
    {
      "id": "accessibility/configuration/elementfilters#examples",
      "doc_id": "accessibility/configuration/elementfilters",
      "heading": "Examples",
      "heading_level": 2,
      "content_markdown": "## Examples\n\n### Ignore a third-party widget\n\nThe selector matches both the widget's container and everything inside it, so results on the container itself are ignored along with results on its contents.\n\n#### Config\n\nApp Quality Config\n\n```\n{  \"elementFilters\": [    {      \"selector\": \"#chat-widget, #chat-widget *\",      \"include\": false,      \"comment\": \"Vendor chat widget, accessibility issues reported upstream\"    }  ]}\n```\n\n#### HTML\n\n```\n<body>  <main>    <button id=\"checkout\">Check out</button>  </main>  <div id=\"chat-widget\">    <button class=\"chat-open\">Chat with us</button>  </div></body>\n```\n\n#### Result\n\nViolations on `#checkout` are reported as failures. Violations on the chat widget and its contents appear under the **Ignored** status and don't affect the score.\n\n* * *\n\n### Ignore elements by attribute\n\n#### Config\n\nApp Quality Config\n\n```\n{  \"elementFilters\": [    {      \"selector\": \"[data-vendor]\",      \"include\": false    }  ]}\n```\n\n#### HTML\n\n```\n<body>  <button id=\"save\">Save</button>  <button data-vendor=\"analytics\">Feedback</button></body>\n```\n\n#### Result\n\nViolations on `#save` are reported as failures. Violations on the `data-vendor` button appear under the **Ignored** status.\n\n* * *\n\n### Ignore dynamic elements by pattern\n\nAttribute prefix, suffix, and substring selectors (`[class^='...']`, `[class$='...']`, `[class*='...']`) are useful when class names or IDs are partially generated.\n\n#### Config\n\nApp Quality Config\n\n```\n{  \"elementFilters\": [    {      \"selector\": \"[class^='ext-embed']\",      \"include\": false    }  ]}\n```\n\n#### HTML\n\n```\n<body>  <button class=\"cancel\">Cancel</button>  <div class=\"ext-embed-90283\" role=\"button\">External content</div></body>\n```\n\n#### Result\n\nViolations on `.cancel` are reported as failures. Violations on the embed appear under the **Ignored** status.\n\n* * *\n\n### Ignore elements inside a shadow DOM or iframe\n\nUse `documentScope` to limit a rule to elements inside a specific shadow DOM host or iframe. Here, the button inside the `<custom-component>` shadow root shares its `id` with a button in the main document. The scope restricts the rule to the shadow DOM, so results on the button in the main document are still reported.\n\n#### Config\n\nApp Quality Config\n\n```\n{  \"elementFilters\": [    {      \"selector\": \"#my-button\",      \"include\": false,      \"documentScope\": [\"custom-component\"]    }  ]}\n```\n\n#### HTML\n\n```\n<body>  <button id=\"my-button\">Button Outside Shadow DOM</button>  <custom-component>    #shadow-dom      <button id=\"my-button\">Button Inside Shadow DOM</button>  </custom-component></body>\n```\n\n#### Result\n\nViolations on the button in the main document are reported as failures. Violations on the button inside the shadow DOM appear under the **Ignored** status.\n\n`documentScope` works the same way for content that renders inside an iframe. The scope selector matches the `iframe` element itself in its parent document, and a wildcard selector ignores everything the iframe contains:\n\nApp Quality Config\n\n```\n{  \"elementFilters\": [    {      \"selector\": \"*\",      \"include\": false,      \"documentScope\": [\"iframe[title='Support']\"]    }  ]}\n```\n\nFor nested documents, list one selector per host from outermost to innermost. For example, `\"documentScope\": [\"#my-iframe\", \"custom-component\"]` scopes a rule to a shadow DOM component rendered inside an iframe.\n\n* * *\n\n### When to use include: true\n\nFor rules that only affect Cypress Accessibility, there's no reason to write `include: true`. Every element is included unless an exclude rule matches it, and an include rule can't override an exclusion.\n\nThe value exists for `elementFilters` lists defined at the root of your configuration, which are shared with UI Coverage. In UI Coverage, the first matching rule wins, so an `include: true` rule placed before a broader exclude rule keeps its elements in UI Coverage reports. Cypress Accessibility reads the same list but treats the include rule as inert.\n\n#### Config\n\nApp Quality Config\n\n```\n{  \"elementFilters\": [    {      \"selector\": \"nav a\",      \"include\": true,      \"comment\": \"Keep nav links in UI Coverage despite the vendor exclude below\"    },    {      \"selector\": \"[data-vendor] a\",      \"include\": false,      \"comment\": \"Ignore links rendered by the vendor toolbar\"    }  ]}\n```\n\n#### HTML\n\n```\n<body>  <nav data-vendor=\"toolbar\">    <a href=\"/home\">Home</a>  </nav>  <div data-vendor=\"promos\">    <a href=\"https://vendor.example\">Sponsored</a>  </div></body>\n```\n\n#### Result\n\nThe Home link matches both rules. In Cypress Accessibility, the exclude rule ignores it anyway, so results on both links appear under the **Ignored** status. In UI Coverage, the first matching rule wins, so the Home link stays in the report while the sponsored link is excluded.\n\nTo get different outcomes per product, nest a separate `elementFilters` list under each product key instead of sharing one root-level list.\n\nAfter saving configuration changes, regenerate a recent run to preview the effect of your rules without rerunning your tests. See [Setting configuration](/llm/markdown/accessibility/configuration/overview.md#Setting-Configuration) for how to regenerate a report.\n",
      "section": "accessibility",
      "anchors": [
        "examples"
      ],
      "path": "/llm/json/chunked/accessibility/configuration/elementfilters.json",
      "token_estimate": 929
    },
    {
      "id": "accessibility/configuration/elementfilters#ignore-a-third-party-widget",
      "doc_id": "accessibility/configuration/elementfilters",
      "heading": "Ignore a third-party widget",
      "heading_level": 3,
      "content_markdown": "### Ignore a third-party widget\n\nThe selector matches both the widget's container and everything inside it, so results on the container itself are ignored along with results on its contents.\n\n#### Config\n\nApp Quality Config\n\n```\n{  \"elementFilters\": [    {      \"selector\": \"#chat-widget, #chat-widget *\",      \"include\": false,      \"comment\": \"Vendor chat widget, accessibility issues reported upstream\"    }  ]}\n```\n\n#### HTML\n\n```\n<body>  <main>    <button id=\"checkout\">Check out</button>  </main>  <div id=\"chat-widget\">    <button class=\"chat-open\">Chat with us</button>  </div></body>\n```\n\n#### Result\n\nViolations on `#checkout` are reported as failures. Violations on the chat widget and its contents appear under the **Ignored** status and don't affect the score.\n\n* * *\n",
      "section": "accessibility",
      "anchors": [
        "ignore-a-third-party-widget"
      ],
      "path": "/llm/json/chunked/accessibility/configuration/elementfilters.json",
      "token_estimate": 139
    },
    {
      "id": "accessibility/configuration/elementfilters#result",
      "doc_id": "accessibility/configuration/elementfilters",
      "heading": "Result",
      "heading_level": 4,
      "content_markdown": "#### Result\n\nViolations on `#checkout` are reported as failures. Violations on the chat widget and its contents appear under the **Ignored** status and don't affect the score.\n\n* * *\n",
      "section": "accessibility",
      "anchors": [
        "result"
      ],
      "path": "/llm/json/chunked/accessibility/configuration/elementfilters.json",
      "token_estimate": 40
    },
    {
      "id": "accessibility/configuration/elementfilters#ignore-elements-by-attribute",
      "doc_id": "accessibility/configuration/elementfilters",
      "heading": "Ignore elements by attribute",
      "heading_level": 3,
      "content_markdown": "### Ignore elements by attribute\n\n#### Config\n\nApp Quality Config\n\n```\n{  \"elementFilters\": [    {      \"selector\": \"[data-vendor]\",      \"include\": false    }  ]}\n```\n\n#### HTML\n\n```\n<body>  <button id=\"save\">Save</button>  <button data-vendor=\"analytics\">Feedback</button></body>\n```\n\n#### Result\n\nViolations on `#save` are reported as failures. Violations on the `data-vendor` button appear under the **Ignored** status.\n\n* * *\n",
      "section": "accessibility",
      "anchors": [
        "ignore-elements-by-attribute"
      ],
      "path": "/llm/json/chunked/accessibility/configuration/elementfilters.json",
      "token_estimate": 71
    },
    {
      "id": "accessibility/configuration/elementfilters#ignore-dynamic-elements-by-pattern",
      "doc_id": "accessibility/configuration/elementfilters",
      "heading": "Ignore dynamic elements by pattern",
      "heading_level": 3,
      "content_markdown": "### Ignore dynamic elements by pattern\n\nAttribute prefix, suffix, and substring selectors (`[class^='...']`, `[class$='...']`, `[class*='...']`) are useful when class names or IDs are partially generated.\n\n#### Config\n\nApp Quality Config\n\n```\n{  \"elementFilters\": [    {      \"selector\": \"[class^='ext-embed']\",      \"include\": false    }  ]}\n```\n\n#### HTML\n\n```\n<body>  <button class=\"cancel\">Cancel</button>  <div class=\"ext-embed-90283\" role=\"button\">External content</div></body>\n```\n\n#### Result\n\nViolations on `.cancel` are reported as failures. Violations on the embed appear under the **Ignored** status.\n\n* * *\n",
      "section": "accessibility",
      "anchors": [
        "ignore-dynamic-elements-by-pattern"
      ],
      "path": "/llm/json/chunked/accessibility/configuration/elementfilters.json",
      "token_estimate": 99
    },
    {
      "id": "accessibility/configuration/elementfilters#ignore-elements-inside-a-shadow-dom-or-iframe",
      "doc_id": "accessibility/configuration/elementfilters",
      "heading": "Ignore elements inside a shadow DOM or iframe",
      "heading_level": 3,
      "content_markdown": "### Ignore elements inside a shadow DOM or iframe\n\nUse `documentScope` to limit a rule to elements inside a specific shadow DOM host or iframe. Here, the button inside the `<custom-component>` shadow root shares its `id` with a button in the main document. The scope restricts the rule to the shadow DOM, so results on the button in the main document are still reported.\n\n#### Config\n\nApp Quality Config\n\n```\n{  \"elementFilters\": [    {      \"selector\": \"#my-button\",      \"include\": false,      \"documentScope\": [\"custom-component\"]    }  ]}\n```\n\n#### HTML\n\n```\n<body>  <button id=\"my-button\">Button Outside Shadow DOM</button>  <custom-component>    #shadow-dom      <button id=\"my-button\">Button Inside Shadow DOM</button>  </custom-component></body>\n```\n\n#### Result\n\nViolations on the button in the main document are reported as failures. Violations on the button inside the shadow DOM appear under the **Ignored** status.\n\n`documentScope` works the same way for content that renders inside an iframe. The scope selector matches the `iframe` element itself in its parent document, and a wildcard selector ignores everything the iframe contains:\n\nApp Quality Config\n\n```\n{  \"elementFilters\": [    {      \"selector\": \"*\",      \"include\": false,      \"documentScope\": [\"iframe[title='Support']\"]    }  ]}\n```\n\nFor nested documents, list one selector per host from outermost to innermost. For example, `\"documentScope\": [\"#my-iframe\", \"custom-component\"]` scopes a rule to a shadow DOM component rendered inside an iframe.\n\n* * *\n",
      "section": "accessibility",
      "anchors": [
        "ignore-elements-inside-a-shadow-dom-or-iframe"
      ],
      "path": "/llm/json/chunked/accessibility/configuration/elementfilters.json",
      "token_estimate": 280
    },
    {
      "id": "accessibility/configuration/elementfilters#result",
      "doc_id": "accessibility/configuration/elementfilters",
      "heading": "Result",
      "heading_level": 4,
      "content_markdown": "#### Result\n\nViolations on the button in the main document are reported as failures. Violations on the button inside the shadow DOM appear under the **Ignored** status.\n\n`documentScope` works the same way for content that renders inside an iframe. The scope selector matches the `iframe` element itself in its parent document, and a wildcard selector ignores everything the iframe contains:\n\nApp Quality Config\n\n```\n{  \"elementFilters\": [    {      \"selector\": \"*\",      \"include\": false,      \"documentScope\": [\"iframe[title='Support']\"]    }  ]}\n```\n\nFor nested documents, list one selector per host from outermost to innermost. For example, `\"documentScope\": [\"#my-iframe\", \"custom-component\"]` scopes a rule to a shadow DOM component rendered inside an iframe.\n\n* * *\n",
      "section": "accessibility",
      "anchors": [
        "result"
      ],
      "path": "/llm/json/chunked/accessibility/configuration/elementfilters.json",
      "token_estimate": 145
    },
    {
      "id": "accessibility/configuration/elementfilters#when-to-use-include-true",
      "doc_id": "accessibility/configuration/elementfilters",
      "heading": "When to use include: true",
      "heading_level": 3,
      "content_markdown": "### When to use include: true\n\nFor rules that only affect Cypress Accessibility, there's no reason to write `include: true`. Every element is included unless an exclude rule matches it, and an include rule can't override an exclusion.\n\nThe value exists for `elementFilters` lists defined at the root of your configuration, which are shared with UI Coverage. In UI Coverage, the first matching rule wins, so an `include: true` rule placed before a broader exclude rule keeps its elements in UI Coverage reports. Cypress Accessibility reads the same list but treats the include rule as inert.\n\n#### Config\n\nApp Quality Config\n\n```\n{  \"elementFilters\": [    {      \"selector\": \"nav a\",      \"include\": true,      \"comment\": \"Keep nav links in UI Coverage despite the vendor exclude below\"    },    {      \"selector\": \"[data-vendor] a\",      \"include\": false,      \"comment\": \"Ignore links rendered by the vendor toolbar\"    }  ]}\n```\n\n#### HTML\n\n```\n<body>  <nav data-vendor=\"toolbar\">    <a href=\"/home\">Home</a>  </nav>  <div data-vendor=\"promos\">    <a href=\"https://vendor.example\">Sponsored</a>  </div></body>\n```\n\n#### Result\n\nThe Home link matches both rules. In Cypress Accessibility, the exclude rule ignores it anyway, so results on both links appear under the **Ignored** status. In UI Coverage, the first matching rule wins, so the Home link stays in the report while the sponsored link is excluded.\n\nTo get different outcomes per product, nest a separate `elementFilters` list under each product key instead of sharing one root-level list.\n\nAfter saving configuration changes, regenerate a recent run to preview the effect of your rules without rerunning your tests. See [Setting configuration](/llm/markdown/accessibility/configuration/overview.md#Setting-Configuration) for how to regenerate a report.\n",
      "section": "accessibility",
      "anchors": [
        "when-to-use-include-true"
      ],
      "path": "/llm/json/chunked/accessibility/configuration/elementfilters.json",
      "token_estimate": 339
    },
    {
      "id": "accessibility/configuration/elementfilters#config",
      "doc_id": "accessibility/configuration/elementfilters",
      "heading": "Config",
      "heading_level": 4,
      "content_markdown": "#### Config\n\nApp Quality Config\n\n```\n{  \"elementFilters\": [    {      \"selector\": \"nav a\",      \"include\": true,      \"comment\": \"Keep nav links in UI Coverage despite the vendor exclude below\"    },    {      \"selector\": \"[data-vendor] a\",      \"include\": false,      \"comment\": \"Ignore links rendered by the vendor toolbar\"    }  ]}\n```\n",
      "section": "accessibility",
      "anchors": [
        "config"
      ],
      "path": "/llm/json/chunked/accessibility/configuration/elementfilters.json",
      "token_estimate": 60
    },
    {
      "id": "accessibility/configuration/elementfilters#result",
      "doc_id": "accessibility/configuration/elementfilters",
      "heading": "Result",
      "heading_level": 4,
      "content_markdown": "#### Result\n\nThe Home link matches both rules. In Cypress Accessibility, the exclude rule ignores it anyway, so results on both links appear under the **Ignored** status. In UI Coverage, the first matching rule wins, so the Home link stays in the report while the sponsored link is excluded.\n\nTo get different outcomes per product, nest a separate `elementFilters` list under each product key instead of sharing one root-level list.\n\nAfter saving configuration changes, regenerate a recent run to preview the effect of your rules without rerunning your tests. See [Setting configuration](/llm/markdown/accessibility/configuration/overview.md#Setting-Configuration) for how to regenerate a report.\n",
      "section": "accessibility",
      "anchors": [
        "result"
      ],
      "path": "/llm/json/chunked/accessibility/configuration/elementfilters.json",
      "token_estimate": 131
    },
    {
      "id": "accessibility/configuration/elementfilters#see-also",
      "doc_id": "accessibility/configuration/elementfilters",
      "heading": "See also",
      "heading_level": 2,
      "content_markdown": "## See also\n\n*   [`data-a11y-ignore`](/llm/markdown/accessibility/configuration/ignoring-rules-per-element.md): ignore specific rules for an element instead of the whole element.\n*   [`viewFilters`](/llm/markdown/accessibility/configuration/viewfilters.md): ignore entire pages.\n*   [Run-level reports](/llm/markdown/accessibility/guides/run-level-reports.md): where ignored elements appear in your report.\n*   [Accessibility score](/llm/markdown/accessibility/core-concepts/accessibility-score.md): how the score is calculated.\n*   [Configuration overview](/llm/markdown/accessibility/configuration/overview.md): where to set configuration and regenerate reports.\n*   [Cypress Accessibility FAQ](/llm/markdown/accessibility/faq.md): common questions and troubleshooting.\n",
      "section": "accessibility",
      "anchors": [
        "see-also"
      ],
      "path": "/llm/json/chunked/accessibility/configuration/elementfilters.json",
      "token_estimate": 76
    }
  ]
}