CQL operator
!= (not equals) in CQL: syntax and examples
The != operator removes content whose field equals a value and keeps everything else. It is the shorter form of NOT field = value. Use it to leave out one space, one page, one type or one label.
Syntax
field != value
NOT field = value
Arguments
| Argument | What it does |
|---|---|
field | Any CQL field except Text and User. |
value | The value to exclude: a word, number, quoted string, date or function such as currentUser(). |
Works with
- Fields: every field in the field reference except Text and User (ancestor, content, created, creator, contributor, favourite, fileExtension, id, label, lastModified, macro, mention, owner, pageStatus, parent, space, subtype, title, type, watcher)
- Functions: currentUser() on user fields, now() and the startOf/endOf date functions on date fields
- Not with: Text (use !~ instead)
Examples
space != SDShows what lives outside your main space, such as personal-space pages and attachments.
Run on Confluence Cloud on .
ancestor = 32964613 AND title != "Code of Conduct"Lists the whole handbook tree except one page you already know about.
Run on Confluence Cloud on .
space = SD AND type != attachment AND type != commentKeeps real content and drops attachments and comments, so a space audit counts pages and the like only.
Run on Confluence Cloud on .
creator = currentUser() AND mention != currentUser()Finds content you created that does not mention you. This is the docs example and it runs as written.
Run on Confluence Cloud on .
type = page AND space = SD AND label != "meeting-notes"Pages that still need a label check, because they do not carry the meeting-notes label.
Run on Confluence Cloud on .
created != "2026-11-16"Everything not created on one specific day, for example when that day was a bulk import.
Run on Confluence Cloud on .
Pitfalls
- != also matches content that has no value at all.
label != "meeting-notes"returns every page without that label, including pages with no labels, andmention != currentUser()includes pages with no mentions. - The docs say a negative expression cannot be the first clause. In practice
space != SDandcreator != currentUser()both run as the first and only clause (checked on Confluence Cloud, November 2026). - != is exact, so
title != "Company"excludes nothing: no page has exactly that title. To drop a partial match usetitle !~ "Company". - If one account created all the content,
creator != currentUser()matches nothing. Test a not-equals filter on someone else's content before you trust an empty list.