How to bulk delete Confluence page history
Asked by Jason Spotswood:

I am looking for a way to easily bulk delete Confluence page history. We have automation in place which allows data on a wiki page to be autogenerated. Whenever when the data is updated many times, this can create a large amount of unwanted history. We would like to be able to delete the page history using automation from time to time.

I see that there is a copy space plugin ([](https://plugins.atlassian.com/plugins/com.atlassian.confluence.plugin.copyspace)<https://plugins.atlassian.com/plugins/com.atlassian.confluence.plugin.copyspace>) which provides this type of support, however I do not want to have to copy a space to delete the history in it. More over some of the history within the space I would want to keep.

I note that the REST API, has the ability to query the history information for a page, i.e. [/rest/api/content/{id}/history](https://docs.atlassian.com/atlassian-confluence/REST/latest/#d3e203). Could that be used to delete the history for a page? I would not appear as such since only GET is supported.


Answers:
author: Jason Spotswood
body: After using the Confluence Command Line Interface, we found that the following allowed us to remove page revisions:

```
./confluence.sh --user ${USER} --password ${PASSWORD} --action removePageVersions --space "${SPACE}" --title "${LINE}" --limit "${LIMIT}"
```

we also followed up with the following to clean up the space:

```
./confluence.sh --user ${USER} --password ${PASSWORD} --action removeTrash --space "${SPACE}"
```

comments: author: DebbieR
body: HI Davin or anyone,

I'm a beginner, can you please direct me to info to learn more ab out a CLI and how it works? Is there any training you'd recommend? Thank you,


author: DebbieR
body: Example, how specifically would I get [removePageVersions](https://bobswift.atlassian.net/wiki/display/CSOAP/Reference#Reference-removePageVersions) to work in Confluence using CLI If I installed it?

I am constantly deleting previous versions of a page one at a time which is most annoying!

Thanks


author: Kalas Richard
body: You can use this plug in to remove page versions easily :

<https://marketplace.atlassian.com/plugins/com.elitesoftsp.confluence.page.utility.plugins/server/pricing>

comments: author: Di Chen
body: How about confluence cloud?


author: Robert Klahn
body: Yes, how about Confluence Cloud?


author: Davin Studer
body: Check out the [Confluence Command Line Interface](https://bobswift.atlassian.net/wiki/display/CSOAP/Documentation#Documentation-removePageVersion). It has options for removing page versions.


author: Joachim Ooi
body: Which Confluence version are you running on? Go for Conf 5.0 if you haven't yet.

There is a feature on deleting a version of a page. All thanks to this - [](https://jira.atlassian.com/browse/CONF-996)<https://jira.atlassian.com/browse/CONF-996>.

comments: author: Jason Spotswood
body: We use Confluence 5.5. Yes I am aware that there is a feature to manually delete history one at a time. However, when a page has 59 history instances and there are many pages with the same amount of history, performing this activity manually is extremely time consuming and quite boring. Surely it can be automated in some way. I am aware that there is a feature request to be able to manage history (CONF-27701), however it is still open and has not been started. Are there any other options?


author: Stephen Kairys
body: Yes, bulk delete - w/o resorting to command line would be great. I'm painfully deleting 100+ versions now. ![sad](/html/@C495B4504065515364EB1894F812B34C/images/emoticons/sad.png "sad") Happy holidays! :smile:


Tags: history