CQL operator
!~ (DOES NOT CONTAIN) operator in CQL for Confluence
The !~ operator is the negative of ~. It keeps content where the text field does not match the words you give. Use it to filter out templates, drafts or a topic from a result you already narrowed with other clauses.
Syntax
field !~ word
field !~ "word*"
Arguments
| Argument | What it does | Optional |
|---|---|---|
field | A text field, usually title or text. | yes |
value | A word, a word with a trailing wildcard (*), or an escaped-quote phrase. | yes |
Works with
- Operators: !~ is for text fields: title and text. It also runs on space, where it works on the space name.
- Functions: none.
- Not with: id, date and fixed-value fields such as created, type and label. Use != or NOT IN there.
Examples
title !~ "run*" and type = page and space = SDLists the pages of a space that are not runbooks, whatever the runbook title looks like.
Run on Confluence Cloud on .
text !~ "template" and type = page and space = SDDrops pages whose body talks about templates from a content review.
Run on Confluence Cloud on .
type = page and space = SD and title !~ "template*"Hides the template pages when you audit a space.
Run on Confluence Cloud on .
title !~ "runbook" and type = page and ancestor = 32964613Shows the pages under the handbook that are not runbooks.
Run on Confluence Cloud on .
text !~ "\"design notes\"" and space = SD and type = pageExcludes pages that contain one exact phrase.
Run on Confluence Cloud on .
Pitfalls
- The documentation example
space = DEV and title !~ runexcludes nothing you would expect. A bare word matches whole words only, sotitle ~ runfinds no "Runbook" and!~ runkeeps it. Use!~ "run*"(checked on Confluence Cloud, November 2026). - !~ is a filter on one side only. Alone it matches almost everything, so it needs a positive clause such as a space or a type next to it.
- The documentation says !~ does not work on
space.space !~ "Software"runs and filters on the space name (checked on Confluence Cloud, November 2026). - A phrase needs escaped quotes, as with ~. The exact text-search rules are on the text search syntax page.