Customize CF7 Form Validation Messages

Customizes the default validation messages in Contact Form 7

PHP

function custom_wpcf7_messages($messages) {
    $messages['required'] = 'This field is required.';
    $messages['invalid_email'] = 'Please enter a valid email address.';
    return $messages;
}
add_filter('wpcf7_messages', 'custom_wpcf7_messages');

Snippet Feedback

Did this snippet work for you? Do you have any questions about this snippet? Leave some feedback below.
SHARED BY

Language

Did it work?

Save Snippet

Embed Snippet

To embed this snippet on your site, copy this html code and paste into your webpage. Learn more
By embedding snippets on your site, you are agreeing to our terms and conditions.

Embed Snippet

To embed this snippet on your site, copy this html code and paste into your webpage. Learn more
By embedding snippets on your site, you are agreeing to our terms and conditions.

Embed Snippet

To embed this snippet on your site, copy this html code and paste into your webpage. Learn more
By embedding snippets on your site, you are agreeing to our terms and conditions.