Fixing Unexpected Content Inheritance from Sitecore Standard Values
Reverting inherited standard values in Sitecore without touching authored content.
Start typing to search...
When working with Sitecore, Standard Values provide a powerful way to define default content and presentation settings for templates. They help ensure consistency and improve the authoring experience by pre-populating fields with meaningful defaults. However, when standard values are introduced or modified after content has already been created, they can unintentionally surface across the site in items where authors never intended to set content.
This happens because Sitecore automatically inherits values from the Standard Values item only when a field hasn't been explicitly edited. As a result, any newly introduced standard value will appear in existing items with untouched fields—potentially leading to placeholder text, unexpected images, or broken component rendering in production.
We encountered this exact issue after introducing standard values for several components late in the development cycle. In this blog, we’ll explore why this happens and walk through a PowerShell-based approach to safely identify and revert inherited standard values—without affecting authored content.
Sitecore uses a fallback mechanism:
So, when we updated our template's Standard Values with placeholder content, Sitecore applied those defaults to every item where that field was still NULL.
To fix this issue, we took a developer-first approach. The idea was to:
We chose this approach to avoid accidentally wiping out any real content already entered by authors. By using Sitecore’s ContainsStandardValue property, we can safely identify which fields are merely inheriting default values from the Standard Values item — allowing us to clear only those fields without affecting any actual content that was explicitly set.
As in the screenshot below we can identify when the content is inherited from standard value or not
![Sitecore content editor showing a subheading field displaying “[standard value]” placeholder text.](https://cdn.getfishtank.com/img/000-fixing-unexpected-content-inheritance-from-sitecore-standard-values.png)
# Set to $true for dry run (report and package), $false to actually clear fields
$dryRun = $false
# Step 1: Package setup (only needed for dry run)
if ($dryRun) {
$packageName = "Package"
$packageVersion = "1.0"
$packageAuthor = "Anju Thomas"
Write-Host "Creating package metadata..."
$package = New-Package $packageName
$package.Sources.Clear()
$package.Metadata.Author = $packageAuthor
$package.Metadata.Version = $packageVersion
function Add-ItemToPackage($item) {
if (-not $item) { return }
$itemSource = $item | New-ItemSource -Name $item.Name
$package.Sources.Add($itemSource)
Write-Host "Added item to package: $($item.Paths.FullPath)"
}
}
# Step 2: Define paths to scan
$pathsToScan = @(
"master:rootpath"
# Add more paths as needed
)
# Step 3: Prepare report and collect items to package
$report = @()
$itemsToPackage = @{}
$fieldsToUpdate = @()
foreach ($path in $pathsToScan) {
$items = Get-ChildItem -Path $path -Recurse
}
foreach ($item in $items) {
$fieldNames = Get-ItemField -Path $item.Paths.FullPath
foreach ($fieldName in $fieldNames) {
$field = $item.Fields[$fieldName]
if ($field.ContainsStandardValue) {
# Add to report
$report += [PSCustomObject]@{
ItemID = $item.ID
ItemPath = $item.Paths.FullPath
FieldName = $field.Name
FieldType = $field.Type
Template = $item.TemplateName
Language = $item.Language.Name
Version = $item.Version.Number
TemplateId = $item.TemplateID
}
# Add item to package list (unique)
if ($dryRun) { $itemsToPackage[$item.ID] = $item }
# Add field to update list
$fieldsToUpdate += [PSCustomObject]@{
Item = $item
FieldName = $fieldName
}
}
}
}
}
# Step 4: Create a package if there are items (only for dry run)
if ($dryRun -and $itemsToPackage.Count -gt 0) {
foreach ($item in $itemsToPackage.Values) {
Add-ItemToPackage $item
}
# Save the package to disk (adjust path as needed)
$packageFileName = "$($package.Name)-$($package.Metadata.Version).zip"
$SitecorePackageFolder = Join-Path $SitecoreDataFolder "Packages"
if (-not (Test-Path $SitecorePackageFolder)) {
New-Item -Path $SitecorePackageFolder -ItemType Directory | Out-Null
}
$packageFullPath = Join-Path $SitecorePackageFolder $packageFileName
Export-Package -Project $package -Path $packageFullPath -Zip
Download-File $packageFullPath
Write-Host "Package created at $packageFullPath" -ForegroundColor Yellow
} elseif ($dryRun -and $itemsToPackage.Count -eq 0) {
Write-Host "No items found to package." -ForegroundColor Green
}
# Step 5: Clear inherited field values using BeginEdit/EndEdit (only if not dry run)
if (-not $dryRun) {
foreach ($entry in $fieldsToUpdate) {
$item = $entry.Item
$fieldName = $entry.FieldName
try {
$item.Editing.BeginEdit()
$item.Fields[$fieldName].Value = ""
$item.Editing.EndEdit()
Write-Host "Cleared field '$fieldName' for item $($item.Paths.FullPath)" -ForegroundColor Green
} catch {
# If an error occurs, cancel the edit to avoid locking the item
if ($item.Editing.IsEditing) { $item.Editing.CancelEdit() }
Write-Host "Failed to clear field '$fieldName' for item $($item.Paths.FullPath): $($_.Exception.Message)" -ForegroundColor Red
}
}
}
# Step 6: Output results to console
if ($report.Count -gt 0) {
Write-Host "Fields Inheriting from Standard Values:" -ForegroundColor Cyan
$report | Show-ListView -Title "Dry Run – Fields Inheriting from Standard Values" `
-Property ItemPath, FieldName, FieldType, ItemID, Template, TemplateID, Language, Version
} else {
Write-Host "Dry run complete. No items found with inherited standard values from matched templates." -ForegroundColor Green
}
This script scans specified Sitecore content paths to identify fields that are still inheriting values from Standard Values (i.e., untouched by content authors). When run in dry run mode, it generates a report and creates a Sitecore package containing affected items for review or backup. If dry run is disabled, it safely clears those inherited values using BeginEdit/EndEdit, ensuring only untouched fields are updated without affecting explicitly authored content. Finally, it displays a summary report of all fields that were found to be using standard values, helping ensure clean and intentional content across your site.
$name or $date within Standard Values can help automate dynamic defaults.Standard Values are essential for maintaining consistency and improving efficiency in Sitecore, but introducing or changing them late can cause unexpected content inheritance issues. By understanding how inheritance works and using the ContainsStandardValue property, you can safely fix these problems without affecting authored content. To avoid such challenges, it’s best to create and configure Standard Values early alongside your components, keep them clean and tested, and include them in your deployment process. This ensures smoother content management and a better overall experience for authors and users alike.