In Multilingual Site, Content Authors many times create duplicate items or copy items and in that case, all the versions of the items are getting copied. And they want to remove the language versions in bulk so that no wrong language version with wrong data gets published live.
If you are implementing and looking for the quick solution, see below code:
Language languageRemove = Sitecore.Globalization.Language.Parse(languageCode); Item rootItem = db.GetItem(rootItemPath, languageRemove); if (rootItem != null) { using (new Sitecore.SecurityModel.SecurityDisabler()) { if (rootItem.Versions.Count == 0) { sb.Append("Language version not found. Item: " + rootItemPath).Append(" Language: ").Append(languageCode).Append("<br/>"); } else { //Remove all the versions from item rootItem.Versions.RemoveAll(false); } }
If content authors are working on many items and if they remove language versions manually then for each it will take hours of them to get it done. This tool will help content authors to remove the unnecessary language versions from the Sitecore Items in few seconds/minutes.