diff --git a/docs/general/ad-filtering/create-own-filters.md b/docs/general/ad-filtering/create-own-filters.md index 1ead84171ab..bf10ef43ac5 100644 --- a/docs/general/ad-filtering/create-own-filters.md +++ b/docs/general/ad-filtering/create-own-filters.md @@ -4399,16 +4399,29 @@ This rule removes all `div` elements with the attribute `some_attribute` on `exa ### Special attributes {#html-filtering-rules--special-attributes} -In addition to usual attributes, which value is every element checked for, there is a set of special attributes that change the way a rule works. Below there is a list of these attributes: +In addition to checking standard HTML attributes, you can filter elements based on their inner text or script content. -#### `tag-content` +#### `:contains()` + +The recommended way to filter elements by their content is using the `:contains()` pseudo-class. It allows you to target elements based on the actual text or script variables they contain, supporting both plain text strings and regular expressions. + +**Examples:** + +```example.com$$script:contains(Adverts) +example.com$$div:contains("Sponsored by") +example.com$$script:contains(/ad_system_\d+/) +``` + +The first rule removes any `