It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Is there a way to bulk delete comments in Confluence?

Robert Kennedy Oct 29, 2014

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

3 answers

1 vote
Rodrigo Adami Atlassian Team Oct 29, 2014

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
Alexey Matveev [cPrime] Community Leader Oct 15, 2018

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);
} 
0 votes
Priyanka Lavania Apr 16, 2019

Hi Robert,

If you have script runner plugin then you can use built in scripts to bulk delete comments from one or more pages, you can also specify comment age or delete all. Hope this helps.

See this for more details: - https://scriptrunner.adaptavist.com/5.0.5/confluence/builtin-scripts.html

Regards,

Priyanka Lavania

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Confluence

6 Awesome Ways to Apply Trello, JIRA and Confluence to your Project

I attended  Atlassian Summit 2019  and learned a lot from the presenters, attendees and knowledgeable Atlassian product managers. The presentations I attended focused on applying Agile, pla...

2,415 views 11 28
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you