WordPress filter hook

wpcf7_mail_tag_replaced

Fired by 8 WordPress plugins, running on 10M+ sites between them.

“This filter is documented in Contact Form 7”

How to use wpcf7_mail_tag_replaced

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'wpcf7_mail_tag_replaced', function( $replaced, $submitted ) {
	// Change $replaced here.
	return $replaced;
}, 10, 2 );

Argument names come from Contact Form 7 GetResponse Extension's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

8 plugins that fire wpcf7_mail_tag_replaced

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Contact Form 7 icon Contact Form 710+ million installs apply_filters( 'wpcf7_mail_tag_replaced', $replaced, $submitted, $html, $mail_tag ) includes/mail.php:620
  2. Contact Form 7 GetResponse Extension icon Contact Form 7 GetResponse Extension1,000+ installs apply_filters( 'wpcf7_mail_tag_replaced', $replaced, $submitted ) public/class-cf7-gr-ext-public.php:79
  3. MailerPress icon MailerPress1,000+ installs apply_filters( 'wpcf7_mail_tag_replaced', $replaced, $submitted ) src/Actions/ThirdParty/ContactForm7/Setup.php:334
  4. Contact Form 7 Campaign Monitor Extension icon Contact Form 7 Campaign Monitor Extension900+ installs apply_filters( 'wpcf7_mail_tag_replaced', $replaced, $submitted ) includes/functions.php:788
  5. Connect Contact Form 7 and AWeber icon Connect Contact Form 7 and AWeber300+ installs apply_filters( 'wpcf7_mail_tag_replaced', $replaced, $submitted ) includes/services/class-icf7a-subscriber.php:293
  6. Contact Form 7 icon Contact Form 790+ installs apply_filters( 'wpcf7_mail_tag_replaced', $replaced, $submitted ) cf7-campaignmonitor.php:249
  7. Gwebpro Contact Form 7 MailChimp Extension icon Gwebpro Contact Form 7 MailChimp Extension30+ installs apply_filters( 'wpcf7_mail_tag_replaced', $replaced, $submitted ) lib/functions.php:251
  8. CF7 LACRM Connector icon CF7 LACRM Connector20+ installs apply_filters( 'wpcf7_mail_tag_replaced', $replaced, $submitted, $html ) includes/class-lacrm-service.php:594

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.