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

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | deleteComment(commentId_or_mode [,pageId]) | **Package** |  |
> | **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Deletes a comment with the specified id, deletes the latest comment or deletes all comments from a given page.

Deletes a comment with the specified id, deletes the latest comment or deletes all comments from a given page.

## Return Type

**Number**

The number of comments deleted.

## Examples

### Example 1

```javascript
number pageId = 123456;
CComment[] comments = getComments(pageId);
for (CComment comment in comments) {
    deleteComment(comment.id);
}
```

### Example 2

```javascript
deleteComment("DELETE_ALL", 11801);
```

## See also

> Macro (contentbylabel)