How do Data Categories structure and secure Salesforce Knowledge articles?
Answer
Basics: A Data Category Group is a taxonomy (for example Product, Region, Audience). Within it, categories form a tree (Product > Laptops > Gaming). Authors tag each article with one or more categories per group. Agents and customers then filter by category when searching, and visibility rules limit what each user sees.
How it works: Setup > Data Categories > New Category Group (activate it for Knowledge), build the hierarchy, and optionally set the group on other objects. When authoring, choose categories in the article's category selector. Then set Data Category Visibility on roles, profiles or permission sets. In Lightning, the Knowledge component and Experience Cloud search apply those filters automatically. Common limits: up to five active groups, up to five levels deep, and 100 categories per group (verify current values).
Advanced / deep dive: Design the taxonomy around audience and product, not around org charts, because visibility maps to it. Keep it shallow: deep trees are hard to maintain and slower to reason about. Use separate groups for independent dimensions so visibility combines cleanly (user must see at least one category in each group where the article is categorized). Categories are metadata-like setup records, so deploy them through metadata (the DataCategoryGroup metadata type) and avoid renaming casually. Categories are assigned to articles through the <ArticleType>__DataCategorySelection object (for Lightning Knowledge, Knowledge__DataCategorySelection) which can be loaded with Data Loader. Search by category uses WITH DATA CATEGORY. Data categories also support reporting by topic, helping identify content gaps. Governance: assign a taxonomy owner, because ad hoc additions produce overlapping categories.
Code / config example:
// Tag a draft article with a category (bulk by lists in production)
insert (
ParentId = draftArticleVersionId,
DataCategoryGroupName = ,
DataCategoryName =
);