Is there a way to bulk delete comments in Confluence?

We've been spammed with hundreds of nonsense comments. Does anyone know a way to remove them in bulk?

2 answers

1 vote

Hi Robert,

You may be able to delete the comments from confluence using a delete command in the database, however as far as I know there's no bundled functionality to do this. I could find this feature request, but wasn't implemented yet: https://jira.atlassian.com/browse/CONF-5023

I suggest to try to remove the comments from a page using this Delete SQL command:

delete from content where contenttype = 'COMMENT' and pageid = <page_id>;

Always backup the database before running any SQL alteration or removal command.

Find the page ID above from the page of confluence you want to remove the comments from just by editing the page and looking into the URL. It should have a pageid there.

Cheers,

Rodrigo

1 vote

Hello,

You could use the Power Scripts for Confluence add-on:

https://marketplace.atlassian.com/apps/1219507/power-scripts-for-confluence?hosting=server&tab=overview

I've found Power Scripts for Confluence really handy for Confluence admins who want to automate their work and apply bulk actions to Confluence. And it is a free add-on:

You could get all comments for a page and then delete them. Your script would look like this:

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

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

58 views 3 2
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you