Deleting all dictionary item from the umbraco dictionary

by Damiaan Peeters 21. December 2013 19:38

Sometimes you need to delete all dictionary items from the Umbraco dictionary. 

The problem

Deleting 100’s of dictionary items can be a PITA.  Imagine you have to right click for every dictionary item and select delete.

image

Side information

First you probably want to know which tables the dictionary is using.  There are 2: one for the items, one for the translations.  They call cmsDictionary and cmsLangaugeText. 

If you ever want to get information from the dictionary, just join these tables and you have what you need.

select d.pk, lt.pk, d.[key], lt.languageId, l.languageISOCode, lt.value
from cmsDictionary d inner join cmsLanguageText lt on d.id = lt.UniqueId
left join umbracoLanguage l on lt.languageId = l.id
where d.pk = 6

Solution

The fastest way to remove all umbraco dictionary items is through SQL.  To remove ALL dictionary items, just run this SQL script:

delete from cmsLanguageText
delete from cmsDictionary

Don’t forget to touch the web.config because dictionary items are heavily cached!

blog comments powered by Disqus

Who.I.am

Certified Umbraco Master, Part of Umbraco Certified partner comm-it, .Net and Azure developer, seo lover. Magician in my spare time.

Month List