Split up address fields

Mailchimp splits up address fields by default, something the field generator in the Mailchimp for WordPress plugin does not yet support. You can however choose to split up your address fields manually.

The following HTML snippet can be used as a starting point for this.

	<input type="text" name="ADDRESS[addr1]" placeholder="Street" />
	<input type="text" name="ADDRESS[city]" placeholder="City" />
	<input type="text" name="ADDRESS[state]" placeholder="State" />
	<label>ZIP Code</label>
	<input type="text" name="ADDRESS[zip]" placeholder="ZIP" />
	<input type="text" name="ADDRESS[country]" placeholder="Country Code, eg 'US'" />

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>

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.

Was this article helpful? ·