# ![AddressZen Contact Form 7 Integration](https://img.ideal-postcodes.co.uk/Contact%20Form%207%20Integration%20Logo@3x.png)

Integrate Address Validation to Your WordPress Contact Form 7 Pages.

## Demo[​](#demo "Direct link to Demo")

![Activate Address Lookup on your address collection forms-screenshot](/assets/images/ContactForm-demo-3f9e4afb08e097f4c515ef83bd119de6.gif)

## Installation[​](#installation "Direct link to Installation")

This integration works by adding our Address Validation tools using CF7s's form editor. Below are the instructions to add Postcode Lookup or Address Lookup.

### Create Address Inputs[​](#create-address-inputs "Direct link to Create Address Inputs")

Add address input fields to your form. A basic address form to capture a correct UK address should have the following fields:

* Street Line One
* Street Line Two
* City
* State
* ZIP Code

```
<label> Address Line One 

[text* line_1] </label>



<label> Address Line Two 

[text* line_2] </label>



<label> City

[text* city] </label>



<label> State 

[text* state] </label>



<label> ZIP Code 

[text* zipcode] </label>



[submit "Submit"]
```

![Create address fields-screenshot](/assets/images/contact-address-form-96a2fed2880266df46da9961edb21346.png)

You can optionally include additional fields, which are documented in the [PAF documentation page](/docs/api/find-address.md).

### Add Address Lookup[​](#add-address-lookup "Direct link to Add Address Lookup")

#### Install and initialize Plugin[​](#install-and-initialize-plugin "Direct link to Install and initialize Plugin")

Go the page where the address form is located. Create a `html block` and add the two script tags at the bottom of your form to load the plugin and then to initialize it.

![Add the Address Lookup Plugin-screenshot](/assets/images/contactform-script-2a76966a638f1084c21f33f3028cefc2.png)

```
<script 

src="https://cdn.jsdelivr.net/npm/@addresszen/address-lookup"></script>



<script>

  document.addEventListener("DOMContentLoaded", function () {

    AddressZen.AddressLookup.setup({

      apiKey: "YOUR_API_KEY',

      outputFields: {

        line_1: 'input[name="line_1"]',

        line_2: 'input[name="line_2"]',

        city: 'input[name="city"]',

        state: 'input[name="state"]',

        zip_plus_4_code: 'input[name="zipcode"]',

      }

    });

  });

</script>
```

caution

Take special care to:

1. Insert your API Key in the `apiKey` field
2. Match the names of your target fields. If your Address Line One has the shortcode `[text* line_1]`, ensure that `line_1` reads `'input[name="line_1"]'`
3. Ensure `inputField` points to the same field as `line_1` to have the Address Lookup appear there

## Configuration[​](#configuration "Direct link to Configuration")

See our [Address Lookup Plugin Documentation](/docs/address-lookup.md) if you wish to customize Address Lookup.

info

If you need support, you can reach out to us on our [support page](https://addresszen.com/support).
