Tutorials

How to Customize Address Field Components in WordPress Forms

How to Customize Address Field


Shipping labels, event registrations, and checkout forms all need addresses — but not every form needs the same address parts. A US-only delivery form can hide the country field and use a state dropdown. An international contact form needs country selection and flexible postal labels. A simple RSVP might only need city and region.

Auto Form Builder includes a dedicated Address field with address type presets, toggleable components, country defaults, validation levels, and layout options — so you can tailor every part of the address without writing custom code.

Last updated: Last update 14 July

What Are Address Field Components?

An address field is not a single text box. It is a group of related inputs — each one an address component — that together capture a complete location. Auto Form Builder supports these components:

  • Address Line 1 — Street address (always included)
  • Address Line 2 — Apartment, suite, unit, or floor
  • City — Always included
  • State/Province/Region — State, province, county, or region
  • ZIP/Postal Code — Postal or ZIP code
  • Country — Country dropdown
  • Company/Organization — Business or organization name

You choose which components appear on your form. Address Line 1 and City are always shown; every other component is optional.

Start with an Address Type Preset

The fastest way to customize address components is to pick an Address Type Preset in field settings. Each preset configures visibility, labels, country behavior, and validation for a specific region:

International

Works with addresses from any country worldwide. Shows country selection, uses generic labels like “State/Province/Region” and “ZIP/Postal Code,” and applies lenient validation to accept real-world international variations.

United States

Optimized for US addresses. Sets the default country to US, hides the country field, enables a state dropdown, labels the region field “State” and postal field “ZIP Code,” and applies strict ZIP validation.

Canada

Optimized for Canadian addresses. Defaults to Canada, hides the country field, uses a province/territory dropdown, labels postal as “Postal Code,” and validates Canadian postal code format.

United Kingdom

Optimized for UK addresses. Defaults to GB, hides the country field, uses a county/country dropdown, labels postal as “Postcode,” and validates UK postcode format.

European Union

Optimized for EU member countries. Shows and requires country selection, restricts the country list to EU nations, and uses lenient validation due to varied European postal systems.

Custom

Starts with neutral defaults and exposes all advanced settings immediately — use this when you want full manual control over every component.

After selecting a preset, click Show Advanced Settings on any non-Custom preset to fine-tune individual components without starting from scratch.

Customize Which Address Parts to Include

Under Address Components in advanced settings, toggle each part on or off:

Address Line 2

Enable for apartment numbers, suite numbers, unit numbers, or building names. Disable for forms where a single street line is enough — such as a simple local event signup.

State/Province/Region

Enable when you need regional data for shipping, tax, or routing. Disable for city-only forms or when region is not relevant to your workflow.

With the United States, Canada, or United Kingdom preset, the region field renders as a dropdown of states, provinces, or counties automatically.

ZIP/Postal Code

Enable for delivery and billing forms. With strict validation on country-specific presets, postal codes are checked against country patterns (for example, US ZIP or UK postcode formats).

Country

Enable for international audiences. Disable visually using Hide Country Field when you set a default country and only serve one region — common for US-only or UK-only forms.

Company/Organization

Enable for B2B forms, invoice requests, or corporate registrations where the submitter’s organization name is required alongside the physical address.

Country Settings

Default Country

Pre-select a country in the dropdown so visitors in a known region see the correct default. Leave blank to require visitors to choose their country — best for truly global forms.

Hide Country Field

When enabled, the country dropdown is hidden on the frontend and the default country is used automatically. This requires a default country to be set. Ideal for domestic-only forms where showing a country selector adds unnecessary friction.

United States, Canada, and United Kingdom presets enable this automatically with their respective default countries.

Validation Strictness

Choose how strictly postal codes and formatting are enforced:

  • Lenient — Accepts most real-world variations. Recommended for International and European Union presets where postal formats vary widely.
  • Strict — Enforces exact country-specific postal patterns. Used automatically by United States, Canada, and United Kingdom presets for accurate domestic validation.

On the frontend, strict presets apply pattern validation to postal fields — for example, US ZIP codes (12345 or 12345-6789), Canadian postal codes (A1A 1A1), and UK postcodes (SW1A 1AA).

Layout and Display Modes

Structured vs One-line

Under Address Mode, choose:

  • Structured (Multiple input fields) — Separate inputs for each address component. Best for data you need to query, export, or use in shipping integrations.
  • One-line (Single text input) — A single textarea where visitors paste or type their full address. The server parses the input into components on submission. Best for simple contact forms where structured data is less critical.

Stacked vs Inline layout

In structured mode, choose Field Layout:

  • Stacked (Vertical layout) — One component per row. Clear on mobile and accessible.
  • Inline (Horizontal layout) — Components arranged horizontally where possible. Saves vertical space on desktop forms.

City and region render side by side in a row, as do postal code and country when both are visible.

Step-by-Step: Customize Address Components

Step 1: Add an Address field

Drag the Address field from the Advanced category into your form.

Step 2: Select an Address Type Preset

Open field settings and choose the preset that matches your audience — International, United States, Canada, United Kingdom, European Union, or Custom.

Step 3: Open advanced settings

Click Show Advanced Settings (or use the Custom preset to see all options immediately).

Step 4: Toggle address components

Under Which address parts to include?, enable or disable Address Line 2, State/Province/Region, ZIP/Postal Code, Country, and Company/Organization.

Step 5: Configure country behavior

Set a default country and optionally hide the country field for domestic-only forms.

Step 6: Set validation and layout

Choose lenient or strict validation, structured or one-line mode, and stacked or inline layout.

Step 7: Adjust base field settings

Set the field label, help text, placeholder, width, and whether the entire address field is required. Use conditional logic to show or hide the address field based on other answers.

Step 8: Test and preview

Preview the form, submit a test entry, and confirm each component appears correctly in the submissions inbox with individual values stored separately.

Recommended Component Setups by Use Case

US shipping form

  • Preset: United States
  • Components: Line 1, Line 2, City, State, ZIP
  • Country hidden with US default
  • Validation: Strict

International contact form

  • Preset: International
  • Components: Line 1, City, Region, Postal, Country
  • No default country
  • Validation: Lenient

EU business registration

  • Preset: European Union
  • Components: Organization, Line 1, Line 2, City, Region, Postal, Country
  • Country required and restricted to EU nations

Simple local event RSVP

  • Preset: Custom
  • Components: Line 1, City only — disable region, postal, and country
  • Mode: Structured, layout Stacked

Quick “mailing address” on a contact form

  • Preset: International or country-specific preset
  • Mode: One-line — single textarea for the full address

Additional Address Field Options

Browser autocomplete

Enable Browser Autocomplete to add HTML autocomplete attributes so browsers can suggest previously entered addresses — speeding up repeat submissions for logged-in or returning visitors.

Dynamic labels

Region and postal labels update based on the selected country and preset — for example, “State” for US addresses, “Province/Territory” for Canada, and “Postcode” for the UK. International presets use neutral labels that work across regions.

Conditional logic

Show the address field only when relevant — such as when a visitor selects “Ship to my address” instead of “Pick up in store” — using conditional logic in base field settings with AND/OR rule groups.

Hidden field mode

Pass a fixed address value without user input using the Hidden Field option — useful for internal or pre-filled campaign forms.

Structured submission storage

Each address component is stored individually in submission records — organization, address lines, city, region, postal code, and country — along with formatted single-line and multi-line versions for display and export.

Field width and styling

Set the address field to full, half, one-third, or two-thirds width. Add a custom CSS class for theme-specific styling through the base field settings.

Common Mistakes to Avoid

  • Showing country on a domestic-only form — Use a country-specific preset or hide the country field with a default country set.
  • Strict validation on international forms — Lenient mode accepts the wide variety of global postal formats; strict mode is best for single-country forms.
  • Disabling postal code on shipping forms — Carriers and label printers need postal codes for accurate delivery.
  • Using one-line mode when you need structured export data — Structured mode stores each component separately for CRM, shipping, and spreadsheet export.
  • Forgetting to test after changing components — Always submit a test entry after toggling components to confirm validation and storage behave as expected.

Frequently Asked Questions

Which address components can I customize in Auto Form Builder?

You can toggle Address Line 2, State/Province/Region, ZIP/Postal Code, Country, and Company/Organization. Address Line 1 and City are always included. Presets configure sensible defaults for each region.

What is the difference between address presets?

International works worldwide with lenient validation. United States, Canada, and United Kingdom presets hide the country field, set a default country, use region dropdowns, and apply strict postal validation. European Union restricts country selection to EU members. Custom gives you full manual control.

Can I hide the country field on domestic forms?

Yes. Set a default country and enable Hide Country Field in Country Settings. US, Canada, and UK presets do this automatically.

What is structured vs one-line address mode?

Structured mode shows separate inputs for each address component — best for shipping and structured data. One-line mode uses a single textarea and parses the address into components on the server — best for simple contact forms.

Are address components stored separately in submissions?

Yes. Each component — organization, address lines, city, region, postal code, and country — is stored individually in submission records, along with formatted single-line and multi-line address versions for display and export.

Is the Address field included in the free plugin?

Yes. The Address field with presets, component toggles, country settings, validation levels, layout modes, and structured storage is included free in Auto Form Builder from WordPress.org.

Get Started with Auto Form Builder

Add an Address field, pick the preset that fits your audience, toggle the components you need, and collect clean structured address data — whether your form serves one country or the whole world.

Download:
Auto Form Builder on WordPress.org

Plugin last updated: Last update 14 July

Build forms that embed anywhere — free

Auto Form Builder lets you create multi-step forms, calculators, and lead capture forms in WordPress, then embed them on any site with a single line of code.

Install the free plugin

Leave a Reply

Your email address will not be published. Required fields are marked *