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.

<p>
	<label>Address</label>
	<input type="text" name="ADDRESS[addr1]" placeholder="Street" />
</p>
 
<p>
	<label>City</label>
	<input type="text" name="ADDRESS[city]" placeholder="City" />
</p>
 
<p>
	<label>State</label>
	<input type="text" name="ADDRESS[state]" placeholder="State" />
</p>
 
 
<p>
	<label>ZIP Code</label>
	<input type="text" name="ADDRESS[zip]" placeholder="ZIP" />
</p>
 
<p>
	<label>Country</label>
	<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.

Was this article helpful? ·