Title: Changes WPCF7 Messages PHP
Last modified: August 21, 2016

---

# Changes WPCF7 Messages PHP

 *  [Howdy_McGee](https://wordpress.org/support/users/howdy_mcgee/)
 * (@howdy_mcgee)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/changes-wpcf7-messages-php/)
 * I was wondering if there was a filter or a way to change contact form Messages?
   Usually when I install contact form 7, every time I create a form I change the
   default Messages and word them differently to what makes sense to me. Instead
   of changing these every time I create a form I’d rather use PHP and change all
   the forms Messages in 1 place.
 * Is this possible? Does this make sense?
 * [https://wordpress.org/plugins/contact-form-7/](https://wordpress.org/plugins/contact-form-7/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Howdy_McGee](https://wordpress.org/support/users/howdy_mcgee/)
 * (@howdy_mcgee)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/changes-wpcf7-messages-php/#post-5165608)
 * This is how I was able to change the messages, there may be a better way to go
   about it but to see all messages `echo print_r($messages)` or maybe if the creator
   catches this thread he could list all the `$messages` names:
 *     ```
       /** Contact Form 7 Default Messages **/
       function wpcf7_custom_messages($messages){
       	$messages['mail_sent_ok']['default'] 		= 'Your message has been sent!';
       	$messages['mail_sent_ng']['default'] 		= 'Your message could not be sent.';
       	$messages['validation_error']['default'] 	= 'Validation errors occurred. Check your information and submit again.';
       	$messages['spam']['default'] 				= 'Your message could not be sent.';
       	$messages['invalid_required']['default'] 	= 'This field is required.';
       	$messages['captcha_not_match']['default'] 	= 'Incorrect CAPTCHA - try again.';
       	$messages['invalid_email']['default'] 		= 'Invalid email address.';
   
       	return $messages;
       }
       add_filter( 'wpcf7_messages', 'wpcf7_custom_messages', 999 );
       ```
   
 *  [wpwalker](https://wordpress.org/support/users/wpwalker/)
 * (@wpwalker)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/changes-wpcf7-messages-php/#post-5165638)
 * It works. A big thank you for this!
 * I’ve been messing around trying to do it with a translation file, which worked
   but is not really the right way to do it 😀 Luckily just searched again and caught
   this post.
 * Folks, remember that if you’ve already made a form, the result messages won’t
   change there, because they have already been saved. Only when you start a new
   form. (It only took me a couple days to figure out why my messages weren’t changing—
   hopefully you are smarter than me!)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Changes WPCF7 Messages PHP’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7/assets/icon.svg?rev=2339255)
 * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7/reviews/)

## Tags

 * [messages](https://wordpress.org/support/topic-tag/messages/)
 * [validation](https://wordpress.org/support/topic-tag/validation/)

 * 2 replies
 * 2 participants
 * Last reply from: [wpwalker](https://wordpress.org/support/users/wpwalker/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/changes-wpcf7-messages-php/#post-5165638)
 * Status: not resolved