Title: Conditional Tag Assignment
Last modified: February 29, 2024

---

# Conditional Tag Assignment

 *  Resolved [kkoop83](https://wordpress.org/support/users/kkoop83/)
 * (@kkoop83)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/conditional-tag-assignment/)
 * Hello, I see how to add tags to the subscriber by checking which form is being
   submitted in functions.php. Is there a way to do it with a single form?
 * For a simple example, radio buttons for favorite color: red or blue. If the form
   is submitted with red selected, set the tag to red. I’m using CF7 but can use
   the default form builder if that’s better for this use case.
 * Thanks in advance

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

 *  Plugin Contributor [Harish Chouhan](https://wordpress.org/support/users/hchouhan/)
 * (@hchouhan)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/conditional-tag-assignment/#post-17464744)
 * Hello,
 * It’s not currently possible to use any fields in the form to set a tag. Using
   code such as [https://github.com/ibericode/mailchimp-for-wordpress/blob/main/sample-code-snippets/integrations/contact-form-7/different-tag.php](https://github.com/ibericode/mailchimp-for-wordpress/blob/main/sample-code-snippets/integrations/contact-form-7/different-tag.php),
   you can assign the user a different tag based on the CF7 you are using. However
   there are no conditions to change the tag if you are using the same form.
   I would
   recommend using “Interest Groups” for this. You can learn more about it at [https://www.mc4wp.com/kb/add-interest-group-choice-contact-form-7/](https://www.mc4wp.com/kb/add-interest-group-choice-contact-form-7/).
 *  Thread Starter [kkoop83](https://wordpress.org/support/users/kkoop83/)
 * (@kkoop83)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/conditional-tag-assignment/#post-17466398)
 * Ok, thanks for the response
 *  Plugin Contributor [Lap](https://wordpress.org/support/users/lapzor/)
 * (@lapzor)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/conditional-tag-assignment/#post-17467838)
 * If you have a web-developer or if you can write your own PHP code you could adjust
   the code snippet Harish shared above and look at the $_POST value to get the 
   value of a field in the CF7 form and then set an interest group based on that
   instead of the form ID. But there is currently no exact example snippet prepared
   for that and as Harish mentioned there is no such option build into the plugin.
   
   In my personal opinion Interest groups are often better than tags anyway, the
   only downside is there is a limit on the amount of interest groups you can have,
   but it’s not a limit you would run into very fast.

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

The topic ‘Conditional Tag Assignment’ is closed to new replies.

 * ![](https://ps.w.org/mailchimp-for-wp/assets/icon-256x256.png?rev=1224577)
 * [MC4WP: Mailchimp for WordPress](https://wordpress.org/plugins/mailchimp-for-wp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/mailchimp-for-wp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/mailchimp-for-wp/)
 * [Active Topics](https://wordpress.org/support/plugin/mailchimp-for-wp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/mailchimp-for-wp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/mailchimp-for-wp/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Lap](https://wordpress.org/support/users/lapzor/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/conditional-tag-assignment/#post-17467838)
 * Status: resolved