Title: Taxonomy Dropdown Widget
Author: Erick Hitter
Published: <strong>Nopémber 17, 2009</strong>
Last modified: Januari 19, 2026

---

Search plugins

![](https://s.w.org/plugins/geopattern-icon/tag-dropdown-widget.svg)

# Taxonomy Dropdown Widget

 By [Erick Hitter](https://profiles.wordpress.org/ethitter/)

[Download](https://downloads.wordpress.org/plugin/tag-dropdown-widget.2.3.3.zip)

 * [Details](https://su.wordpress.org/plugins/tag-dropdown-widget/#description)
 * [Reviews](https://su.wordpress.org/plugins/tag-dropdown-widget/#reviews)
 *  [Installation](https://su.wordpress.org/plugins/tag-dropdown-widget/#installation)
 * [Development](https://su.wordpress.org/plugins/tag-dropdown-widget/#developers)

 [Support](https://wordpress.org/support/plugin/tag-dropdown-widget/)

## Description

Creates dropdown lists of non-hierarchical taxonomies (such as `post tags`) as an
alternative to term (tag) clouds. Multiple widgets can be used, each with its own
set of options.

Numerous formatting options are provided, including maximum numbers of terms, term
order, truncating of term names, and more.

Using the `taxonomy_dropdown_widget()` function, users can generate dropdowns for
use outside of the included widget.

**Only use version 2.2 or higher with WordPress 4.2 and later releases.** WordPress
4.2 changed how taxonomy information is stored in the database, which directly impacts
this plugin’s include/exclude term functionality.

This plugin was formerly known as the `Tag Dropdown Widget`. It was completely rewritten
for version 2.0.

**Follow and contribute to development on GitHub at https://github.com/ethitter/
Taxonomy-Dropdown-Widget.**

## Installation

 1. Upload taxonomy-dropdown-widget.php to /wp-content/plugins/.
 2. Activate plugin through the WordPress Plugins menu.
 3. Activate widget from the Appearance > Widgets menu in WordPress.
 4. Set display options from the widget’s administration panel.

## FAQ

### What happened to the Tag Dropdown Widget plugin?

Since I first released this plugin in November 2009, WordPress introduced custom
taxonomies and, as more-fully discussed below, saw a new widgets API overtake its
predecessor. As part of the widgets-API-related rewrite, I expanded the plugin to
support non-hierarchical custom taxonomies, which necessitated a new name for the
plugin.

### Why did you rewrite the plugin?

When I first wrote the Tag Dropdown Widget plugin (and it’s sister Tag List Widget),
WordPress was amidst a change in how widgets were managed. I decided to utilize 
the old widget methods to ensure the greatest compatibility at the time. In the 
nearly two years since I released version 1.0, the new widget system has been widely
adopted, putting this plugin at a disadvantage. So, I rewrote the plugin to use 
the new widget API and added support for non-hierarchical taxonomies other than 
just post tags.

### I upgraded to version 2.0 and all of my widgets disappeared. What happened?

As discussed above, WordPress’ widget system has changed drastically since I first
released this plugin. To facilitate multiple uses of the same widget while allowing
each to maintain its own set of options, the manner for storing widget options changed.
As a result, there is no practical way to transition a widget’s options from version
1.7 to 2.0.

### If my theme does not support widgets, or I would like to include the dropdown outside of the sidebar, can I still use the plugin?

Insert the function `<?php if( function_exists( 'taxonomy_dropdown_widget' ) ) echo
taxonomy_dropdown_widget( $args, $id ); ?>` where the dropdown should appear, specifying`
$args` as an array of arguments and, optionally, `$id` as a string uniquely identifying
this dropdown.

 * taxonomy – slug of taxonomy for dropdown. Defaults to `post_tag`.
 * select_name – name of first (default) option in the dropdown. Defaults to `Select
   Tag`.
 * max_name_length – integer representing maximum length of term name to display.
   Set to `0` to show full names. Defaults to `0`.
 * cutoff – string indicating that a term name has been cutoff based on the `max_name_length`
   setting. Defaults to an ellipsis (`&hellip;`).
 * limit – integer specifying maximum number of terms to retrieve. Set to `0` for
   no limit. Defaults to `0`.
 * orderby – either `name` to order by term name or `count` to order by the number
   of posts associated with the given term. Defaults to `name`.
 * order – either `ASC` for ascending order or `DESC` for descending order. Defaults
   to `ASC`.
 * threshold – integer specifying the minimum number of posts to which a term must
   be assigned to be included in the dropdown. Set to `0` for now threshold. Defaults
   to `0`.
 * incexc – `include` or `exclude` to either include or exclude the terms whose 
   IDs are included in `incexc_ids`. By default, this restriction is not enabled.
 * incexc_ids – comma-separated list of term IDs to either include or exclude based
   on the `incexc` setting.
 * hide_empty – set to `false` to include in the dropdown any terms that haven’t
   been assigned to any objects (i.e. unused tags). Defaults to `true`.
 * post_counts – set to `true` to include post counts after term names. Defaults
   to `false`.

### Why are the makeTagDropdown(), TDW_direct(), and generateTagDropdown() functions deprecated?

Version 2.0 represents a complete rewrite of the original Tag Dropdown Widget plugin.
As part of the rewrite, all prior functions for generating tag dropdowns were deprecated,
or marked as obsolete, because they are unable to access the full complement of 
features introduced in version 2.0. While the functions still exist, their capabilities
are extremely limited and they should now be replaced with `taxonomy_dropdown_widget()`.

### Where do I obtain a term’s ID for use with the inclusion or exclusion options?

Term IDs can be obtained in a variety of ways. The easiest is to visit the taxonomy
term editor (Post Tags, found under Posts, for example) and, while hovering over
the term’s name, looking at your browser’s status bar. At the very end of the address
shown in the status bar, the term ID will follow the text “tag_ID.”

You can also obtain the term ID by clicking the edit link below any term’s name 
in the Post Tags page. Next, look at your browser’s address bar. At the very end
of the address, the term ID will follow the text “tag_ID.”

### I’d like more control over the tags shown in the dropdown. Is this possible?

This plugin relies on WordPress’ `get_terms()` function (https://codex.wordpress.
org/Function_Reference/get_terms). To modify the arguments passed to this function,
use the `taxonomy_dropdown_widget_options` filter to specify any of the arguments
discussed in the Codex page for `get_terms()`.

To make targeting a specific filter reference possible should you use multiple instances
of the dropdown (multiple widgets, use of the `taxonomy_dropdown_widget()` function,
or some combination thereof), the filter provides a second argument, `$id`, that
is either the numeric ID of the widget’s instance or the string provided as the 
second argument to `taxonomy_dropdown_widget()`.

## Reviews

![](https://secure.gravatar.com/avatar/ef5805e0c3cf625c91c47cbf6f563d370ff6b07403cc3adfd2f70d33eb1aab40?
s=60&d=retro&r=g)

### 󠀁[Bellisimo!](https://wordpress.org/support/topic/bellisimo/)󠁿

 [rowhouse](https://profiles.wordpress.org/rowhouse/) Oktober 28, 2020

This was a life saver. Exactly, and I mean, exactly what I needed. The client was
dead set against a Tag Cloud and after some rigorous searching, I kept coming back
to this page. Thank you Erick. You made it look easy!

![](https://secure.gravatar.com/avatar/ecf00bc0be2c0da088701bd284cdea9a4c411045eb294a6e19c54ebb32312d05?
s=60&d=retro&r=g)

### 󠀁[could be perfect](https://wordpress.org/support/topic/could-be-perfect-2/)󠁿

 [samcaio](https://profiles.wordpress.org/samcaio/) Juni 8, 2020

This is great plugin but the problem is that it doe’s not sync with other filters
and also reset button is not working.

![](https://secure.gravatar.com/avatar/52599b6aa11e1fa1876de4b65d11f6f9f865c140470babd3cddd46fd3cd3e903?
s=60&d=retro&r=g)

### 󠀁[Great Pluign.](https://wordpress.org/support/topic/great-pluign-5/)󠁿

 [kaisar10](https://profiles.wordpress.org/kaisar10/) April 22, 2020

Fulfills my requirement.

![](https://secure.gravatar.com/avatar/d3d0a4c7376a87cf9e09e8bde69755ebfef9e238d9db168ad406f13ac4f9349e?
s=60&d=retro&r=g)

### 󠀁[PHP 7.3 error message](https://wordpress.org/support/topic/php-7-3-error-message/)󠁿

 [Qualiweaver](https://profiles.wordpress.org/qualiweaver/) Maret 1, 2019 1 reply

Looks and works great. Could you just provide a tiny update to help get rid of the
PHP 7.3 error message that I can’t remove and which is displayed in the top area
of the login page? FYI, the error message is the following: Warning: “continue” 
targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /
home/directory/www/module/wp-content/plugins/tag-dropdown-widget/tag-dropdown-widget.
php on line 430. I could not find any info intelligible enough to fix this by myself.
All I did so far is check that WP_DEBUG is set to false in wp-config.php. Many thanks
in advance

![](https://secure.gravatar.com/avatar/31a0187fa7817d4170a2129c050207ce4e945f097142303e5b0b0fe52daa3c98?
s=60&d=retro&r=g)

### 󠀁[Does what is says it would.](https://wordpress.org/support/topic/does-what-is-says-it-would/)󠁿

 [Bjarni Wark](https://profiles.wordpress.org/bjarni-wark/) Méi 1, 2017

Thanks for your work and making it public, worked a treat.

![](https://secure.gravatar.com/avatar/5edde81d051eff975fb372fba9c329ee3771a9f25345de24af5cab4870759bd5?
s=60&d=retro&r=g)

### 󠀁[Excellent!](https://wordpress.org/support/topic/excellent-4478/)󠁿

 [Ramakrishnan R](https://profiles.wordpress.org/ramki002/) Pébruari 11, 2017

Very Usefull

 [ Read all 9 reviews ](https://wordpress.org/support/plugin/tag-dropdown-widget/reviews/)

## Contributors & Developers

“Taxonomy Dropdown Widget” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Erick Hitter ](https://profiles.wordpress.org/ethitter/)

[Translate “Taxonomy Dropdown Widget” into your language.](https://translate.wordpress.org/projects/wp-plugins/tag-dropdown-widget)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/tag-dropdown-widget/),
check out the [SVN repository](https://plugins.svn.wordpress.org/tag-dropdown-widget/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/tag-dropdown-widget/)
by [RSS](https://plugins.trac.wordpress.org/log/tag-dropdown-widget/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 2.3.3

 * Correct hook used to load plugin textdomain.

#### 2.3.2

 * Ready plugin for translation.

#### 2.3.1

 * PHP 7.3 compatibility

#### 2.3

 * Update for WordPress 4.3 by removing PHP4-style widget constructor usage (https://
   make.wordpress.org/core/2015/07/02/deprecating-php4-style-constructors-in-wordpress-
   4-3/).

#### 2.2

 * Update for WordPress 4.2 to handle term splitting in the plugin’s include/exclude
   functionality. Details at https://make.wordpress.org/core/2015/02/16/taxonomy-
   term-splitting-in-4-2-a-developer-guide/.

#### 2.1

 * Introduce filters on dropdown and its components for greater customizability.
 * Implement plugin as a singleton for proper reusability.
 * Improve adherence to WordPress coding standards.
 * Improve translatability of plugin.
 * Generally clean up code for better readability and clarity.
 * Eliminates all uses of `extract()` for clarity’s sake.

#### 2.0.3

 * Correct problem in WordPress 3.3 and higher that resulted in an empty taxonomy
   dropdown.
 * Remove all uses of PHP short tags.

#### 2.0.2

 * Allow empty title in widget options. If empty, the `taxonomy_dropdown_widget_title`
   filter isn’t run.

#### 2.0.1

 * Fix fatal error in older WordPress versions resulting from PHP4 and PHP5 constructors
   existing in widget class.

#### 2.0.0.2

 * Fix bug in post count threshold that resulted in no terms being listed.

#### 2.0.0.1

 * Fix bug that appended cutoff indicators when unnecessary.

#### 2.0

 * Completely rewritten plugin to use WordPress’ newer Widgets API.
 * Drop support for WordPress 2.7 and earlier.
 * Add support for all public, non-hierarchical custom taxonomies, in addition to
   Post Tags.
 * Introduce new, more flexible function for manually generating dropdown menus.
 * Introduce options requested by the community, such as control over the default
   dropdown item.
 * Fixed persistent bugs in the include/exclude functionality.
 * Widget admin is translation-ready.

#### 1.7

 * Replaced `TDW_direct()` and `makeTagDropdown()` with `generateTagDropdown()`.
 * Recoded entire plugin to simplify and clean up overall functionality.
 * Switched exclude functionality to use tag ids rather than tag slugs.
 * Added numerous additional options to the widget panel based on user response,
   as detailed below.
 * Added the ability to specify the indicator shown when a tag name is trimmed.
 * Added the ability to limit the number of tags shown.
 * Added the ability to specify the minimum number of posts a given tag must be 
   associated with before it will show in the dropdown.
 * Added options for specifying the order tags are displayed in.
 * Added the ability to specify a list of tags to include in the dropdown, expanding
   on the existing ability to exclude certain tags.
 * Added the option to display tags which aren’t associated with any posts.
 * Added the `TagDropdown_get_tags` filter to provide advanced users the ability
   to modify the arguments passed to WordPress’ `get_tags` function. Using this 
   filter, the trimming, trimming indicator, and count display settings are still
   obeyed.

#### 1.6

 * Add `TDW_direct()` function.
 * Add count and exclusion options to new direct-implementation function (`TDW_direct()`).
 * Corrects two XHTML validation errors.

#### 1.5.2

 * Unloads tag exclusion list upon deactivation.

#### 1.5.1

 * Moved plugin pages to ethitter.com.

#### 1.5

 * Added option to display number of posts within each tag.

#### 1.4

 * Added option to exclude tags based on comma-separated list of slugs.

#### 1.3

 * Rewrote certain widget elements for compatibility back to version 2.3.

#### 1.2

 * Added function to remove plugin settings when deactivated.

#### 1.1

 * Added the ability to trim tag names when calling the function directly.

## Meta

 *  Version **2.3.3**
 *  Last updated **3 months ago**
 *  Active installations **2.000+**
 *  WordPress version ** 2.8 or higher **
 *  Tested up to **6.9.4**
 *  PHP version ** 5.6 or higher **
 *  Language
 * [English (US)](https://wordpress.org/plugins/tag-dropdown-widget/)
 * Tags
 * [sidebar](https://su.wordpress.org/plugins/tags/sidebar/)[tag](https://su.wordpress.org/plugins/tags/tag/)
   [tags](https://su.wordpress.org/plugins/tags/tags/)[taxonomy](https://su.wordpress.org/plugins/tags/taxonomy/)
   [widget](https://su.wordpress.org/plugins/tags/widget/)
 *  [Advanced View](https://su.wordpress.org/plugins/tag-dropdown-widget/advanced/)

## Ratings

 4.7 out of 5 stars.

 *  [  7 5-star reviews     ](https://wordpress.org/support/plugin/tag-dropdown-widget/reviews/?filter=5)
 *  [  1 4-star review     ](https://wordpress.org/support/plugin/tag-dropdown-widget/reviews/?filter=4)
 *  [  1 3-star review     ](https://wordpress.org/support/plugin/tag-dropdown-widget/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/tag-dropdown-widget/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/tag-dropdown-widget/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/tag-dropdown-widget/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/tag-dropdown-widget/reviews/)

## Contributors

 *   [ Erick Hitter ](https://profiles.wordpress.org/ethitter/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/tag-dropdown-widget/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://ethitter.com/donate/)