Finding when Pages were Last Updated in a Set of Child Pages

I'm in the process of archiving pages in a space and am running a date search to find pages that were created between certain dates. For example:

  • modified:[20130101 TO 20130731]

What I would also like to do is run a similar search on a page and all its child pages to find which was the most recently edited.

Is this possible?

In an ideal world, I'd like to be able to find out when each child page was last edited.

At the moment the only way I can see of doing either of these things is by looking manually, which is far too inefficient and tedious given the 1000s of pages I have to check.


3 answers

For 1,000s of pages, I would definitely look into using the SQL plug-in:

Thanks Matthew,

Yes, I wasn't clear there was I? :) I mean that in the space there's 1000s of pages, but using my modified search, I'll find a page within a group of related child pages.

Often the head page won't have been edited since it was created, but the others might have been.

So I'm not looking through 1000s in one go, I'm looking at a group that might be ten or twenty strong.


Ok, in that case I would write a User Macro because it sounds like you're going to want to show the your info on many pages (maybe "parent nodes" of small groups of sub pages)?

Lessee, maybe an "illustration" would make this clearer:

In this image, the second "row" (Topics 1, 2, and 3) is where you want to put your macro. Is this about right?


Yes, that's right. All I want to do is ID the last edited page so I can go straight to it to see who edited it.

The info doesn't need storing or displaying to anyone else. It's all mine... :)

Sorry to keep belaboring the point, but figuring out exactly what you want to do determines the best way to do it. (By best, I mean most performant and easiest...)

If I understand you correctly, you want to ID the last edited page within each "child group" (the Topics 1-3 in the image)? Is that correct?

Are these known pages (do you know the page names or IDs of the pages?), or do you need to sniff them out as well?

Sorry if I'm not being clear, thanks for sticking with me. :)

"If I understand you correctly, you want to ID the last edited page within each "child group" (the Topics 1-3 in the image)? Is that correct?"

Yes, that's right.

They are known to me because they, the pages, come up in the results from my date search.

Sorry, now I'm the one being unclear: are the parent pages known to you? In other words, Topic 1 is a parent page with 10 child pages. You want to find the most recently edited page of the children of Topic 1, correct? How many "Topic 1s" are there? And do you have a list of them somewhere?

Yes, but only because I find the child page, then see what the parent is called.

I then check that to see when it was last updated. It's a very manual process. :)


Ok, maybe you can try this user macro (put it on all your pages, in a Layout Decorator). You can hide it by wrapping an IF statement around it that checks against a user type (like admin), your username, or some other comparison.

## Macro title: Recently Updated Children
## Developed by: Matthew J. Horn
## Date created: 01/16/2014
## Installed by: ______
## Description: Lists all children and their timestamps. Similar to "Recently Updated" macro, except it only applies to child pages of the current page. It's a combination of "Recently Updated" and "Children Display".

## @noparams

#set ($pageListArray = [])
#set ($rootPage = $content)

#macro ( process $rp )
## note: Not sure what diff is between getChildren() and getSortedChildren()  -- "sort" is not by timestamp
  #set ($pagelist = $rp.getSortedChildren() )  ## returns List<Page>
  #foreach( $child in $pagelist )
    #set($p = $pageListArray.add( $child ) )
    #if( $child.hasChildren() )
      #process ( $child )

#process ( $rootPage )

<table class="confluenceTable">
  <th class="confluenceTh">Title</th>
  <th class="confluenceTh">Version</th>
  <th class="confluenceTh">Mod Date</th>
  <th class="confluenceTh">Modifier</th>

 #foreach( $child in $pageListArray)   ## child is of type Page
     <td class="confluenceTd">$child.getTitle()</td>
     <td class="confluenceTd">$child.getVersion()</td>
     <td class="confluenceTd">$child.getLastModificationDate()</td>     
     <td class="confluenceTd">$child.getLastModifierName()</td>


Let me know if this does what you want. It sounds like you want to integrate this with a date range search, but I haven't quite gotten my head around how to do that yet.


And a quick note, this does not include sorting in the macro. But tables in Confluence can be sorted on any column with a mouse click, as of Confluence 4.3.something...


Thanks for all your efforts on this. I've given this to our IT team but we've been having some issues recently (Confluence and non-Confluence) that has meant we still haven't tried it. I'll let you know what happens when we do.


You should automatically generate this report with the Archiving Plugin.

This plugin displays a so-called Content Quality report which will calculate and list the pages not updated in the recent N days. The age of the page is calculated recursively (propagating upwards), this is what you originally asked for, if I'm not mistaken. See a sample report below.

Even better, the plugin will also help you to archive the pages that are not updated and/or not viewed.

And it features a fully automated "set it up and forget it" approach, which scales nicely to thousands of pages.


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?...

200 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