Gravity Forms hook to ban a specific email address


Gravity Forms hook to ban a specific email address

Gravity forms plugin is highly customizable and makes its plethora of hooks available to help developers achieve the desired tasks. I used the validation gravity forms validation filter to filter the entered email address on submit.

I used the code below, to validate the entered email address and then check if the email address entered matched the address that needed to be banned. If the entered email address matches the emails specified, then a bool false status is set for the is_valid key in the result array and hence showing a validation error on submit.


Ref: gform_field_validation_<form-id>_<field-id>

Read mode about the above field validation here


Gravity Forms is copyright of RocketGenius and you can use the plugin by downloading from their site or from the wordpress plugins directory.


Photo credit: Gravityforms