Fixing Unexpected Content Inheritance from Sitecore Standard Values

Reverting inherited standard values in Sitecore without touching authored content.

June 24, 2025

By Anju Thomas

Understanding Field Inheritance When Updating Standard Values

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.

The Rules Behind Sitecore's Standard Value Inheritance

Sitecore uses a fallback mechanism:

  • If a field is NULL (i.e., untouched), Sitecore will inherit the value from the Standard Values.
  • If a field is explicitly set (even if set to empty), Sitecore uses that value and does not inherit from the Standard Values.

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.

The Fix: Using ContainsStandardValue

To fix this issue, we took a developer-first approach. The idea was to:

  1. Detect fields where the value is being inherited from Standard Values.
  2. Clear those fields (set them to empty) to prevent Sitecore from showing the inherited value.
  3. Leave untouched any fields that were explicitly authored by users.

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.

PowerShell Script

# 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
}

Script Functionality Overview

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.

Best Practices Moving Forward

  • Standard Values in Sitecore should be used to define default field values and presentation details for all items based on a template, ensuring consistency and saving time.
  • They are ideal for setting default renderings, placeholders, layouts, validation rules, and workflow states that apply across all items of that template.
  • Standard Values should be created and properly configured at the same time as the components themselves. Establishing Standard Values early helps enforce consistency, reduces manual corrections later, and prevents unexpected behavior caused by missing or incomplete defaults.
  • Avoid filling Standard Values with data that should be unique per item to prevent conflicts or confusion. Using tokens like $name or $date within Standard Values can help automate dynamic defaults.
  • Keep the Standard Values clean and maintainable by only including relevant defaults and documenting any special configurations.
  • Always test changes by creating new items to confirm defaults apply correctly and do not break functionality.
  • Be mindful that Standard Values must be included in serialization and deployment processes to keep environments in sync.
  • Lastly, avoid overcomplicating Standard Values with excessive personalization or conditional renderings, as it can make troubleshooting more difficult.

Why Early and Clean Standard Values Matter

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.

Photo of Fishtank employee Anju Thomas

Anju Thomas

Sitecore Web Developer

Anju is a Sitecore Developer with a Bachelor's Degree in Computer Science and over 4 years of experience in Sitecore development. She loves solving Sudoku puzzles, watching movies, eating delicious food and exploring the world.