Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

This module allows you to use human-readable taxonomy term names in URLs for Views, converting them to their corresponding IDs for efficient querying. It provides a validation option for Views contextual filters, enabling you to use term names instead of numeric IDs while still benefiting from the most efficient database queries. This is particularly useful when you want cleaner URLs that are still performant.

About

Drupal 8's version of Views is included in core, and very powerful.

However, its handling of taxonomy terms is missing some important features, and can be confusing to configure properly.

The default contextual filter (aka "argument") for D8 taxonomy terms is called "Has taxonomy term ID", which builds the most efficient query to find content tagged with a given term.

In Drupal 7 and prior, there was an option on the "argument validator" for taxonomy terms called "Term name converted to Term ID" that would convert a term name into its corresponding term ID, exactly for use with this contextual filter. That allowed you to use the most direct, efficient query, but allow for human-readable URLs based on term names instead of numeric IDs.

This module restores that functionality by providing a "Term name into ID" option when configuring the validation for a Views contextual filter, primarily for use with the "Has taxonomy term ID" contextual filter.

Usage

  1. Install as a normal Drupal 8 module using your favorite method.
  2. Enable the module
  3. Build a view using the 'Has taxonomy term ID' contextual filter.
  4. Configure the contextual filter:
    1. Check the 'Specify validation criteria' checkbox.
    2. Under the 'Validator' selector, choose 'Taxonomy term name as ID'
    3. If your site has many vocabularies and the term name might not be unique across them, consider limiting which vocabularies to search by configuring the 'Vocabulary' checkboxes.
    4. Review other relevant validation settings (e.g. if you want to check access control, convert '-' to ' ' in the argument).
  5. Save your view.
  6. Rejoice.

Important note on uniqueness

The conversion of a term name into its numeric ID assumes there's only one term of a given name. If your site has multiple vocabularies that have terms with the same name, you'll almost certainly want to limit the validator to only search in a single vocabulary.

If you have a vocabulary with duplicate names, you probably want to force the arguments in the URLs to be numeric IDs and not use this validator at all. Or, you have to be careful with term weights and understand that the lightest weight term will be used in case of duplicates. Beware.

Related module

Views Taxonomy Term Name Depth is a somewhat similar module trying to address the same problem. However, that module takes a different approach, adds an entirely separate contextual filter, and leads to more complicated queries. Hence, the existence of views_taxonomy_term_name_into_id.

Depends on

Dependencies of the latest stable release

  • taxonomy Drupal core
  • views Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Nov 2025
Latest release
9 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Slowing

Releases

Version Type Core Release date
8.x-1.0 Stable 8–11 Nov 12, 2025