Find and Optimize Nodes with Over 100 Child Items in Sitecore

Created: 16 Sep 2024, last update: 9 Nov 2024

Tip: Find and Optimize Nodes with Over 100 Child Items in Sitecore

Sitecore recommends keeping the number of items under a single node below 100 to maintain performance and usability. To identify folders exceeding this limit, you can run the "Limit the number of items under any given node" PowerShell report available in the Solution Audit.

If you encounter folders with a large number of items that need optimization, the Sitecore Commander tool provides automation features to streamline this process. Two useful methods offered by this tool are:

  1. MoveSubItemsToMonthFolders: This method moves items to new subfolders based on their creation date, naming the folders by month. It can be extended to use the year or even the first letter of the item name as the folder structure.
  2. MoveSubItemsToMultipleFolders: This method moves all child items to subfolders, limiting the number of items in each subfolder to a specified maximum. When the limit is reached, a new folder is automatically created to accommodate the remaining items.

By leveraging Sitecore Commander, you can efficiently manage large item counts, maintaining both performance and usability in your Sitecore solution. You can utilize the Sitecore API, running the code in Visual Studio with debugging capabilities.

The Sitecore ui does not have multiselect so it is a lot of work to move multiple items manually, SitecoreCommander does not have an ui but moving items is easy to achieve with the api.

Note: Besides reducing the number of child nodes you can also make a bucket out of it as a solution to fix this.