Specify which templates to index

The Sitecore Search Provider framework offers various mechanisms to alter item indexing. One of them is template inclusion and exclusion.

By default, all Sitecore items under specified crawling roots are indexed. Template inclusion/exclusion lets you specify the items under these crawling roots that should be indexed, based on the Sitecore template they originate from.

This article focuses on configuring template inclusion/exclusion for Coveo indexes.

Including or excluding templates from the Coveo indexes

In the <SITECORE_INSTANCE_ROOT>\Website\App_Config\Include\Coveo\Coveo.SearchProvider.Custom.config file, use <include hint="list:AddIncludedTemplate"> or <exclude hint="list:AddExcludedTemplate"> elements as immediate children of the configuration/sitecore/coveo/defaultIndexConfiguration/documentOptions element. Then, specify the Sitecore templates to be included/excluded as child elements using their Item ID.


When including or excluding multiple templates, remember to use unique element names for each template. Otherwise, only the last child of the <include>/<exclude> element of a given name will actually be included/excluded. Descriptive template element names can serve this purpose and help you identify the content you’re including or excluding from the index.

<include hint="list:AddIncludedTemplate">
<exclude hint="list:AddExcludedTemplate">

Excluding items from the indexing means that those items aren’t crawled anymore. If you already had items based on these templates in your index, they won’t be automatically removed from the index. You must run a rebuild to delete them.