CQL field
macro field in CQL: syntax and examples (Confluence)
The macro field matches content whose body contains at least one instance of the named macro. Use it to audit where a macro is used before you change or retire it, or to find pages that still use an old report or include macro.
Syntax
macro = macro-name
macro IN (macro-name, macro-name)
Arguments
| Argument | What it does | Optional |
|---|---|---|
macro-name | The macro's name as Confluence stores it, for example panel, expand or details. Names that contain a hyphen must be quoted. | yes |
Works with
- Operators: =, !=, IN, NOT IN (as documented).
- Not with: ~, !~, >, >=, <, <=. The documentation lists no supported functions.
Examples
macro = panel AND space = SDFind the pages in one space that use the Panel macro, for example before you restyle your callouts.
Run on Confluence Cloud on .
macro in (toc, widget)The documentation's example: pages that have a Table of Contents or a Widget Connector macro in the body.
Run on Confluence Cloud on .
macro = jiraFind content that embeds Jira issues with the Jira issue macro. A space where nobody uses it gives an empty list, which is also a useful answer.
Run on Confluence Cloud on .
macro in ("page-properties", details) AND space = SDPages that carry a properties table, checking both names that the macro may be stored under. The quotes are needed for the hyphen.
Run on Confluence Cloud on .
macro = expand AND lastmodified < now("-4w")Pages with an Expand section that nobody has touched for four weeks, a short list to review for stale hidden content.
Run on Confluence Cloud on .
macro != toc AND space = SD AND type = pagePages in a space that have no table of contents, so you can decide where one is missing.
Run on Confluence Cloud on .
Pitfalls
- A macro name with a hyphen needs quotes.
macro = recently-updatedfails with "Could not parse cql", whilemacro = "recently-updated"runs and finds the page that uses it (checked on Confluence Cloud, November 2026). - The name is case sensitive.
macro = panelfinds pages,macro = PANELandmacro = Panelrun without an error and match nothing (checked on Confluence Cloud, November 2026). - A name that does not exist is not an error.
macro = cheesesimply returns an empty list, so a typo looks the same as "nobody uses it". Test a name you are sure of first. macro ~ tocis rejected with "Operator '~' is not supported for field 'macro'". Use=orINwith the exact name.