Skip to content

Archive stale pages

Move pages nobody has touched in years out of search and page trees — but keep them restorable. archive sends pages to the Confluence native archive (not the trash).

  • Your site needs Confluence Standard or above. On Free, Shell stops and suggests a same-space move instead (find … | mv ./Archive).
  • Shell archives one page at a time (Confluence runs one archive job per site). Expect about a few seconds per page — up to a few minutes for 100.
  • At most 100 pages per run.
$ cd YourSpace
$ find . -mtime +730 -prune
$ find . -mtime +730 -prune --format csv

-mtime +730 = not updated for about two years. -prune keeps the top-most match in each subtree. Save the CSV if you want a record of what you archived.

$ find . -mtime +730 -prune | archive -n
$ find . -mtime +730 -prune | archive -y

Or archive named pages:

$ archive -n ./Old-runbook ./Retro-2023
$ archive -y ./Old-runbook ./Retro-2023

Press Esc or Ctrl+C to stop. A page already submitted may still finish on the server.

Label first, review, then archive what is still stale:

$ find . -mtime +730 -prune | label add archive-candidate -y
$ find -label archive-candidate | archive -n
  • Archived pages are restored in Confluence; Shell has no unarchive.
  • Whether child pages are archived with their parent is decided by Confluence — check the result there.
  • Spaces and folders can’t be archived.
  • Prefer the trash? Use rm (find … | rm -n). Prefer to keep pages visible? Use mv into an Archive page in the same space — see Find pages not updated recently.