How to Find Pages with most Historic Versions in Confluence

Still need help?

The Atlassian Community is here for you.

Ask the community

Affected Versions:

This documentation was tested using Confluence 6.2.1 but it is supposed to work on all versions.


As described in the Page History and Page Comparison Documentation, Confluence tracks the history of changes to each page by creating a new version of the page each time it's modified, allowing users to view the changes between different versions, and roll back to a previous version upon need. The historic entries are actually pages that remain stored in the database and sometimes, Confluence instances may have several historic pages saved in the backend, which may not be in use and that are not automatically purged. That being said, it's interesting to know which pages are holding the larger number of historic pages behind it in order to perform a manual clean-up activity.


You can run below query in your database to get a list of the TOP 25 Pages with more Historic Version behind them. The idea is to pretty much pick up pages from content table with the biggest count inside the version column. This query was tested with PostgreSQL only and syntax may vary according to your database.

select title,MAX(version) from content where contenttype = 'PAGE' group by title order by 2 desc limit 25;

After you get the page Title, you may search for it and use UI to Delete Page History.

Last modified on Nov 2, 2018

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.