# != (not equals) in CQL: syntax and examples

URL: https://goingstellar.ro/reference/cql/not-equals-operator/

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

- `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 != SD
```

Shows what lives outside your main space, such as personal-space pages and attachments. Run on Confluence Cloud on 2026-11-29.

```
ancestor = 32964613 AND title != "Code of Conduct"
```

Lists the whole handbook tree except one page you already know about. Run on Confluence Cloud on 2026-11-29.

```
space = SD AND type != attachment AND type != comment
```

Keeps real content and drops attachments and comments, so a space audit counts pages and the like only. Run on Confluence Cloud on 2026-11-29.

```
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 2026-11-29.

```
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 2026-11-29.

```
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 2026-11-29.

## Pitfalls

- != also matches content that has no value at all. `label != "meeting-notes"` returns every page without that label, including pages with no labels, and `mention != currentUser()` includes pages with no mentions.
- The docs say a negative expression cannot be the first clause. In practice `space != SD` and `creator != 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 use `title !~ "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.

## Related

- [=](https://goingstellar.ro/reference/cql/equals-operator/)
- [NOT](https://goingstellar.ro/reference/cql/not-keyword/)
- [NOT IN](https://goingstellar.ro/reference/cql/not-in-operator/)
- [!~](https://goingstellar.ro/reference/cql/does-not-contain-operator/)
- [currentUser()](https://goingstellar.ro/reference/cql/currentuser/)
- [space](https://goingstellar.ro/reference/cql/space-field/)

## Sources

- [CQL operators (Atlassian Developer, Confluence Cloud)](https://developer.atlassian.com/cloud/confluence/cql-operators/)

