Sitecore Items – Get Keyword Reference Items

Challenge:

We need to know in how many Sitecore items word “keyword” is present. This requirement arrived because client had a contract with one third party service and now they have planned to discard the contract with that party and change the service with other party. Now these third party services provide some script which we add in Sitecore item and now for all the items where we have script used by first service need to be replaced with another. And the site is very big and we can’t check each and every item where the “keyword” is present.

So after discussing with Urvesh, we came up with an idea to fetch from Database directly.

001

Solution:

Ultimately sitecore stores the value in Database into three tables — Versioned, Unversioned and Shared fields. So we wrote a query which will hit all the three tables and provide us the item ids where the keyword is present. The site is in many languages and if in any language version the keyword is present then it will be captured. This saved enormous time and money. 🙂 We’ve heavily used this utility for providing the report to the Content Authors and Migration. Additionally we have created many such tools which can update the items in bulk, we will share it soon.

Read More