This plugin is part of Gravity Perks, a suite of 32+ essential Gravity Forms addons with support you can count on.
What does it do?
This plugin allows you to validate a field’s value against the WordPress Comment Blacklist validation. This option can be set for a single field, multiple fields, all fields within a form. If the field fails validation it will display an error to the end user stating that their field contains blacklisted words.
Features
- Validate fields against blacklist.
Prevent form submissions that include blacklisted words. - Validate against a single field, multiple fields, or all fields.
Flexible blacklisting to match your form’s needs. - Integrates with the built-in WordPress Comment Blacklist.
Use the same blacklist for both comments and forms. - Reject submissions silently with a honeypot.
Reject entries without notifying the user that their entry has been blocked. - Automatic updates.
Get updates and the latest features right in your dashboard. - Awesome support.
We’re here to help! And we mean it.
Documentation
How do I enable this functionality?
Since there are two options for this perk, field and form, we will do them in separate categories.
Single Field
To activate blacklist validation for a single field, navigate to the Perks tab and check Validate Against WordPress “Comment Blacklist”.
Whole Form
To validate against every field on the form, navigate to the “Restrictions” section within the form settings area. Check Validate Against WordPress “Comment Blacklist”.
Feature Details
Single Field
If a single field has the Blacklist setting enabled then that field will take the end-users submitted value and check it against that of the WordPress Comment Blacklist words.
Whole Form
If the form wide Blacklist setting is enabled then it loops through all fields within the form when an end-user submits the form. It then checks the fields to see if they are supported by this perk. After grabbing a list of all supported fields it then validates the fields against the WordPress Comment Blacklist words.
WordPress Comment Blacklist
To specify blacklisted words, navigate to Settings > Discussion. Scroll down to “Comment Blocklist” and enter any words you wish to prevent from being submitted on this form, one per line.
You can specify IP addresses in the Comment Blocklist and GP Comment Blacklist will prevent submissions from that IP.
Automate Blacklist Management
Save yourself time and beef up your blacklist by supplementing the list of keywords with this repository. You can add the list to your site by pasting it into the Comment Blocklist, or you can use any of the supported plugins that automates adding new keywords.
Honeypot
Use the gpb_enable_honeypot hook to silently reject submissions while making it appear successful. This discourages spammers from attempting to find loopholes in your blacklist to exploit.
Known Limitations
Due to the nature of WordPress’ Comment Blacklist feature, it will match words inside of other words. So let’s say you wanted to ban the word Race it would also ban any words with race in it, like Racer.
FAQs
How can I change the text of the validation error message?
You can change the text of the validation error by using the gpb_validation_message hook.