The official Gravity Forms Moderation Add-On utilizes the power of the Perspective API, provided by Jigsaw and Google, in order to use its machine learning algorithms to analyze your form submissions, and trap and filter undesirable language and inputs.
Note that this add-on requires Gravity Forms 2.7 or later. For a complete description of what this add-on does, and the requirements required to install it, refer to this article Using the Moderation Add-On.
For a full list of all the Moderation Add-On settings, refer to this guide.
This guide covers the following setup processes.
- Getting your Perspective API Key.
- Adding your key.
- Setting a score threshold.
- Setting the attributes to filter.
- Setting the action for toxic entries
Getting Your Keys
This step requires completing a Google approval process which can take up to 24 hours. Full instructions and a video walkthrough are available on the Perspective Developer site.
- Sign in with your Google account.
- On the Console page, either:
- Click “Create Project”
- Click the “Select a Project” dropdown. In the popup that appears, click “New Project”.
- Name the project.
- Click the “Create” button. The project will now appear in the dropdown.
- Request API Access
Google requires Perspective API users to register for access so that they can better understand and serve you. Once you have a Google Cloud account and project set up, please fill out this form to gain access to the API.
Adding Your Keys
To validate the communication between your site and the Perspective API service, you will need to provide Gravity Forms with this unique key.
- Log into your WordPress admin dashboard.
- On the left side navigation menu, hover over Forms and click on Settings.
- From this page, click the Moderation tab.
- Enter your Perspective API Key. This is obtained from the Perspective API website.
- Click Update Settings. If you’ve entered your API key correctly, you will be notified by a green check mark beside the box. If you do not see green check marks next to the API Key, please double-check this information and try again.
Adding Default Settings
- Toxicity Score: Enter the threshold value you wish. The higher the score (from 0 to 1) returned from the Perspective API, the more likely it reflects a toxic interaction.
- Attributes to Filter: Select any of the filter types that fit your needs. Not all languages support all Filter types. Results are displayed dynamically based on the language selected.
- Custom Toxicity Words: Enter any specific words that will automatically mark an entry as toxic. This setting is optional.
- Actions: Select what you’d like to happen when entries are marked toxic.
Moderation Add-On Hooks
The Moderation Add-On provides hooks that can be used to modify the default functionality or extend it.gform_moderation_locale