Deleting Confluence pages automatically after a certain period of time?

Hi everyone,

I am wondering if there is any way to delete Confluence pages automatically after a certain period of time?

I have found this plugin, but this is slightly different what I expect.

https://plugins.atlassian.com/plugin/details/123

Thanks

tito

2 answers

You are on the right track! You can actually do this by combining the Archiving Plugin with CLI.

It requires two steps, but it is dead simple:

  1. Set up the Archiving Plugin to archive the pages that should be deleted. Please note that this will move the pages to spaces whose name ends with "(Archive)". Configure the Confluence managed archiving job to run at 01:00AM, for instance.
  2. Set up CLI to delete all spaces whose name ends with "(Archive)"! Configure a cron job to run it at 05:00AM, for instance. (It leaves 4 hours for archiving to complete, which is more than enough even for very large Confluence instances.)

Voila! You have clean content each morning by 05:10AM!

You didn't explain what you expected and why the plugin didn't do what you wanted, so it is hard to say what you are looking for. Specifically, what criteria determines whether a page should be removed? You can use Confluence Command Line Interface to script logic to make determine what needs to be removed and use removePage. Optionally, you can save the page source to a file or copy it to some other space or Confluence instance before you remove it. If you can construct a select statement against your Confluence database for pages that need to be archived, then it is easier to use the runFromSql action to do the archiving and removals.

Hi Bob,

Thank you so much for your advice. Yeah, I also notice my question was not clear enough to ask. Sorry for that.

Anyway, I think Confluence Command Line Interface is the good place to start. Let me play with this first, then.

Again, thank you so much for your prompt assistanse. I appreciate it a lot.

tito

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Monday in Confluence

Calling all marketing teams who use Confluence - we want to hear from you!

Hi Community! me again 🙂 If you’re a marketing team using Confluence, we want to hear your story! How did you start using Confluence? What are your use cases? What have been some of the benefits?...

208 views 3 3
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