Retrieve AEM pages created or updated within a date range

This article explains how to query Adobe Experience Manager (AEM) for pages that were created or updated within a specific date range using the QueryBuilder API.

Description description

Environment

Adobe Experience Manager (all versions supporting QueryBuilder API)

Issue

A need to list all pages created or modified between two dates, including relevant metadata, for analysis or recovery.

Cause

AEM doesn’t provide a built-in report for pages created or updated within arbitrary date ranges.

Resolution resolution

To retrieve AEM pages created or updated within a specific date range, follow these steps:

  1. Prepare your QueryBuilder API request to search for pages within the desired date range. Use your AEM author instance’s base URL and update the path to your specific content location. For example:

    code language-none
    [ AEM_AUTHOR_URL] /bin/querybuilder.json?type=cq:Page&path=/content/YOUR_SITE&daterange.property=jcr:content/cq:lastModified&daterange.lowerBound=YYYY-MM-DDT00:00:00.000Z&daterange.upperBound=YYYY-MM-DDT23:59:59.999Z&orderby=@jcr:content/cq:lastModified&orderby.sort=desc&p.limit=-1&p.hits=selective&p.properties=jcr:path%20jcr:content/jcr:title%20jcr:created%20jcr:createdBy%20jcr:content/cq:lastModified%20jcr:content/cq:lastModifiedBy
    
  • Replace [ AEM_AUTHOR_URL] with your author instance URL.
  • Replace /content/YOUR_SITE with the relevant content path.
  • Set the lowerBound and upperBound to your desired date range in ISO 8601 format.
  1. Adjust the path parameter to target only the relevant section of your content tree. Avoid running the query against the entire /content hierarchy to prevent performance issues.
  2. Test the query in a lower (non-production) environment first to ensure it returns the expected results and does not impact system performance.
  3. Once validated, run the query in your production environment if needed. Use caution, as large queries can affect performance.
  4. Review the JSON response, which will contain the requested page details. Export or process this data as required for your analysis.
  5. Verify that the results include the expected fields, such as page path, title, creation date, last modified date, and author information.
recommendation-more-help
experience-cloud-kcs-help-kbarticles