KeywordList defines offensive-language or inappropriate-content criteria for Experience Cloud site moderation. It stores the terms to match against user-generated content. ModerationRule components reference a list through their keywordList element, so changing a list can change the criteria used by those rules.
A keyword list is not a moderation rule. Its presence alone does not show which rules use it or whether moderation is active. Its site-qualified component name identifies the associated site, while masterLabel supplies the display label.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
The component identity inherited from Metadata. Use site_name.keyword_list_developer_name, with a period separating the site name from the list's developer name. |
masterLabel |
Required. The list's label, not its site-qualified deployment identity. |
description |
A description of the keyword list. |
keywords |
The repeated entries containing the terms to moderate. A list can contain up to 2,000 keywords. |
keyword |
Required within each keywords entry. Each value can contain up to 100 characters, including letters, numbers, spaces, and special characters. Keyword wildcards are not supported. |
Behavior and Constraints
An org can have up to 30 keyword list criteria. This is an org-wide limit, not a separate allowance for each Experience Cloud site. The site-qualified naming convention does not change that limit.
Matching ignores capitalization and trailing punctuation. For example, BadWord matches BADWORD and badword. Adding case-only variants does not expand coverage.
Keyword entries are not wildcard patterns. Although values can include special characters, wildcard matching is not supported.
Viewing, creating, editing, or deleting a keyword list requires the Manage Experiences or Create and Set Up Experiences permission. Access is also restricted to users who have permission to edit moderation rules.
Deployment and Retrieval
KeywordList components use the .keywords suffix and reside in the moderation directory of the corresponding package directory. The filename format is site_name.keyword_list_developer_name.keywords.
In package.xml, use KeywordList as the metadata type name and the site-qualified component name as the member. For example, member site1.badword_list corresponds to moderation/site1.badword_list.keywords. Do not substitute the value of masterLabel for this deployment identity.
The manifest supports * to select KeywordList members. This manifest support is separate from keyword matching: an asterisk in a keyword value is not a supported wildcard pattern.
Retrieving a list provides its terms, but the list alone does not establish its use by moderation rules. Inspect the relevant ModerationRule.keywordList references separately when determining the effect of a list change.
See the Salesforce KeywordList reference for the component definition and package example.
Relationships
Moderation rules consume keyword lists as moderation criteria. Separately, the site_name prefix in the component name associates the list with a site by naming convention; it is not an XML element reference.
Referenced By
-
ModerationRule:keywordList.
Reported Issues
-
Direct Apex queries may not be an option for inspecting keyword lists. A 2021 community inventory reported that
KeywordListwas not available in the ApexSchemanamespace and could not be queried directly in Apex. This was a report about Apex access, not a restriction on Metadata API retrieval. See the Apex query availability discussion.
Common Questions
How do I retrieve a KeywordList in package.xml?
Use type KeywordList with a site-qualified member such as site1.badword_list, or use * to select members. The component file belongs in the moderation directory and ends in .keywords.
Does KeywordList support wildcards?
Keyword values do not support wildcard matching. The * wildcard is supported in the package.xml manifest for selecting components.
Is the 30-keyword-list limit per Experience Cloud site?
No. The limit is 30 keyword list criteria across the org. Each list can contain up to 2,000 keywords, and each keyword can contain up to 100 characters.
Does deploying a KeywordList activate moderation?
The list's presence alone does not establish whether moderation is active. ModerationRule components reference lists through keywordList; the list defines the terms, not the rule configuration.
Do I need separate entries for uppercase and lowercase words?
No. Matching ignores capitalization and trailing punctuation, so case-only variants do not expand coverage.