Postcode First, Arguments Later: A UK Address Form Pattern for Elementor Pro
Address forms are the plumbing of a client site: nobody praises them when they work, and everybody notices when they don't. In the UK the stakes are slightly higher because our addresses are not tidy. Postcodes are alphanumeric, counties are optional in practice, and the country is usually the United Kingdom — not a dropdown starting with Afghanistan. If you build the stock Elementor Pro form and hope for the best, you'll get the 9am complaint: 'It says my postcode is invalid.'
Here's a reusable pattern that behaves like a UK address form should, plus the test cases and privacy wording I'd use before handing a site over.
Start with the postcode, not the country list
UK users reach for the postcode first. It is the one part of the address they know cold, and it anchors the rest. Put the postcode field at the top of the address group, then address line 1, address line 2 (optional), town or city, county (optional), and country.
That last one needs a decision. If almost every enquiry comes from the UK, don't make people scroll through a country dropdown to find United Kingdom. Either hide the country field and store United Kingdom as a hidden value, or show a select with United Kingdom selected by default and only add Ireland or Crown Dependencies if you actually serve them. Do not list England, Scotland, Wales and Northern Ireland as countries — they are nations within the UK. If you need that data for a legal or delivery reason, add a separate optional 'Nation' field and label it clearly.
County is the other trap. In much of the UK it is optional, inconsistently used, and sometimes meaningless. Make it a text field labelled 'County (optional)' rather than a required select. A required county field is one of the fastest ways to lose a valid Belfast or rural Scottish address.
Build the field group in Elementor Pro
Use the Form widget and create a clear group with a heading such as 'Site address'. Elementor Pro does not give you a UK-specific address block, so build the fields yourself and keep the field IDs sensible: postcode, address_line_1, address_line_2, town_city, county, country.
A practical field pattern:
- Postcode — Text, required, placeholder
e.g. SW1A 1AA. If your version exposes custom attributes, addautocomplete='postal-code'andautocapitalize='characters'. - Address line 1 — Text, required,
autocomplete='address-line1'. - Address line 2 — Text, optional,
autocomplete='address-line2'. - Town or city — Text, required,
autocomplete='address-level2'. - County — Text, optional, label it as optional.
- Country — Select, default United Kingdom, or a Hidden field if you only serve the UK.
Keep labels visible. Placeholders are examples, not labels; they disappear as soon as someone types. On mobile, test the keyboard: postcode should not bring up a numeric keypad that blocks letters. Use inputmode='text' if needed.
Validation that bends instead of breaking
UK postcodes are not a single regex you can copy from a blog post and forget. They can be uppercase, lowercase, with a space, without a space, and there are special cases such as GIR 0AA. The goal is to catch obvious typos without rejecting valid addresses.
Use a broad pattern and normalise afterwards. Something like ^[A-Z]{1,2}[0-9][A-Z0-9]?\s?[0-9][A-Z]{2}$ with case-insensitive matching is a reasonable starting point. Then, on submission, trim spaces, uppercase the value, and insert the space before the final three characters if it is missing. If you use Elementor Pro's custom validation, keep the message human: 'That postcode looks incomplete — check the space and the last two letters.' Not 'Invalid input.'
If you need a snippet, hook into elementor_pro/forms/validation and check the field only when it is present. Keep the check forgiving. A form that accepts sw1a1aa and stores SW1A 1AA is better than a form that argues with a user in a hurry.
The addresses that break forms
Before launch, run these through the form on a phone and a desktop:
SW1A 1AA— London, with a space and mixed letters.CF10 3NB— Cardiff, two letters at the start.EH1 1YZ— Edinburgh, same pattern but different nation.BT1 1AA— Belfast; check you haven't made county mandatory.NR1 1AA— a shorter, ordinary postcode.GIR 0AA— the special Girobank postcode; if your regex rejects it, it is too strict.- Lowercase and no space:
sw1a1aa. - A flat or business address with address line 2 filled in.
- A rural address where the user leaves county blank.
Also test what happens when someone enters a postcode with a trailing space, or pastes one from Google Maps. The form should tidy it, not scold them.
Privacy wording that doesn't scare or mislead
An address is personal data. Under the UK GDPR, you need a lawful basis for collecting it, and you need to tell people what you are doing with it. Keep the wording short and specific: 'We'll use this address only to prepare your quote and arrange delivery. We keep enquiry details for 12 months. Read our privacy notice.' Link the notice.
Do not pre-tick a marketing consent box. If you want to add people to a newsletter, use a separate optional checkbox. If Elementor Pro is storing submissions in the site database and emailing them to the client, say so in the privacy notice. If you are pushing the address to a CRM or a delivery API, mention that too. The form should not ask for a full address if the client only needs a rough location for a quote; ask for the postcode and town first, then request the rest later.
The launch checklist
- Country defaults to United Kingdom, or is hidden if you only serve the UK.
- County is optional and labelled as such.
- Postcode is normalised before it reaches the email or CRM.
- Autocomplete attributes are present where your Elementor version supports them.
- Error messages tell the user how to fix the problem.
- The privacy notice link works and the retention period is stated.
- Test submissions arrive with the address intact, not split across the wrong fields.
- Spam protection does not block legitimate UK postcodes.
Address forms are not glamorous, but they are where a lot of client trust is won or lost. Build for the postcode people actually have, not the one in the tutorial, and the 9am phone call gets a lot less likely.