Going Stellar

Home/CQL reference

CQL field

type in CQL (Confluence): syntax and examples

The type field limits a search to one kind of content. Without it a query returns pages, comments, attachments and even spaces mixed together, which makes counts and lists hard to read. Put it near the start of almost every query.

Syntax

type = page
type in (page, blogpost)
type != comment

Arguments

ArgumentWhat it does
valueOne of the content types the server accepts: page, blogpost, comment, attachment, whiteboard, database, embed, folder and a few more (see the pitfalls for the full list). Lowercase only.

Works with

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

Examples

type = page AND title ~ "runbook"

Finds runbook pages without pulling in comments or files that mention the word.

Run on Confluence Cloud on .

type IN (blogpost, page)

Covers both pages and blog posts when a team uses blogs for announcements.

Run on Confluence Cloud on .

type = attachment AND space = SD ORDER BY created DESC

Lists the newest uploaded files in a space, for a storage or asset review.

Run on Confluence Cloud on .

type in (page, comment) AND space = SD

Searches pages and their comments together, for example to see where a topic was discussed.

Run on Confluence Cloud on .

type not in (attachment, comment, space)

Leaves out everything that is not a regular page, a quick way to count real documents.

Run on Confluence Cloud on .

Pitfalls

  • Values are case sensitive and checked against a fixed list. type = Page fails with: Unsupported value for type, got : Page, expected one of : [space, user, page, blogpost, comment, attachment, database, whiteboard, slide, embed, folder, com.atlassian.confluence.extra.team-calendars:calendar-content-type, com.atlassian.confluence.extra.team-calendars:space-calendars-view-content-type]. That list is what the server accepts today (checked on Confluence Cloud, November 2026).
  • The documentation lists eight types (page, blogpost, comment, attachment, whiteboard, database, embed, folder). The error message also names space, user and slide. type = space works and returns space objects. type = user is accepted but gave page results in a check, so use the user search endpoint with the user field instead.
  • type ~ "page" fails with "Operator '~' is not supported for field 'type'". Typos such as type = pages fail with the same value list.
  • Unrelated type values still run when nothing of that type exists. type = blogpost is a valid query on a site without blog posts and simply returns nothing.

Questions and answers

Why do my results include comments and attachments?

Because no type was set. Add type = page to get pages only.

Sources

  1. CQL fields (Atlassian Developer, Confluence Cloud)

Markdown version · All CQL pages