Installing Address Validation for WooCommerce
To add address validation to your WooCommerce store, follow these simple steps. You can enable address validation on your billing or shipping address or any other address form. This guide will walk you through signing up for a free trial, installing the plugin, configuring it, and exploring advanced settings.
You can use the plugin for Address Validation or Postcode Lookup to enhance your WooCommerce checkout experience. If you are unsure which method is best for you, read our comparison guide or watch the video.
Screenshots
Address Finder
Postcode Lookup
Step 1: Sign Up for a Free Trial
To use Ideal Postcodes, you’ll first need to create an account and get your API key.
- If you don’t have an account sign up to create a free account.
- Navigate to the KEYS section in your account.
- Copy your API Key - you’ll need this to complete the setup in WooCommerce. It’s a string of characters that begins with the letters
ak_
. On signing up your first key will have a balance of 200 free lookups for testing.
Step 2: Install the WooCommerce Plugin
You have two ways to install the Ideal Postcodes plugin for WooCommerce: directly through WordPress or manually.
Method A: Install via WordPress
This is the simplest method to integrate address validation to your Wordpress platform.
- Log into your WordPress Admin Dashboard.
- Go to Plugins > Add New.
- In the search bar, type "Ideal Postcodes".
- Find the plugin called “UK Address Postcode Validation” and click Install Now.
- After installation, click Activate.
If you prefer to watch a video, here’s a brief tutorial for you.
Method B: Install Manually
- Download the Ideal Postcodes WooCommerce plugin from GitHub (should be a .zip file). You can find the latest release here. Or download the latest version straight from the WordPress Marketplace.
- Unzip the release you downloaded.
- Log into your WordPress Admin Dashboard.
- Go to Plugins > Add New > Upload Plugin.
- Click Choose File and select “uk-address-postcode-validation” from the file you downloaded.
- Click Install Now, then Activate.
Step 3: Setup the Plugin
Once the plugin is installed, it’s time to configure it.
- In your WordPress Admin, go to WooCommerce > Settings.
- Click on the Integration tab, and then select “UK Address Postcode Validation”.
- Make sure the plugin is activated. The box Enabled should be ticked.
- Enter your API Key (the one you copied when signing up) in the designated field. You can always find the API Key under KEYS in your Ideal Postcodes account.
Give the key a specific name, so it’s clear what it’s used for in case you need to create more keys, e.g. shipping address.
- Choose to enable Address Autocomplete or Address Postcode Lookup by ticking the relevant checkbox. If you are unsure which one is best for you, read our comparison guide or watch the video.
- Click Save Changes.
Optional Settings
The following settings are optional and can be adjusted to suit your specific requirements.
- Enable Populate Organisation Automatically fills in the Company Name field when the selected address includes an organisation.
- Enable County Populates the county field. While county data is no longer required in the UK for identifying premises, you can enable this if it's relevant for your use case.
- Separate Address Finder Adds a dedicated input field for the Address Finder above your address fields. By default, the Address Finder is linked to the first address line.
- Enable Address Validation Based on Country Activates or deactivates the address validation tool depending on whether a supported territory is selected.
Make any necessary changes, and don’t forget to Save.
For additional key settings such as daily lookup limits or URL restrictions, check out our documentation on the API Key.
Advanced Configuration
If you need additional control over the plugin, there are some advanced settings available.
- Address Autocomplete Configuration Override This field is also blank by default (i.e., ""). Be careful when modifying this, as invalid input can disrupt address validation. This setting globally overrides the Address Finder configuration. For further information, consult the Address Finder library documentation.
- Postcode Lookup Configuration Override By default, this field is blank (i.e., ""). Use caution when making changes here, as incorrect input will prevent address validation from functioning. This setting globally overrides the default Postcode Lookup configuration. For more details, refer to the Postcode Lookup library documentation.
Save any changes made.
Step 4: Test the Integration
To make sure the address validation works:
- Go to your WooCommerce checkout page.
- Begin typing a UK address in the address field.
- The Ideal Postcodes address lookup tool should automatically suggest addresses as you type.
Elementor Integration
If you're using Elementor to design your WooCommerce checkout pages, you can still enable address validation with a few simple steps. This is necessary as Elementor disables the default page actions, which can prevent checkout plugins from functioning correctly. To resolve this issue, follow these steps:
Step 1. Add a PHP snippet to your WordPress Site
You can do this either by editing your functions.php
file or by using a PHP snippet plugin. The snippet defines a function that reactivates the WooCommerce-specific checkout hooks.
/**
* Re-invokes certain WooCommerce hooks to activate the Ideal Postcodes address validation plugin on checkout.
* Requires the shortcode "[do_woocommerce_hooks]" to be added to the checkout page.
*/
add_shortcode("do_woocommerce_hooks", function () {
// Loads JavaScript and CSS assets
do_action("woocommerce_before_checkout_form");
// Injects credentials and initializes above assets
do_action("woocommerce_before_checkout_form");
});
Step 2: Add the Shortcode to Your Custom Checkout Page
On your custom checkout page, include the following shortcode:
[do_woocommerce_hooks]
This will trigger the function you defined in Step 1, enabling the address validation feature. The Ideal Postcodes plugin will automatically activate on any standard WooCommerce checkout fields, so no additional setup is required within Elementor itself.
Step 3: Test
Test the address fields in Elementor to ensure the lookup tool works correctly. It should automatically suggest addresses as you type.
Troubleshooting
If you encounter any issues during installation or configuration:
- Make sure you’ve correctly entered your API key.
- Check if the plugin is up to date (you can update plugins via the WordPress admin panel).
- Ensure that your theme or page builder (Elementor, etc.) is compatible with WooCommerce and the Ideal Postcodes plugin.
Still need help? Contact our support team via live chat on our website or email support@ideal-postcodes.co.uk.