In large Sitecore implementations, content changes happen constantly as editors update text, swap components, or upload new images. Tracking when a page was last modified, including updates to linked components and media assets, helps teams maintain content freshness and audit what’s new.
This tutorial explains how to build a Last Modified Report per Page using Sitecore PowerShell Extensions (SPE) and Sitecore APIs.
Why This Report Matters
Knowing when content was last updated helps:
- Identify outdated pages that need attention
- Support SEO freshness by validating last modification timestamps
- Audit recent publishing activity
- Align with content governance and QA workflows
However, Sitecore’s built-in __Updated field only tracks direct item edits. It doesn’t reflect updates from data sources or linked assets. That’s why this approach uses PowerShell reporting combined with logic to detect changes in related items.
Tools to Use in Sitecore
To create a complete modification report, you’ll use:
- Sitecore PowerShell Extensions (SPE) to query items and generate the report
- Sitecore API to read the
__Updatedand__Updated byfields - Link Database and field parsing to detect related component data sources and media items
SPE is the best tool for this task because it can access item relationships, read timestamps, and export data directly into a CSV or Excel file.
Step 1: Open Sitecore PowerShell ISE
- Log in to Sitecore
- Go to Desktop → Development Tools → PowerShell ISE
- Select the Master database
- Create a new script
Step 2: Add the PowerShell Script
Paste this script into the editor:
$rootPath = "master:/sitecore/content/Home"
$results = @()
Write-Host "Generating last modified report for pages..." -ForegroundColor Cyan
$pages = Get-ChildItem -Path $rootPath -Recurse | Where-Object { $_.TemplateName -ne "Folder" }
foreach ($page in $pages) {
$lastModified = [datetime]$page["__Updated"]
$lastModifiedBy = $page["__Updated by"]
# Check linked components (data sources)
$renderings = $page["__Final Renderings"]
if ($renderings) {
$xml = $renderings
$dsIds = $xml.LayoutDefinition.Devices.Device.Renderings.Rendering.datasource | Where-Object { $_ -ne "" }
foreach ($id in $dsIds) {
$dsItem = Get-Item -Path "master:" -ID $id -ErrorAction SilentlyContinue
if ($dsItem) {
$dsUpdated = [datetime]$dsItem["__Updated"]
if ($dsUpdated -gt $lastModified) {
$lastModified = $dsUpdated
$lastModifiedBy = $dsItem["__Updated by"]
}
# Check for linked media assets
foreach ($field in $dsItem.Fields) {
if ($field.Type -eq "Image" -or $field.Type -eq "File") {
$mediaId = $field.Value
if ($mediaId -and $mediaId.StartsWith("{")) {
$mediaItem = Get-Item -Path "master:" -ID $mediaId -ErrorAction SilentlyContinue
if ($mediaItem) {
$mediaUpdated = [datetime]$mediaItem["__Updated"]
if ($mediaUpdated -gt $lastModified) {
$lastModified = $mediaUpdated
$lastModifiedBy = $mediaItem["__Updated by"]
}
}
}
}
}
}
}
}
$results += [pscustomobject]@{
PagePath = $page.Paths.FullPath
PageName = $page.Name
LastModified = $lastModified
ModifiedBy = $lastModifiedBy
}
}
$results | Sort-Object LastModified -Descending | Export-Csv -Path "C:\SitecoreLastModifiedReport.csv" -NoTypeInformation
Write-Host "Report saved to C:\SitecoreLastModifiedReport.csv" -ForegroundColor Green
Step 3: What the Script Does
- Scans all pages under the specified root path
- Captures each page’s last updated timestamp and user
- Parses the
__Final Renderingsfield to find linked component data sources - Checks those data sources for newer modification timestamps
- Inspects image or file fields in components for updated media assets
- Writes results to a CSV file sorted by the most recent updates
Step 4: Review the Output
After running the script, open C:\SitecoreLastModifiedReport.csv. Each row includes:
| Page Path | Page Name | Last Modified | Modified By |
|---|---|---|---|
| /sitecore/content/Home | Home | 2025-11-10 | sitecore\editor1 |
| /sitecore/content/Home/News | News | 2025-11-08 | sitecore\admin |
This report provides a full audit trail of what pages were recently updated, whether directly or through component or media changes.
Step 5: Schedule or Automate the Report
You can make this report recurring by:
- Saving the script as a PowerShell Report Item in
/sitecore/system/Modules/PowerShell/Script Library/Reports - Using the Task Scheduler in Sitecore to run it nightly or weekly
- Sending the report to an email list for editors or managers
Best Practices
- Run the script on the Master database to capture real authoring activity
- Avoid running it on the entire
/sitecore/contenttree for performance reasons - Add filters for specific templates (for example, Page templates only)
- Include
__Revisiondata if you need version-level auditing
Conclusion
Using Sitecore PowerShell Extensions is the most efficient way to generate a Last Modified Report per Page. Unlike the basic __Updated field, this method accounts for component-level and asset updates, giving you a more accurate view of what’s truly changed.
This approach supports better governance, SEO content freshness, and transparency across editorial teams while being simple to implement.