Newer Version Available

This content describes an older version of this product. View Latest

KeywordList

Represents a list of keywords used in community moderation. This keyword list is a type of moderation criteria that defines offensive language or inappropriate content that you don’t want in your community. This type extends the Metadata metadata type and inherits its fullName field.

Keep the following things in mind when creating keyword list criteria:
  • Your org can have up to 30 keyword list criteria. This limit is per org, not per community.
  • A keyword list can have up to 2,000 keywords.
  • Capitalization and trailing punctuation are ignored when matching your keywords to user-generated content. For example, if your criteria includes BadWord, it’s matched when a user types BADWORD or badword.

File Suffix and Directory Location

KeywordList components have the suffix .keywords and are stored in the moderation directory of the corresponding package directory. The file name format follows community_name.keyword_list_developer_name.keywords.

Version

KeywordList components are available in API version 36.0 and later.

Special Access Rules

To view, create, edit, and delete a keyword list, you need the Manage Communities or Create and Set Up Communities permission.

Fields

Field Name Field Type Description
Description string A description of the keyword list.
keywords Keyword[] The keywords you want moderate in your community.
masterLabel string Required. Label for the keyword list.

Keyword

Keywords in the keyword list.

Field Name Field Type Description
keyword string Required. Keywords you want to moderate.
  • Keywords can only be up to 100 characters and can include letters, numbers, spaces, and special characters.
  • Wildcard characters aren’t supported.

Declarative Metadata Sample Definition

The following is an example of a KeywordList component.

1<?xml version="1.0" encoding="UTF-8"?>
2<KeywordList xmlns="http://soap.sforce.com/2006/04/metadata">
3   <masterLabel>Bad Word List</masterLabel>
4   <description>List of bad words updated by Joe in Nov 2015.</description>
5   <keywords>
6     <keyword>bad-word</keyword>
7   </keywords>
8   <keywords>
9     <keyword>b a d w o r d</keyword>
10   </keywords>
11   <keywords>
12     <keyword>b@dword</keyword>
13   </keywords>
14</KeywordList>

The following is an example package.xml that references the previous definition.

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3   <types>
4     <name>KeywordList</name>
5     <members>community1.badword_list</members>
6   </types>
7   <version>36.0</version>
8</Package>