Don’t forget to subscribe to our YouTube channel to stay up-to-date.
The Taxonomy Manager module provides a different user interface for the management of taxonomy terms, particularly in batch operation. Terms can be added or deleted in bulk, instead of one by one. In addition, it provides features to export all taxonomy terms and search. This terms-export feature is beneficial for transferring the terms in bulk from one site to another.
In this tutorial, you’ll learn how to install and use the Taxonomy Manager module.
To get started, we need to install the Taxonomy Manager module, which also requires the jQuery UI module. Simply run the following Composer command, which also manages the site dependencies:
composer require 'drupal/taxonomy_manager:^2.0'
After installation, enable it under Administration >> Extend >> List
After installing and enabling the module, a configuration page can be found by going to Administration >> Configuration >> User Interface >> Taxonomy Manager
Following is the configuration page:
If there are really a lot of taxonomy terms, we can increase the ‘Page count’ here. For now, we shall leave everything as default in our example.
Using Taxonomy Manager
At this stage, everything is ready. Go to Administration >> Structure >> Taxonomy Manager.
It starts by providing a list of all vocabularies created in the site. In our example of a new site, ‘Tags’ is the only vocabulary available by default.
How to Bulk Import Terms
When a new site is built, by default, the taxonomy is empty, and there is only one vocabulary: ‘ Tags’. If we click into ‘Tags’, we shall enter the screen for managing terms under ‘Tags’:
In this example, we work on a new site, and terms under ‘Tags’ are empty. We can enter all the terms in bulk in the space provided under ‘Terms’, by following these rules:
- One term per line
- Child terms can be prefixed with a dash ‘-’
- One dash per hierarchy level, two dash the next level, etc
In case we already have all the terms prepared, or from other sites, we can just enter them here. Likewise, terms in this site can be copied to another site similarly. Following are some terms as example:
-Hosting -Site building
These terms are copied and pasted to the empty space, followed by pressing the ‘Add’ button. The empty screen will be changed to the following. Now all the terms belonging to ‘Tags’ have been entered.
Expanding the created terms under Tags on the left, more details of individual selected terms will appear on the right:
Add New Terms to Existing Vocabulary in Bulk
Apart from importing terms to an empty vocabulary, new terms can also be added in bulk to an existing vocabulary. To do this, there should be a consideration where in the hierarchical tree these new terms should be added. Taxonomy Manager provides this functionality:
- Select the term under which new terms to be added
- Press the ‘Add’ button in the Toolbar on the top
- In the pop-up screen, enter the new terms in bulk in the empty space under ‘Terms’
- Decide whether or not to create the new terms in the order in the list
- Press the ‘Add’ button
This can be summarized in the following picture:
In this example, the following new structure will be seen after adding the new terms:
Deleting Terms in Bulk
Terms can be deleted in bulk quickly. Simply by:
- Selecting the checkboxes of those terms to be deleted;
- Press the ‘Delete’ button in the Toolbar on the top;
- In the pop-up screen, decide whether or not to also delete the children of the selected terms, then press the ‘Delete’ button.
Exporting All the Terms
All terms under ‘Tags’ can now be exported easily by:
- Select the vocabulary. In our example of a new site, there is only one vocabulary, which is ‘Tags’
- Press ‘Export all’ in the Toolbar
- All the terms under ‘Tags’ will pop-up now showing all the terms under ‘Tags’. Manually select all the terms here and paste it as text somewhere safe.
This is also how the terms in a vocabulary can be easily copied from one site and transferred to another. It is actually similar to adding terms in bulk described above, where terms can be copied from another site to this site. Now in reverse, terms exported can be copied to another site.
Managing Individual Terms
Details of individual taxonomy terms can also be managed in the Taxonomy Manager. All these functions are already available in the default Taxonomy module user interface. They should be pretty straight-forward and will not be further explained here.
It is good to have this function here too, instead of jumping back and forth to the traditional interface.
Search of Taxonomy Terms
The Taxonomy Manager also provides a ‘Search’ button in the Toolbar for searching of taxonomy terms. When the number of terms is large, this search function can be very helpful.
Re-ordering of Taxonomy Terms
Please note there is no special means for re-ordering of terms in the Taxonomy Manager user interface. To reorder terms, we still need to return to the default Taxonomy module at Administration >> Structure >> Taxonomy.
The Taxonomy Manager module is a simple module to provide a more convenient user interface to manage taxonomy terms in bulk. It also provides the means to transfer taxonomy terms from one site to another. When the number of terms is large, this is a great way to manage taxonomy terms.
Taxonomy is an essential area for content management. It plays an important role not only for users in finding the right content, but also some other more advanced applications. There are other modules available in this area. Interested users might also want to look into modules like Term Merge or Synonyms.