Country field autocomplete

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_country submodule 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

Supporting organizations: 
Maintenance and development

Project information

Releases