Disable Error Messages on Form Submission Failure

Hi there!

I’m trying to build a very simple submit form, with a simple email address field.
When it’s empty, the errror message feels screaming loud!

If there is only one field to fill in, I don’t feel that the first message makes sense. In fact, once the required message (the one displayed below the field in my screenshot) is visible, I don’t think the first message is necessary at all, since the requirement is already clear enough.

Is there an option to remove it, or would that require some code customization? Would this be limited to a specific form or applied globally?

I’m talking about the message with the class gform_validation_errors.

Thanks!

Hey Tanguy,

Happy to help.

Please try this or this:

add_filter( ‘gform_validation_message’ , ‘custom_validation_message’ , 10, 2 );
function custom_validation_message( $message , $form ) {
return “”;
}

Add the above code to your theme’s functions.php file (or via Code Snippets plugin) to return an empty string for the validation message.

Give it a spin. Best wishes!


Reference: gform_validation_message

2 Likes