Skip to main content

Find Sitecore Child Item Counts

The performance of the Sitecore Content Editor can be affected when an item has too many child items. A rule of thumb is to keep the child count below 100. Here's a quick SQL script to show how many children each item has.

Run it against the Master database. 

SELECT ParentItems.Name AS [Item Name],
Items.ParentID AS [Item ID],
Count(items.ID) AS [Child Count]
FROM Items
INNER JOIN Items AS ParentItems
ON Items.ParentID = ParentItems.ID
GROUP BY Items.parentID, parentItems.Name
ORDER BY [Child Count] DESC

Comments