---
title: "countPages"
canonical: "https://support.appfire.com/space/PSCONF/15305126/countPages"
format: markdown
---
> Macro (aura-html)

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | countPages(cqlQuery) | **Package** |  |
> | **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Returns the number of pages that matched the CQL search query.

Returns the number of pages that matched the CQL search query.

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | cqlQuery | String | Yes | Confluence Query Language (CQL) search string. |

## Return Type

**Number**

## Example

```javascript
string cql = "(type=page and Space=DEV) OR (creator=bobsmith and type=blogpost)";
number count = countPages(CQL);
print("Return " + count);
```

## See also

> Macro (contentbylabel)