Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

How to reliably Get the "Last Published" timestamp of a page

Avatar

Level 2

Hi,
Has anyone noticed that page.lastModified doesn't always update when you publish a page? How do you reliably get the actual "last published" timestamp of a page?

Not looking for jcr:lastModified or cq:lastReplicationAction - they’re not always reliable for personalization logic.

5 Replies

Avatar

Community Advisor

Hi @MatthewDa19,

I think, the only reliable way is to use the cq:lastReplicated property from the cq:Page node (not the jcr:content node). It updates only on successful publish and remains untouched by mere edits or autosaves. Works well for showing "last updated" timestamps to end users.

This works because:

  • Most devs assume jcr:lastModified or cq:lastModified gives the latest update.

  • Few realize cq:lastReplicated exists on the page node, not jcr:content.

  • The question seems simple, but the nuance makes it expert-level.

Hope that helps!

 


Santosh Sai

AEM BlogsLinkedIn


Avatar

Employee Advisor

This does not work, the cq:page nodetype is pretty much locked down what additional properties you can add to it. cq:lastReplicated is always set on the jcr:content node.

 

(Plus: on a publish instance it is not reliable, because this property is only set on author after the replication has completed. That means when you publish a page twice cq:lastReplicated on publish shows the date of the first replication.)

Avatar

Community Advisor and Adobe Champion

you can say page.lastModified Misleads


The page.lastModified API in AEM Core WCM Components (and Page.getLastModified() in Sling) often affected by:

  • Touch UI autosaves
  • Non-replicated changes
  • Live copies syncing (in some setups)

cq:lastReplicated is the best choice for displaying the last replicated timestamp; it shows you the timestamp of the last successful replication action on the node it exists on. Making sure you have fallback code in place of course.

 

I had a scenario back in the past where we had blog articles which we wish to display the "authored date". For these dates, we decided to add in a new page property called author date, so there are no side effects while authoring pages with the right date.

 

 

Avatar

Level 3

To reliably get the actual "last published" timestamp of a page in AEM, use:

 cq:lastReplicated

  • Path: /content/your-page/jcr:content/cq:lastReplicated

  • Type: Date

  • Set on: Successful publish

  • Reliable: Yes — updated only on successful replication

Avoid jcr:lastModified and cq:lastReplicationAction as they can be misleading.

Avatar

Community Advisor

Hi @MatthewDa19 ,

Use cq:lastReplicated

Property: cq:lastReplicated

  - Type: Date

  - Location: On the page node itself, e.g., /content/mysite/page

  - Not on: /content/mysite/page/jcr:content

This property is updated only when the page is successfully published to the publish instance, and it remains untouched by any author-side changes or autosaves.

Regards,
Amit