squirrelscan
GitHub

Adblock cosmetic filters: classes that get hidden

A block named .ad-container is hidden for anyone running an ad blocker, whatever is in it. squirrel matches your selectors against EasyList.

What a cosmetic filter is

EasyList is the filter list most ad blockers use. Alongside network rules that stop requests, it carries cosmetic rules: CSS selectors the blocker hides. Some are global and some apply only on named domains, and they match ids, attributes and selector structure as well as classes.

That is the trap. A blocker cannot read your intent, only your markup, so a legitimate block called .banner or a #sponsors section thanking supporters can be hidden from a large share of visitors.

What squirrel checks

The rule is site-wide and reads a result the cloud blocklist service produced before the rules ran, matching the site’s selectors against the full EasyList cosmetic rules server-side. It emits a single check named adblock-elements:

  • Skipped when no result is available. Message: Adblock element-hiding check skipped, with a readable skip reason.
  • Pass when nothing matched. Message: No elements match common adblock filters.
  • Warn otherwise. Message: 4 selector(s) on the site match adblock element-hiding rules, listing up to maxMatchesToReport of them. Severity warning, weight 3.

The three blocking rules share one blocklist check per audit, so enabling them all costs the same as enabling one.

How to fix it

<section class="partner-list">…</section>

Rename whatever the filter matched, and check the result against a blocker rather than assuming. A name like partner-list carries the same meaning to you, but the fix is that the new markup stops matching the applicable rules, which can key on an id or an attribute as easily as a class.

Where the element really is an advert, the finding is accurate and the choice is yours. What is worth fixing is the case where a blocker hides content you meant everyone to see.

Rule IDadblock/element-hiding
CategoryBlocking → Ad blocking
ScopeSite-wide
Severitywarning
Weight3/10

Options

OptionTypeDefaultDescription
maxMatchesToReportnumber10Maximum matching selectors to report in detail

Configuration example

[rule_options."adblock/element-hiding"]
maxMatchesToReport = 25

Enable / disable

Disable this rule

[rules]
disable = ["adblock/element-hiding"]

Disable all blocking rules

[rules]
disable = ["adblock/*"]

Enable only this rule

[rules]
enable = ["adblock/element-hiding"]

enable replaces the default ["*"], so this is the only rule selected. Leave disable out: a rule that matches any disable pattern is skipped even when enable names it. Only an enabled setting under a rule’s own [rule_options] table overrides both lists.

Blocking findings ship in every audit next to the SEO, performance and agent experience rules. See Fix SEO issues with AI for how an agent works through a report.

References

Check your site

Run squirrel audit https://example.com and open the Blocking section of the report. Each matching selector is listed, up to the configured maximum. Signed-out local audits need no account and cost nothing. Signed-in audits spend credits.

Type to search…

↑↓ navigate↵ openesc close