# label in CQL (Confluence): syntax and examples

URL: https://goingstellar.ro/reference/cql/label-field/

The label field matches content that carries a given label. Use it to pull a tagged set of pages, such as everything labelled for review, or to exclude labelled pages from a list. It takes exact label names, not patterns.

## Syntax

```
label = value
label in (value1, value2)
label not in (value1, value2)
```

## Arguments

- `value`: A label name. Wrap it in double quotes when it contains a hyphen, a space or other punctuation.

## Works with

- Operators: =, !=, IN, NOT IN
- Functions: none
- Not with: ~, !~, >, >=, <, <=

## Examples

```
label = "meeting-notes"
```

Collects every page tagged as meeting notes. The label has a hyphen, so it is quoted. Run on Confluence Cloud on 2026-11-29.

```
label in ("draft", "review") AND type = page AND space = SD
```

Shows pages that are still in draft or waiting for review in one space. Run on Confluence Cloud on 2026-11-29.

```
label not in (draft, review)
```

Keeps only content that carries neither label, a quick list of finished work. Run on Confluence Cloud on 2026-11-29.

```
label != "draft" AND type = page AND space = SD
```

Lists the pages of a space that are not marked as draft. Run on Confluence Cloud on 2026-11-29.

```
label in (draft) AND lastmodified < now("-4w")
```

Finds drafts nobody has touched for four weeks, good candidates for a reminder. Run on Confluence Cloud on 2026-11-29.

## Pitfalls

- A hyphen needs quotes. `label = meeting-notes` fails with "Could not parse cql", `label = "meeting-notes"` runs. Plain words such as `draft` work with or without quotes, and a quoted value gives the same query as the unquoted one.
- `label ~ "draft"` fails with "Operator '~' is not supported for field 'label'". To match several labels list them: `label in (draft, review)`. To match a label prefix, search the text field instead.
- A query cannot start with NOT. `not label = draft` and `NOT label in (draft)` fail with "Could not parse cql"; `type = page AND NOT label = draft` runs. Writing `label != draft` avoids the problem.
- There is no IS EMPTY test: `label is empty` fails with "Could not parse cql". A prefixed form such as `label = global:finished` fails the same way. Whether label case is ignored is not covered by the docs, so match the case you see in the page.

## Related

- [text](https://goingstellar.ro/reference/cql/text-field/)
- [IN](https://goingstellar.ro/reference/cql/in-operator/)
- [NOT IN](https://goingstellar.ro/reference/cql/not-in-operator/)
- [!=](https://goingstellar.ro/reference/cql/not-equals-operator/)
- [space](https://goingstellar.ro/reference/cql/space-field/)
- [lastmodified](https://goingstellar.ro/reference/cql/lastmodified-field/)

## Sources

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

