Custom filtering rules in AdGuard Home get interesting once a blocklist and an allowlist disagree, or when a rule should only hit one device. Two modifiers sort that out.
$important raises a rule above every rule without it, even above basic exception rules. The AdGuard docs give this pair:
||example.org^$important
@@||example.org^
The domain stays blocked, because the important rule beats the plain exception. If you want the exception to win, give it the modifier too: @@||example.org^$important.
$client limits a rule to certain clients: an IP address, a CIDR range or a client name. For example, block a game site for the kids’ tablets only:
||game.example^$client=192.168.1.0/24
||ads.example^$client=~192.168.1.20
The tilde excludes a client, so the second rule blocks for everyone except that one address. Names only work for persistent clients you added in AdGuard Home, so I’d use IP addresses unless the device has a fixed entry there.
Caveats. $client only works in AdGuard Home and AdGuard DNS, not in browser ad blockers that read the same lists. The docs say a rule with a modifier AdGuard does not know is ignored completely, so a typo fails silently. And these modifiers do not work on /etc/hosts-style lines. So I’d add one rule at a time and look at the query log to see whether it does what I meant.
Further reading: AdGuard DNS filtering rules syntax
Going deeper: Guide: AdGuard Home with Unbound: resolve DNS yourself instead of asking Cloudflare or your ISP