Filter Syntax
The rule format Ghostery and uBlock 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
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 GitHubGet Ghostery. It's free.
Block trackers and ads in any browser. Open source. No account required.