The Email Blacklist Add-on for Gravity Forms was built to help block submissions from users with generic or competitor email addresses. Prevent the user from processing the form and stop non-qualified leads from being collected.
This plugin allows site admins to create a list of domains that, if used in an email field on a Gravity Form, will cause a validation error and block the submission. A default email blacklist and validation message can be created to use across all email fields. These default settings can be overridden on a per-email field basis.
Global settings can be added under Forms > Settings > Email Blacklist. To add settings to an individual email field, select the field and navigate to the Advanced Settings tab.
This plugin works by blocking either individual email addresses (e.g., jsmith@gmail.com
), email address domains (e.g., gmail.com
), and/or email address top-level domains (e.g., *.com
).
- Search for and install the 'Gravity Forms Email Blacklist' plugin, OR upload
gravity-forms-email-blacklist
to the/wp-content/plugins/
directory. - Activate the plugin through the Plugins menu in WordPress.
- Navigate to Forms > Settings > Email Blacklist to configure the plugin.
- Global Plugin Settings
- Email Field Settings
- Form Validation Error
Once set up, these settings will apply to all email input fields across all Gravity Forms used on the site. They can be overridden by individual email blacklist settings.
- Log in to your site and navigate to Forms > Settings > Email Blacklist.
- In the Global Blacklisted Emails field, enter a comma-separated list of blacklisted domains (e.g.,
hotmail.com
), email addresses (e.g.,user@aol.com
), and/or use wildcard notation to block top-level domains (e.g.,*.com
). These settings can be overridden in individual email fields under advanced settings. - In the Global Validation Message field, enter a default error message that will display if a blacklisted email is submitted. This setting can also be overridden in individual email fields.
- Select the Global Invalid Entry Procedure to determine how the blacklisted submissions should be handled, with validation error or collected and marked as spam.
- Click Update Settings to save your changes.
These settings apply only to the selected form and override the global blacklist settings.
- Log in to your site and navigate to the Gravity Form you want to update.
- Add or edit an existing email input field on the form.
- Go to the Advanced Settings tab for the field.
- In the Blacklisted Emails field, enter a comma-separated list of blacklisted domains (e.g.,
hotmail.com
), email addresses (e.g.,user@aol.com
), and/or use wildcard notation to block top-level domains (e.g.,*.com
). To bypass the global settings and allow all email addresses, enternone
. - In the Blacklisted Emails Validation Message field, enter an error message to display if a blacklisted email is submitted. This setting overrides the global validation message.
- Select the Invalid Entry Procedure to determine how the blacklisted submissions should be handled, with validation error or collected and marked as spam.
- Click Save Form to apply your changes.
- Gravity Forms Documentation - Getting Started
- Gravity Forms Documentation - Email Input Fields
- Gravity Forms Documentation - Fighting Spam
This filter lets you customize the error message shown to users if their email is blacklisted based on form or field settings.
$validation_message
(string): The error message to display.$field
(object): The Gravity Forms field object.$email
(string): The full email address being validated.$domain
(string): The domain part of the email address.$tld
(string): The top-level domain (TLD) of the email address.$blacklist
(string): A comma-separated list of blacklisted emails.
(string): The error message displayed when the email is blacklisted.
This filter lets you determine whether an email passes blacklist validation during form submission.
$is_valid
(bool): Indicates if the email passes validation (default: FALSE).$field
(object): The Gravity Forms field object.$email
(string): The full email address being validated.$domain
(string): The domain part of the email address.$tld
(string): The top-level domain (TLD) of the email address.$blacklist
(string): A comma-separated list of blacklisted emails.
(bool): TRUE if the email is valid and not blacklisted; FALSE otherwise.
This filter lets you determine if a form entry should be flagged as spam based on email validation.
$is_valid
(bool): Indicates if the email passes spam validation (default: FALSE).$field
(object): The Gravity Forms field object.$email
(string): The full email address being validated.$domain
(string): The domain part of the email address.$tld
(string): The top-level domain (TLD) of the email address.$blacklist
(string): A comma-separated list of blacklisted emails.
(bool): TRUE if the email is valid and not flagged as spam; FALSE otherwise.
This filter lets you bypass the email blacklist validation process entirely for specific cases.
$skip
(bool): Set to TRUE to skip blacklist validation (default: FALSE).$field
(object): The Gravity Forms field object.$email
(string): The full email address being validated.$domain
(string): The domain part of the email address.$tld
(string): The top-level domain (TLD) of the email address.$blacklist
(string): A comma-separated list of blacklisted emails.
(bool): FALSE if the validation process was not skipped.
- Fix: Improve loading of SVG icon to prevent warning on some servers.
- Fix: Better handle invalid syntax in the blacklist rules and ignore it.
- Enhancement: Added support to treat submissions with blacklisted emails as spam.
- Enhancement: Added the ability to include * for wildcards anywhere in the blacklisted address or domain.
- Fix PHP error under PHP 8+
- Fix with multiple email fields and different blacklists.
- Fixed version number issue
- Fixed validation function to remove any empty values for the array of blacklisted emails to prevent false positives from empty email fields.
- Added capability declination to the class to allow the plugin to work with role and capabilities plugins.
- Updated labels and descriptions throughout the admin settings to improve clarity.
- Fix: Updated method for getting the TLD to make sure the domain wildcards work in the case of a sub-domain email.
- Updated static setting strings to allow them to be translated.
- Added Text Domain.
- Added a function to Load Loads a plugin’s translated strings.
- Added filter to allow 3rd party plugins to alter the validation message before it is output.
- Added filter to allow 3rd party plugins to alter the is_valid check.
- Added short circuit filter to allow 3rd party plugins to jump over a check.
- Updated documentation, readme and added instructions.
- Updated version number and plugin information on compatibility and stable release.
- Fix: Updated validation function to account for email fields hidden by conditional logic
- Updated the plugin to allow the use of wildcards to block whole top-level domains.
- Updated the way the AddOn is initiated.
- Updated code to meet PHPCS code standards for WordPress.
- Updated version and compatibility numbers.
- Updated readme.txt.
- Added Author URL to GitHub Repo
- Fixed typo in readme.txt
- Added plugin icon
- Bug Fix: Removed 'var_dump' in validation function.
- Added 'gf_emailblacklist_clean' function to make comparison case insensitive. Thanks to @ractoon, @rscoates.
- Updated function to work with both email domains and specific emails.
- Ran 'class-gfemailblacklist.php' through PHPCS with WordPress Coding Standards.
- Moved class to '/includes/class-gfemailblacklist.php' file.
- Added placeholder text to fields
- Updated code comments.
- Updated plugin file name.
- Updated readme.txt and README.md
- Added custom validation message options to the email field under the 'Advanced' field settings
- Added default setting for the email blacklist and validation message to the form settings area to be used on all forms with an email field.
- Added email blacklist options to the email field under the 'Advanced' field settings