Filter Syntax

The rule format Ghostery and uBlock Origin both speak

What it does

Ghostery's engine reads the same filter syntax used across the open ad-blocking ecosystem. Once you know it, your rules work in any compatible blocker.

Pattern Example What it blocks
||domain^ ||doubleclick.net^ All requests to that domain
domain##selector nytimes.com##.paywall An element on one site
##selector ##.popup-overlay An element on every site
##+js(name) ##+js(set-constant, abp, false) Inject a scriptlet
Compatible with: Ghostery uBlock Origin Adblock Plus
Four patterns cover the whole language. Write a rule once, it works in every compatible blocker.

How it works

Network filters start with || for domain matching, cosmetic filters use ## to separate domains from selectors, and scriptlets use ##+js(). The full reference lives in the Ghostery developer docs.

What you get

  • Write custom rules for sites filter lists don't cover yet
  • Compatible with uBlock Origin and Adblock Plus syntax
  • Share rules with other blockers' communities
  • Fine-tune blocking for specific sites or pages

Turn it on

Find it under: Privacy protection → Custom Filters.

Built on the Ghostery Adblocker engine

Ghostery's ad-blocking is powered by the open-source Ghostery Adblocker library — a fast, memory-efficient filter engine maintained in the open.

View Adblocker on GitHub

Get Ghostery. It's free.

Block ads and trackers in your browser. No account required. Open source and free.

Download Ghostery