πŸŽ‰ Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!

How can we help you?

Find answers, tutorials, and guides to get the most out of Gravity Extra add-ons. (DEV Preview)

Gravity Forms Auto Populate Country, State, City & Ward Add-On Documentation

Last updated: October 6, 2026 β€’ Author: Bong Huynh
Table of Contents

The Gravity Forms Auto Populate Country, State, City & Ward Add-On provides high-speed, cascading dropdowns for geographic administrative divisions worldwide. Eliminate user frustration, standardize address data, and automatically filter states, cities, districts, wards, and postal codes based on the preceding geographic selectionβ€”powered by a local database with zero external API fees.

System Prerequisites & Technical Requirements

  • Gravity Forms v2.5 or higher installed and active.
  • MySQL 5.7+ or MariaDB 10.3+ with standard WordPress database table creation privileges.
  • PHP 7.4 or higher (PHP 8.1+ fully supported) with memory_limit of 128MB or higher for large geographic datasets.
  • Zero recurring external API keys requiredβ€”all geographic relationships run locally on your server.

Core Capabilities & Cascading Database Architecture

Traditional address forms rely on unlinked text fields where users frequently misspell city names, enter obsolete postal codes, or select invalid states. The Auto Populate Country, State, City & Ward addon introduces dynamic cascading logic: selecting a Country immediately filters the State/Province dropdown; selecting a State immediately populates the City dropdown; and in supported regions (such as Vietnam, Japan, and Southeast Asia), selecting a City dynamically populates District and Ward/Commune dropdowns.

Because the geographic hierarchy is queried directly from indexed WordPress database tables using lightweight AJAX endpoints, lookups execute in milliseconds with zero reliance on external third-party rate limits or metered billing.

Global Add-on Configuration & Hierarchy Settings
Figure 1: Global settings overview for managing geographic hierarchy and location database
Database Sync & Location Packs
Figure 2: Managing installed country packs and local geographic database tables

Step 1: Installation & Commercial License Activation

Download the plugin ZIP file from your Gravity Extra customer portal. In your WordPress admin dashboard, navigate to Plugins → Add New → Upload Plugin, select the gravityextra-gf-auto-populate-country-state-city-ward-addon.zip file, and click Install Now followed by Activate Plugin.

After activating, open Forms → Settings → Auto Populate Country/State/City/Ward to activate your commercial license key for automatic updates and technical support.

Step 2: Adding the Cascading Geographic Field to Your Form

Open the form editor for your target form. In the right-hand field toolbox under Advanced Fields, drag the Country/State/City/Ward field onto your form canvas.

Selecting Auto Populate Field in Form Editor
Figure 3: Locating the cascading geographic field inside the Gravity Forms toolbox
Adding Field to Form Canvas
Figure 4: Dragging and dropping the cascading location field into the form layout
Field Appearance and Responsive Column Layout
Figure 5: Configuring responsive multi-column layout for country, state, city, and ward inputs

Step 3: Configuring Cascading Dropdown Hierarchy

In the field settings panel, define how many levels of geographic depth you wish to display:

Cascading Dropdown Hierarchy Configuration
Figure 6: Configuring the hierarchical cascading relationship between location levels

1. Selecting Active Geographic Tiers

Choose which levels are required for your form:

  • 2-Level Hierarchy: Country → State / Province.
  • 3-Level Hierarchy: Country → State → City.
  • 4-Level Extended Hierarchy: Country → State → City → Ward / District.
State and Province Auto-Population Event Trigger
Figure 7: AJAX event trigger dynamically filtering states upon country selection
City and Ward Auto-Population Cascading Logic
Figure 8: Cascading city and ward population based on upstream state selection

Step 4: Default Values, Single-Country Mode & IP Geolocation

1. Default Country Selection

If the majority of your customers originate from a specific nation, set that country as the default selected option to speed up form completion.

Default Country Prefill Option
Figure 9: Setting default preselected country for incoming form visitors

2. Single Country Lockdown Mode

For strictly domestic businesses (e.g., local home delivery or municipal services), lock the form to a single country. The Country field automatically fixes to your target nation and immediately displays the appropriate states and cities.

Single Country Lockdown Mode
Figure 10: Locking form to a single country for localized domestic forms

3. Automatic IP Geolocation Detection

Enable the Detect User’s Country by IP toggle. The add-on analyzes the visitor’s IP address upon page render and automatically pre-populates their country of origin.

Real-Time IP Geolocation Auto-Detection
Figure 11: Auto-detecting visitor country via server-side IP geolocation

4. Multi-Country Whitelisting

If your organization only services select international markets, configure a multi-country whitelist. Only designated nations will appear in the primary dropdown menu.

Multi-Country Whitelist Selection
Figure 12: Filtering visible countries to approved regional operating zones

Step 5: Managing Custom Locations & Fallback Text Input

1. Database Management & Custom Administrative Divisions

Need to add newly established municipalities, private industrial parks, or custom delivery zones? Use the built-in location manager to add, edit, or remove entries directly.

Location Database Management Panel
Figure 13: Viewing and editing location records within the WordPress admin panel
Adding Custom Administrative Divisions
Figure 14: Creating custom state, province, or municipal records
Custom Database Table Schema & Performance Indexing
Figure 15: Optimized database schema with composite indexes for lightning-fast queries
Bulk CSV Import and Export
Figure 16: Importing custom enterprise location hierarchies via structured CSV files

2. Fallback Custom Text Input Setting

Enable the Allow custom input if data not found toggle. If a user cannot find their specific locality, a clean text input appears allowing them to type their location manually.

Fallback Custom Text Input Setting
Figure 17: Enabling manual text entry when a location is missing from the database

Step 6: Frontend Searchable Select & Postal Code Matching

Enhance the frontend user experience with modern searchable select elements and automatic postal code resolution:

Searchable Select2 Dropdown Enhancement
Figure 18: Searchable dropdown interface with real-time text matching
ZIP and Postal Code Auto-Matching Based on City
Figure 19: Automatically matching and pre-filling postal codes based on selected city
Ward and Commune Dropdown Support for Southeast Asia
Figure 20: 4th-tier administrative ward and commune support for Vietnam and regional Asian forms
Live Frontend Cascading Dropdown Preview
Figure 21: Live interactive preview of cascading dropdowns in action

Step 7: Conditional Logic, Internationalization & Entry Storage

Seamlessly integrate cascading geographic selections with Gravity Forms conditional logic and multi-language sites:

Conditional Logic Rules Driven by Location
Figure 22: Triggering conditional payment methods, shipping rates, or form sections based on selected state or city
Multilingual Support and WPML Localization
Figure 23: Translating geographic labels and location names across multilingual setups
Address Confirmation and Modal Verification View
Figure 24: Front-end address confirmation summary prior to final form submission
Geographic Zone Lead Routing
Figure 25: Routing form entries to regional sales reps based on selected administrative territory
Entry Storage with Clean Division Names
Figure 26: Stored Gravity Forms entry detail displaying verified cascading location hierarchy
Entry Detail with Full Administrative Hierarchy
Figure 27: Comprehensive entry record showcasing country, state, city, and ward values

Troubleshooting & Common Issues

Issue Encountered Probable Cause Recommended Resolution
State dropdown remains empty after Country selected Database tables missing or WordPress AJAX blocked by firewall. Go to Forms → Settings → Auto Populate and click Rebuild Database Tables. Verify admin-ajax.php is not blocked.
Dropdown styles look unstyled or misaligned Theme CSS overriding standard Select2 / TomSelect styles. Enable the Enforce Add-on CSS toggle in field appearance settings.
Large country packs timing out during import PHP max_execution_time or memory limit reached. Increase PHP memory to 256M and execution time to 120s in php.ini, or import countries individually.

Frequently Asked Questions (FAQ)

Does this add-on charge per lookup or API call?

No! Unlike Google Maps or third-party geocoding APIs that charge per request, all location data lives in your local WordPress database with zero API usage fees.

How many countries are supported out of the box?

Over 240+ countries and territories are supported with full state/province data, and extensive city/ward datasets for major global markets.

Can I use this field with WooCommerce checkout via Gravity Forms Product Addons?

Yes, the cascading fields pass selected values directly into WooCommerce cart metadata and final order records.

Can I export entries with full division names instead of IDs?

Yes, the add-on stores clean text representations (e.g., “California”, “Los Angeles”) ensuring CSV exports and webhook payloads are immediately human-readable.

Is the dropdown accessible and mobile friendly?

Yes, full ARIA attributes, keyboard navigation (up/down arrow selection), and mobile touch optimization are fully supported.

Ready to Supercharge Your Workflow?

Streamline geographic address entry with blazing-fast cascading dropdowns, zero API fees, and local database reliability.

Get Gravity Forms Auto Populate Country, State, City & Ward →

Was this article helpful?

Let us know how we can improve our docs.

0
0
Your Cart
Your cart is emptyReturn to Shop
πŸ”₯ FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr
⚑

Max β€” GravityExtra Copilot

Online β€’ AI Copilot
🎁 15% VIP Discount Coupon
πŸ” Find My Addon πŸ“¦ All-Access Pass ⚑ Compatibility 🎁 Claim 15% Off