Part of the Country ecosystem · 6 projects
This module adds a standardized country selection field to your Drupal site, using the official country list provided by Drupal core. It offers multiple widget options, integrates with Views and Facets for searching and filtering, and can be used in custom forms.
Country adds a dedicated country field type to Drupal, backed by Drupal core's official country list. Attach it to any entity and let editors pick a country through a select list, autocomplete, radio buttons, checkboxes, or a Tagify-style tag input.
Values are stored as ISO 3166-1 alpha-2 codes (NL, BE, LU) and displayed as the localized country name or the raw ISO code, depending on the formatter you pick.
Features
- Core country list – Uses the official country list provided by Drupal core.
- Multiple widgets – Select list, autocomplete, checkboxes, radio buttons, and Tagify (when the Tagify module is installed).
- Restrict the selectable list – Per field storage or per field instance.
- Views integration – Sort and filter plugins for building country-aware listings.
- Facets support – A processor that shows country names instead of ISO codes in facet blocks.
- Feeds integration – Import country data from external sources.
- Form API element – Use
#type => 'country'in custom forms. - Token support – Country field values are available as tokens.
- Standards-based – Uses ISO 3166-1 alpha-2 country codes.
Why use Country?
Drupal core ships a country list but no country field. A semantic field type backed by that list integrates with Views, Facets, Tokens, Feeds, and the Form API without pulling in a full address module.
Integration
- Flags – The
flags_countrysubmodule adds country flag icons to Country fields and widgets. - Tagify – Enables a Tagify-based select widget for Country fields.
- IP-based Country – Prefills new Country fields with the visitor's country.
Comparison with related modules
Module Approach Best for Country A single-purpose country field type backed by Drupal core's country list. Sites that need to store and display a country value, with standard field and Views integration. Address Full international postal addresses via the commerceguys/addressing library, including a separate country field type. Sites that need validated, formatted postal addresses or subdivisions – use Address instead of (not alongside) this module when the full address model fits. Flags (flags_country submodule)
Adds flag icons to Country fields and widgets via CSS sprites.
Complementary – install together when you want visual flags next to country names.
IP-based Country
Looks up a visitor's country from their IP address.
Complementary – Country prefills new widgets with the lookup result when this module is enabled.
🤖 Assisted development
This module is maintained with the help of AI assistants for code generation, review, testing, and documentation. All code is carefully reviewed by the maintainers to ensure that quality and security standards are met.
Documentation
Ask your assistant about Country
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
- field Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
More in the Country ecosystem
Most installed first
Activity
Release Timeline
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 2.2.2 | Stable | 11 | Oct 31, 2026 | ||
| 2.2.1 | Stable | 11 | Oct 7, 2026 | ||
| 2.1.3 | Stable | 10–11 | Oct 7, 2026 | ||
| 2.2.0 | Stable | 11 | Aug 28, 2026 | ||
| 2.1.2 | Stable | 10–11 | Mar 27, 2026 | ||
| 2.1.1 | Stable | 10–11 | Nov 29, 2024 | ||
| 2.1.0 | Stable | 10–11 | Oct 25, 2024 | ||
| 2.0.1 | Stable | 10 | Apr 26, 2024 | ||
| 2.0.0 | Stable | 8–10 | Apr 26, 2024 | ||
| 8.x-1.1 | Stable | 8–10 | Jan 23, 2023 |