UserCriteria defines the member-selection criteria used by Experience Cloud site moderation rules. It identifies the member population to which moderation applies; it does not define a moderation action. A ModerationRule references the component through its userCriteria element.
Changing a referenced UserCriteria can change a moderation rule's scope without changing the rule itself. Its time-based filters measure user creation and site posting or commenting, not the member's last login.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName |
The component name inherited from Metadata. The file identity includes both the site name and criteria developer name, rather than just the display label. |
masterLabel |
The criteria's display name. |
userTypes |
The member categories to select. Allowed NetworkUserType values are Internal, Customer, and Partner. Multiple entries can select more than one category. |
creationAgeInSeconds |
An optional integer that includes only users created within the specified time window, measured in seconds. |
lastChatterActivityAgeInSeconds |
An optional integer that includes only members who posted or commented in the Experience Cloud site within the specified time window, measured in seconds. |
Behavior and Constraints
Access to UserCriteria is limited to users who can edit moderation rules. Viewing, creating, editing, and deleting moderation rules requires either the Manage Experiences or Create and Set Up Experiences permission.
Repeat userTypes to select multiple member categories. For example, entries for Customer and Partner select both categories; this is not a requirement to include both.
The two age settings filter different events. creationAgeInSeconds concerns when the user was created. lastChatterActivityAgeInSeconds concerns posting or commenting within the site. Neither is a last-login test.
The configured time windows do not, by themselves, identify the members who currently match. Determining that population requires actual user creation and site activity data. Likewise, the criteria definition alone does not establish whether a rule uses it or what moderation outcome matching members receive.
Deployment and Retrieval
Store components in the UserCriteria folder using the filename pattern site_name.user_criteria_developer_name.userCriteria. Preserve the site name and criteria developer name, separated by a dot. masterLabel is the display name, not a replacement for that file identity.
UserCriteria supports the wildcard * in the package.xml manifest. Use UserCriteria as the metadata type name when selecting these components for retrieval.
For deployment impact analysis, inspect the ModerationRule components that reference the criteria. Deploying a change to a referenced criteria definition can alter the population covered by those rules even when the rules are not changed.
Relationships
The meaningful incoming dependency is the moderation rule that selects this criteria component. The filename also associates the criteria with a site by name; that naming convention is separate from an XML element reference.
Referenced By
-
ModerationRule:userCriteria.
Reported Issues
-
Direct Apex querying may not be an available inspection method. A 2021 community inventory listed
UserCriteriaas unavailable in the ApexSchemanamespace and not queryable in Apex. This was a report about Apex querying, not a Metadata API retrieval failure. See the Apex queryability discussion.
Common Questions
Can UserCriteria select both customer and partner members?
Yes. Include separate userTypes entries for Customer and Partner. The other allowed value is Internal.
Does lastChatterActivityAgeInSeconds check the user's last login?
No. It selects members who posted or commented in the Experience Cloud site within the specified number of seconds. creationAgeInSeconds instead filters by user creation time.
Can I retrieve UserCriteria with a wildcard?
Yes. UserCriteria supports * in package.xml. Component filenames follow site_name.user_criteria_developer_name.userCriteria in the UserCriteria folder.
Can changing UserCriteria affect an unchanged moderation rule?
Yes. A rule references the criteria through ModerationRule.userCriteria. Changing that criteria can change the rule's member population without changing the rule's definition or moderation action.
What permission is needed to access UserCriteria?
Access is limited to users who can edit moderation rules. Managing moderation rules requires either Manage Experiences or Create and Set Up Experiences.