Mailchimp splits up address fields into separate fields by default, something the field generator in the Mailchimp for WordPress plugin does not yet also support (as of version 4.0).
You can still choose to split up your address fields manually.
The following HTML snippet can be used as a starting point.
<p>
<label>Address</label><br />
<input type="text" name="ADDRESS[addr1]" placeholder="Street" />
</p>
<p>
<label>City</label><br />
<input type="text" name="ADDRESS[city]" placeholder="City" />
</p>
<p>
<label>State</label><br />
<input type="text" name="ADDRESS[state]" placeholder="State" />
</p>
<p>
<label>ZIP Code</label><br />
<input type="text" name="ADDRESS[zip]" placeholder="ZIP" />
</p>
<p>
<label>Country</label><br />
<input type="text" name="ADDRESS[country]" placeholder="Country Code, eg 'US'" />
</p>
Should you want to use a select box in which users can select their country, replace the “country” field with the following.
<select name="ADDRESS[country]">
<option value="US">United Stated</option>
<option value="GB">United Kingdom</option>
<option value="CA">Canada</option>
<option value="AU">Australia</option>
</select>
Please note that the country field should be a 2 character ISO-3166-1 code. If this field is not set, Mailchimp will default to the country of the list owner.
For a dropdown including all possible country codes, please use this HTML snippet.
Alternatively, if you want to hide certain fields and use a predefined value, change the type
attribute of the field to hidden
and set value
attribute with the value you would like to use.
<input type="hidden" name="ADDRESS[country]" value="US" />
You can change the HTML mark-up of the various address fields to your liking, as long as the name attribute of the fields stays unchanged.