Cleaning up Sitecore Publish and Event queue tables to handle memory problems

As you all know that Sitecore Recommends that the no of rows in History, EventQueue and PublishQueue tables be less than 1000 records, this would help to prevent any timeouts while the cleanup agent runs.

Another setting we have for Publish/EventQueue agents is how long to keep the data and the default value is set to 30 days.

But when we have frequent item sync operations from third party systems or within Sitecore (followed with publish)- this would make Publish and Event queue grow which impacts cleanup tasks we have by default (to cleanup publish and event queue table) and memory spiking issues.
In such cases we should consider to optimize the settings we have by default- for example :

For PublishQueue we can set DaysToKeep to 2 and for EventQueue we could set the IntervalToKeep to 04:00:00, but this will vary as required, this is applicable when we see we have more records present in both the tables and as a result we started seeing timeouts and DTU spiking issues.

We can also execute SQL script which is available on CMS tuning guide to remove the records from both the tables.

This is really important to keep an eye on the Publish and EventQueue table so that we can avoid any possible downtime issues and make the system stable as much as possible, obviously- there could be other reasons also which leads to bad performance and memory issues but this is always worth to check.

Thought of sharing it here- hope it would be useful for someone who experience the similar issue.

Happy learning 🙂



Sitecore Item Audit Tool

We have come across many times when we were asked to audit the Sitecore application, which includes Sitecore content audit and solution audit and provide a summary of the complete implementation and see if everything is done as per Sitecore best practices or some compromises has been done.

This article is focused towards item audit which includes checking the templates/renderings/placeholders/content and many other aspects of the Sitecore content tree and item management.

As i got this request quite few of times now- so i thought let’s try to build a tool which can help us is understanding the Sitecore content(item) side of it and give us some actionable items to look and see if there is any scope to improve.

The main idea behind building this tool is to at least get some details from different Sitecore content  types and check if everything is well in place, normally when we review the existing Sitecore implementation these are some of the things which comes to our mind, which includes:

  1. How many page templates exists and how many of them are actually used.
  2. How many data/features templates exists and again how many of them are actually used.
  3. If standard values has been set or not.
  4. If insert options are set
  5. If template icon is set
  6. Different rendering available and if datasource-location and datasource template has been set if it’s a global rendering.
  7. If placeholders allowed controls are set to make sure we can add the components from Experience Editor and etc.

The tool is aligned to solve above points only and it’s just a start, i will continue to make updates to the tool to make it more useful.


Sitecore Marketplace-

How to use:


There are different parameters on which you can generate the report, as i mentioned above report is based on:

  1. Page templates
  2. Data templates
  3. Feature templates
  4. Renderings
  5. Placeholders

Fields description:

  • Root path/ID(Page Items)- This field is to specify Path or ID under which your page items(which has presentation) exists. For example- If you site structure is Sitecore->content->home (under which you have all your page items) then you would have to set the ID of home item or path of home item to this field.
  • Page template folder path/ID- This field is to specify the folder path or ID under which you have your page templates created, for example- if your template structure is- /sitecore/templates/Project/SiteName/Page Types, then you would have to set this path or ID of this to this field. If you have multiple locations where your page templates are stored, then you can pass multiple IDs or paths to this field. Root path/ID(Page Items) field is required to show the correct report of page templates and once done you will have the following details from each template:


  • Page template folder path/ID to exclude– This field is to specify the folder path or ID which you want to exclude from your Page template report. Note– Only one path/ID is allowed to set here.

So- now when we have access to this page report we can see what are the things missing and what is required to fix them, Also- it’s not that we have to fix all the highlighted items as few things are requirement based, but this report provide you that starting point which you need to make your implementation follow best practices.

Similarly we have other reports also, for example- Data template report.

  • Root path/ID(Global Items)- This field is to specify Path or ID under which your data items(global/data items) exists. For example- If you site structure is sitecore->content->Global (under which you have all your global items) then you would have to set the ID of Global item or path of Global item to this field.
  • Data template folder path/ID- This field is to specify the folder path or ID under which you have your data templates created, for example- if your template structure is- /sitecore/templates/Project/SiteName/Content Types, then you would have to set this path or ID of this item to this field. If you have multiple locations where your data templates are stored, then you can pass multiple IDs or paths to this field. Root path/ID(Global Items) field is required to show the correct report of data templates and once done you will have the following details from each template:


  • Data template folder path/ID to exclude- This field is to specify the folder path or ID which you want to exclude from your data template report. Note- Only one path/ID is allowed to set here.

This is how feature template report look if you solution is helix based:


Renderings Report:


Placeholders Report:


Common folder template Report: (Items that are based on default folder template)


We can generate the report based on our requirement, if we want to generate the page template report from specific location and you don’t want to include all the templates, you can just select that specific folder item and generate it.

I will keep adding more features/improvements to it based on the feedback, but i am sure this as our preliminary audit can give us a good visibility about the item management and best practices.

Please let me know for any questions.

Happy learning 🙂

Improve Content Authors Experience in Sitecore

Sitecore site that is easy to use for Editors, developers and users is considered as best Implementation, we should always consider content editors while designing Sitecore, because any change afterwords can results in lot of back and forth and cost as well.


I would like to share my thoughts based on real time experience, and i think we should try to consider these in every project from beginning.

  • Experience Editor : Sitecore setup cannot be considered as complete or good, unless all the components are Experience Editor (Page Editor)friendly, this includes:
    1. Should be able to add components and datasource.
    2. Making sure components can be moved.
    3. Should be able to set the personalization.
    4. Should be able to configure test.
    5. Proper configuration of placeholders, which takes care of adding relevant components in proper section of the page.
    6. Edit page metadata.
    7. Editor should be able to add field values from Experience editor like (background Image, multi-list fields and etc)

A fully functional experience editor page is the first sign which shows your commitment towards client and quality of your delivery, and same time you are also making use of Sitecore at it’s best.

  •  Insert Rules: 
    1. Insert rules helps establishing information architecture of content tree, which increases consistency, with Insert rules you can restrict what content types can be added under specific location of content tree, which helps in defining scope and helps running queries as well.
    2. We can go to Configure -> Assign and set the Insert options, we also have a way to dynamically define it by using “Insert Option Rules“.
    3. Insert rules helps your content author, and guide them how and what can be added into specific location of content tree, this will help reducing any type of content error in the site, assist developers to define scope while writing programs which makes your code more stable.
  • Standard Values:  The standard values item is an item of the given template type, which will be used to hold the default field values.
    1. By defining default values we can make sure to pre-populate  the standard field values, so that content authors doesn’t have to populate it over and over again.
    2. We can set the default values explicitly, or use of token is a also a great way to populate the values.
    3. We can populate following fields every time when new item gets created in Sitecore:
      1. Title
      2. Description
      3. Date (if exists)

This a great way to help content authors to give them a feel that page doesn’t looks incomplete while adding a new page to content tree, and editors can of course go back and change the default values if required, you can configure default data sources for you renderings in required.

  • Help text : How content authors are comfortable with Sitecore, determines if your Implementation is successful, so, as a developer we always have to think about content author experience, and that should be our high priority.
    1. We should make sure field labels are optimized in such a way they serve the needs of both the developer as well as the content editors, we can achieve this following three ways:
      1. Title
      2. Short description and
      3. Help link
    2. The title field and the short description of a field item enable us to provide the content editor with useful information and have a technical field name for developers to work with.
    3. If you go to specific field item in Sitecore, you can set these values which helps content authors in understanding what this field is meant for, and what value should be added.
  • Clean Sitecore tree:
    1. A clean Information structure helps in making Site more consistent, and we should always remember that site will be used by content editors and not by developers, so it should be as clean as possible.
    2. A new content editor, who just joined the team shouldn’t find any difficulty understanding the site, and it’s component structure.
    3. Good information architecture is a key to successful Sitecore Implementation and maintenance.
  • Components/placeholder configuration(s):
    1. Proper configuration should be done for placeholders, so that content authors can add only those components which are meat for specific placeholder, this way we can make sure to maintain the design, and can prevent any sort of compatibility issues with the page.
    2. We can use allowed control that exists on the placeholder level, which defines the list of component(s) which can be added.
    3. Also, on each rendering we should define “datasource location” and “datasource template” which helps content authors to understand that these data items are compatible for specific rendering(s).
  • Thumbnail for Renderings:
    1. We should try to add thumbnails for all renderings, so that content authors can visualize that what rendering is meant for what, if there are no thumbnails added, it can creates a confusion to content editors, in case if no friendly names has been given to renderings.
    2. If friendly name has been given, it still makes more sense and add value to assign thumbnails.

As a Sitecore consultant and developer, we should keep an eye on every part of your solution from day 1, this helps you in understanding the system as a whole, and also gives you an opportunity to make sure that best practices has been followed while developing the solution,and also that we are using Sitecore features at it’s best.

I hope this helps somebody.

Happy learning 🙂

Sitecore best practice and guidelines

There are several useful articles and blogs about #Sitecore best practices, but I am trying to put together my learning on this area. Sitecore has different components shipped within it i.e “analytics“, “workflows“,”personalization” and others.

Before starting or working on any application, our main focus should be to understand application as a whole and not just part of it, believe me this is a key for overall success of your implementation, try to get involved and get more and more information about the solution as a whole.Once you have a big picture in mind, it’s easy to work on small features and then for integrations.

There are several categories we can have, when we talk about Sitecore best practices:

  1. Template.
  2. Content structure.
  3. Presentation.

Templates: Templates are the base for any Sitecore implementation, templates are grouping of certain fields that make one entity/table in Sitecore, which can have one or more then one field(s). There are few things which we should consider while designing a template.

  • Think about the entity first and all related fields which can be grouped.
  • List down all the fields which needs to be added to a particular entity.
  • Now identity if there are any set of fields which are common to other entities as well, at least to few, if not all, like “Headline”,”Teaser”, “Main Content” or “Image” fields.
  • If you get a list of common fields, then create a new “Base Template” and add all those fields in that template, this is also to make sure we are reusing the template and fields as much as possible.
  • You can use the “Display Name” property to provide a user-friendly name for any item.
  • Always try to group fields in section, this is logic separation of fields, still all the fields comes under same template only.
  • Try to give user friendly name for all sections,fields and templates so that business users/content authors can identify and understand them easily.
  • Always set default values in standard values of template, so that we can prepopulate some of the field values.
  • If there is predefined structure we have to follow, we should always consider branching template, this really helps content authors and they will love you for this.
  • Try to have unique icon added to you template, so that it is easy to recognize.
  • Presentation should be configured in standard values, so that it can be applied to all instances of that template.
  • Creation of “Base Templates” should always be in your radar, so that you can make use of Sitecore inheritance where required.

Content structure: This is the second step where we create items based on the template created, content structure helps content authors to look for the information or details they are interested, here are some of the things that we should consider while creating/designing content structure.

  • As a standard, try not to have more than 100 items under particular node, can be folder or page item, this can impact Sitecore performance.
  • If expecting more than 100, then consider using buckets or if not buckets create folders in a way that it doesn’t exceed more then 100 child per folder/item.
  • Try to have only page items created under home page, this can change, you can read my blog on different options for configuring content tree
  • Plan content structure based on site map, place all the items which are accessed using URL as descendants of the website, we should mimic sitemap structure in sitemap as well.
  • Make sure we have security added for items which which should not be accessed by specific user role(s).
  • Indexes should be configured for automatic updates,for better and faster content editor experience.
  • Make sure to consider multi-site environment as well, and create folder accordingly, this also helps in content sharing from one site to another.
  • Try to create folder template for structuring page items, should try for it as much as possible so that we have more control on the tree.
  • Maintain only a few versions of each item in the implementation- this is to improve the performance.

Presentation : Some of the things to consider while setting up the presentation:

  • Page should be Experience editor friendly.
  • Make sure to use Experience editor friendly tags like
  • Sublayout(s) and Rendering(s) should be configured to be cachable for better browsing experience.
  • Rendering should be added to page template standard values,when applied at an item level, any changes to the layouts require a lot of effort to make changes to all items. When applied at standard values, such modifications become easier.
  • Any updates to the specific should be done directly on final layouts, please read my blog for more details-
  • Rendering should have data source template and data source location defined, this helps personalizing the site and making sure the application is experience editor friendly, this is important configuration for Experience editor.
  • All the components/rendering(s) should have thumbnail image added to it, this helps CAs configuring dealing experience editor nicely.
  • Use placeholders settings and allowed control setting, so that CAs can add/create only those modules which are required for that page design to work.

General Practice:

  • Don’t allow a single template to contain two fields with the same name.
  • Use a source code management system to manage all code,this includes JavaScript and CSS as well.
  • Avoid hard-coding as much as possible so that we don’t have to update the code, if any change required.
  • Use IDs instead of paths/name whenever possible.
  • Avoid using any form of the descendant axix, like GetDescendents
  • Try not to modify Sitecore base files and use Sitecore patching for any updates to config files, this helps in upgrade process if required.
  • Content Editing should be done on the master database, and then pushed to web database.
  • Restrict access to content delivery servers.
  • Use the general best practices of developments applicable to C# with tools like Re-sharper.
  • Set up continuous integration.

As I mentioned before there are lot of articles that has more details on best practices and guidelines, please make sure to read those as well.

I hope this will give you some degree of information, which can be applied while designing any structuring your Sitecore site.

Please feel free to add feedback and comments, happy to discuss more.

Happy learning 🙂