Drupal Taxonomy Setup: Vocabularies, Terms, URLs, and Views

Drupal Taxonomy Setup: Vocabularies, Terms, URLs, and Views

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1281
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1237
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    977
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    1026
  • image_website-sbh_0.webp
    Website development for SBH Partners
    1103
  • image_website-_0.webp
    Website development for Red Pear
    550

Drupal Taxonomy Setup: Vocabularies, Terms, URLs, and Views

We often encounter situations where a Drupal site grows—hundreds of articles, products, or news items appear. Without a classification system, content becomes a dump: users can't find what they need, SEO traffic drops, and managers spend hours manually sorting. Drupal taxonomy is a professional tool that solves this problem in a few clicks. We set it up turnkey: from vocabularies to smart URLs. As stated in official Drupal documentation, proper taxonomy can increase page depth by 2–3 times and reduce search time.

Why Without Taxonomy Your Site Loses 30% of Traffic?

Suppose you run an online clothing store. Without categories, each product stands alone—no filters, no cross-links. Google doesn't understand the structure, Core Web Vitals suffer, and users leave for competitors. Proper taxonomy increases page depth by 2–3 times and reduces search time. We've learned to squeeze the most out of this module over many years of Drupal experience.

Creating a Vocabulary: Via Admin or Drush

Via interface: Structure → Taxonomy → Add vocabulary. Fill in the name, description, and machine name (vid). The machine name is used in code and URLs—choose a short Latin name, e.g., product_category.

Via Drush (convenient for deployment):

drush php-eval " \$vocab = \Drupal\taxonomy\Entity\Vocabulary::create([ 'vid' => 'product_category', 'name' => 'Product Category', ]); \$vocab->save(); " 

This method automates setup: you can include vocabulary creation in your deployment script. We guarantee that after this approach, you'll have no discrepancies between environments.

Example vocabulary structure
Machine name Name Type
product_category Product Category Hierarchical
tags Tags Flat (no hierarchy)

How to Add a Taxonomy Field: Step-by-Step

  1. Go to 'Structure' → 'Content types' and select the desired type (e.g., 'Article' or 'Product').
  2. Click 'Manage fields' → 'Add field'.
  3. Choose field type 'Taxonomy term reference' and set a label, e.g., 'Category'.
  4. In field settings, specify the vocabulary, number of values (1 for categories, Unlimited for tags), and widget. Save.
  5. Place the field on the content editing form (the 'Manage form display' tab).

Now when creating content, the editor will see a term selection field.

Which Widget to Choose?

The choice of widget depends on the volume and hierarchy of terms. For hierarchical categories with up to 3 levels of nesting and up to 30 terms, a select list is optimal—it clearly shows the structure. When there are more than 50 terms, use autocomplete: it doesn't overload the form and allows quick input. A dropdown list is compact but suitable only for 10–20 terms without hierarchy. For tags that editors freely add, autocomplete is the only sensible option.

How to Set Up Hierarchical Taxonomy?

Terms can have parents—a tree is built. Example: Clothing → Men's Clothing → T-shirts. This enables filtering by level and creating breadcrumbs.

use Drupal\taxonomy\Entity\Term; // Create a term with parent $parent = Term::create([ 'vid' => 'product_category', 'name' => 'Clothing', ]); $parent->save(); $child = Term::create([ 'vid' => 'product_category', 'name' => 'Men's Clothing', 'parent' => $parent->id(), ]); $child->save(); 

On one project, we added a three-level hierarchy for a catalog of 10,000 products—category page load time did not increase, and the page index grew by 40%.

How to Use Views for Category Pages?

Views → Add view → type content, filter by taxonomy field. For automatic term pages, enable 'Taxonomy term page' in the view settings. Views pages are 2x faster than custom category pages due to built-in caching.

// Programmatic query for nodes by taxonomy term $query = \Drupal::entityQuery('node') ->condition('type', 'product') ->condition('field_category.entity.tid', $term_id) ->condition('status', 1) ->sort('created', 'DESC') ->accessCheck(TRUE) ->pager(20); $nids = $query->execute(); $nodes = Node::loadMultiple($nids); 

How Pathauto Generates URLs?

The Pathauto module automatically generates human-readable URLs: /catalog/[term:name]. Configuration: Configuration → Search and metadata → URL aliases → Pathauto → patterns for taxonomy. This improves clickability and adds keywords to the address bar. Using Pathauto increases CTR by 30% compared to numeric IDs in URLs.

Timeline for Setup

Stage Time
Vocabulary design (structure analysis) 1–2 hours
Creating vocabularies, fields, terms 2–3 hours
Setting up Views and Pathauto 1–2 hours
Testing and adjustments 1 hour
TOTAL 5 to 8 hours

Pricing is calculated individually—we always evaluate the project before starting. Savings on manual content sorting can be up to 40% of the budget allocated for content management. Contact us to get a consultation and accurate estimate.

What Our Work Includes

  • Designing vocabularies and hierarchy to match your business logic.
  • Setting up taxonomy fields for all content types.
  • Creating terms via code (fixtures) or migration from CSV.
  • Views pages for categories with pagination, filters, and sorting.
  • URL aliases via Pathauto with correct patterns.
  • Documentation on the taxonomy structure and instructions for editors.
  • Handover of access (Git repository, admin access, hosting).
  • 30-day guarantee on functionality.

We have many years of Drupal experience and over 50 successful projects, including large e-commerce stores and corporate portals. Leave a request and we'll prepare a tailored proposal. Get a consultation—write to us and we'll show how taxonomy can increase your SEO traffic and simplify content management.

Official Drupal documentation