With the Moderation Rules API you can maintain a safe and compliant online environment by automating content moderation through customizable rules. For example, you can use this API to moderate a site's comments or reviews.
The Moderation Rules API allows you to:
- Create and manage custom moderation rules to control the content that appears on a site.
- Automatically check and filter user-generated content to ensure it meets a site's standards.
- Retrieve, update, and delete existing moderation rules to keep content policies up-to-date and relevant.
The following example describes the Moderation Rules API flow for a comment submitted in the Wix Blog app:
- A site visitor submits a new comment on a blog post.
- The comment is reviewed to determine if it violates any moderation rules. For example, the comment can't contain any links.
- On a Wix site, a modal informs the user that the comment is undergoing moderation. In the UI, the comment is marked with the "Pending" status.
- On the backend, the comment has a
status
of "PENDING"
.
- If a violation is detected, i.e. the comment contains links, the rule is triggered and appropriate action is taken. The comment is either sent for manual approval or rejected, per the set moderation rules.
It’s important to note the following before starting to code:
- You don't need to install any additional apps. Moderation service is already integrated in Comments and Reviews.
- You can create up to 20 rules per namespace.
- For every trigger there must be a separate rule.
- The content is checked only for newly submitted reviews and comments. Any comments or reviews made before the integration of this API aren't checked.
- Audience: The group of users to whom a rule applies.
- Trigger: The condition or event that activates a rule.
- Exemptions: Specific users or groups that are excluded from a rule.
- Action: The response or measure taken when a rule is triggered.
- Content: The material or information that is subject to moderation.
- Violations: Instances where content breaches the established rules.
- Rule: A predefined set of conditions that manages user-created content on a website. It consists of
three key components:
- Audience
- Triggers
- Actions
- Namespace: A namespace is a way to organize and separate different entities within a website, allowing each entity to have its own distinct set of rules or behaviors. This structure helps manage different features, like comments or reviews, by assigning specific rules to each, even when they coexist on the same site. For example, a site can have comments for both Wix Blog and Wix Forum. These comments may require different moderation rules, so namespaces like
comments/{BLOG_APP_ID}
or comments/{FORUM_APP_ID}
can be defined to separate the rules.