How to Fix Mailchimp Tags Not Working with MC4WP Forms and Integrations
Content
One of the most common issues users encounter with the 'MC4WP: Mailchimp for WordPress' plugin is that subscriber tags fail to be added to their Mailchimp audience. This can happen whether you're using a Contact Form 7 integration, a Gravity Forms integration, or a custom HTML form. Tags are crucial for segmenting your audience and running targeted campaigns, so when they don't work, it can be a significant problem.
This guide will walk you through the most common reasons tags fail to sync and provide tested solutions to get your tagging system working correctly.
Why This Happens
Based on community reports, tags not being added can occur for several reasons:
- Incorrect Field Names: Using the wrong hidden field name or incorrect capitalization for merge fields.
- Existing Subscribers: The Mailchimp API handles tags differently for new subscribers versus existing ones. By default, tags are often only applied on the initial subscription and not updated on subsequent form submissions.
- Outdated List Data: The plugin has a cached version of your Mailchimp list and doesn't know about new fields or tags.
- Incorrect Code Syntax: Using the wrong filter hook or an improperly constructed function in your theme's
functions.phpfile. - Conflicting Filters: Multiple filters or broad filters that apply tags from all integrations can sometimes conflict with more specific ones.
Common Solutions
1. Renew Your Mailchimp Lists
Before any troubleshooting, ensure the plugin has the most recent data from your Mailchimp account. Navigate to MC4WP > Mailchimp in your WordPress admin and click the "Renew Mailchimp lists" button. This ensures the plugin recognizes all available fields and tags.
2. Use the Correct Hidden Field for Basic Tags (Contact Form 7)
For a simple, static tag, you can add a hidden field to your Contact Form 7 form. The correct field name is mc4wp_tags (not an array).
<input type="hidden" name="mc4wp_tags" value="Your-Tag-Name" />
Important: The tag must already exist in your Mailchimp audience. The plugin will not create a new tag; it will only assign an existing one.
3. Use Custom Code for Advanced Tagging
For dynamic tags, conditional tags based on a checkbox, or tags specific to a certain form, you will need to add a code snippet to your theme's functions.php file.
Example 1: Add a Static Tag to a Specific CF7 Form
add_filter( 'mc4wp_integration_contact-form-7_subscriber_data', function( MC4WP_MailChimp_Subscriber $subscriber, $cf7_form_id ) {
if ( $cf7_form_id == 12345 ) { // Replace 12345 with your actual CF7 form ID
$subscriber->tags[] = 'My-Tag';
}
return $subscriber;
}, 10, 2 );
Example 2: Add a Tag Based on a CF7 Checkbox
add_filter( 'mc4wp_integration_contact-form-7_subscriber_data', function( MC4WP_MailChimp_Subscriber $subscriber, $cf7_form_id ) {
if ( $cf7_form_id == 12345 ) {
// Check if a specific checkbox was checked in the form submission
if ( isset( $_POST['your-checkbox-field'] ) && ! empty( $_POST['your-checkbox-field'] ) ) {
$subscriber->tags[] = 'Tag-If-Checked';
}
}
return $subscriber;
}, 10, 2 );
Example 3: Add a Tag for WooCommerce Checkout Subscriptions
add_filter( 'mc4wp_integration_woocommerce_subscriber_data', function( MC4WP_MailChimp_Subscriber $subscriber ) {
$subscriber->tags[] = 'Woo-Customer';
return $subscriber;
} );
4. The Limitation with Existing Subscribers
A key limitation confirmed by the MC4WP team is that the Mailchimp API makes it difficult to update tags for existing subscribers. Even with the "Update existing subscribers?" setting enabled, tags from a second form submission often will not be added to a contact that already exists in the audience.
Workaround: If updating tags for existing subscribers is a critical requirement, consider using Interest Groups instead. Interest Groups are fully supported by the Mailchimp API for both new and existing subscribers and can be used for segmentation in much the same way as tags.
Need More Help?
If you've tried these solutions and are still encountering issues, ensure your code syntax is correct and that you are using the right integration-specific filter hook. The code examples provided here are a common and effective approach used by the community to solve tag-related issues with the MC4WP plugin.
Related Support Threads Support
-
Mailchimp tag in WooCommerce integrationhttps://wordpress.org/support/topic/mailchimp-tag-in-woocommerce-integration/
-
CF7 submission gets added to MailChimp without taghttps://wordpress.org/support/topic/cf7-submission-gets-added-to-mailchimp-without-tag/
-
Get subscriber datahttps://wordpress.org/support/topic/get-subscriber-data/
-
Tag Field Missinghttps://wordpress.org/support/topic/tag-field-missing/
-
How to easily TAG suscribershttps://wordpress.org/support/topic/how-to-easily-tag-suscribers/
-
WordPress comments and CF7 at the same timehttps://wordpress.org/support/topic/wordpress-comments-and-cf7-at-the-same-time/
-
MERGE-Taghttps://wordpress.org/support/topic/merge-tag/
-
How to send CF7 field as Mailchimp taghttps://wordpress.org/support/topic/how-to-send-cf7-field-as-mailchimp-tag/
-
Adding Tags to Gravity Formshttps://wordpress.org/support/topic/adding-tags-to-gravity-forms/
-
Tags not added on second subscriptionhttps://wordpress.org/support/topic/tags-not-added-on-second-subscription/
-
Tag a subcriber using a checkbox?https://wordpress.org/support/topic/tag-a-subcriber-using-a-checkbox/
-
Is it possible to add different tags based on each different integration?https://wordpress.org/support/topic/is-it-possible-to-add-different-tags-based-on-each-different-integration/
-
incremental tags when subscribing from woo checkouthttps://wordpress.org/support/topic/incremental-tags-when-subscribing-from-woo-checkout/
-
Must be an instance of MC4WP_MailChimp_Subscriberhttps://wordpress.org/support/topic/must-be-an-instance-of-mc4wp_mailchimp_subscriber/
-
Tags are not added automaticallyhttps://wordpress.org/support/topic/tags-are-not-added-automatically/
-
dinamic tag based on post categoryhttps://wordpress.org/support/topic/dinamic-tag-based-on-post-category/
-
Can’t add tags when users subscribes via Gravity Formhttps://wordpress.org/support/topic/cant-add-tags-when-users-subscribes-via-gravity-form/
-
mailchimp tags not working and now won’t subscribe usershttps://wordpress.org/support/topic/mailchimp-tags-not-working-and-now-wont-subscribe-users/
-
How to assign a tag from a custom html form?https://wordpress.org/support/topic/how-to-assign-a-tag-from-a-custom-html-form/
-
Sending tags to mailchimp from contact form 7https://wordpress.org/support/topic/sending-tags-to-mailchimp-from-contact-form-7/
-
Subscriber tags not added to MailChimp via MC4WP Integrationhttps://wordpress.org/support/topic/subscriber-tags-not-added-to-mailchimp-via-mc4wp-integration/
-
Subscriber data not adding to existing usershttps://wordpress.org/support/topic/subscriber-data-not-adding-to-existing-users/
-
Update tags on existing subscriberhttps://wordpress.org/support/topic/update-tags-on-existing-subscriber/
-
Add MC Tag Based On Post Categoryhttps://wordpress.org/support/topic/add-mc-tag-based-on-post-category/
-
Add page slug to Mailchimp tagshttps://wordpress.org/support/topic/add-page-slug-to-mailchimp-tags/
-
Name field from contact form7 is not set to mailchiphttps://wordpress.org/support/topic/name-field-from-contact-form7-is-not-set-to-mailchip/
-
Does not update tags on member list.https://wordpress.org/support/topic/does-not-update-tags-on-member-list/