
Directorist - Category Based Tags
Filter Directorist tags by selected categories on tag edit, add listing, and search forms with optional fallback behavior.
Filter Directorist tags by selected categories across the admin tag editor, add listing form, and search form.
This plugin extends Directorist with category-based tag mapping.
It adds:
- a category multiselect field on the Directorist tag edit screen
- category-based tag filtering on the add listing form
- category-based tag filtering on the search form
- Directorist settings to enable or disable the feature and control fallback behavior
- Assign one or more Directorist categories to each Directorist tag
- Show all tags by default on listing and search forms
- Automatically narrow tag options when a category is selected
- Fallback to all tags when no related tags are found, if enabled in settings
- Works with Directorist Select2-based tag fields
- WordPress 5.2+
- PHP 5.6+
- Directorist
- Copy the plugin folder into
wp-content/plugins/ - Activate
Directorist - Category Based Tagsfrom the WordPress admin - Make sure Directorist is active
The plugin adds two Directorist options:
Category Based TagsShow All Tags If Empty
You can find them in the Directorist settings under the categories settings section.

Option Behavior
Category Based Tags
- If enabled, category-based tag filtering runs on supported forms
- If disabled, the plugin does not apply frontend or admin-side runtime filtering
Show All Tags If Empty
- If enabled, all tags are returned when no related tags match the selected category
- If disabled, only matching related tags are returned
- Tags without assigned categories are not returned as a fallback when this option is disabled
Edit any Directorist tag in the WordPress admin.
On the tag edit screen, the plugin adds a Categories multiselect field. Select one or more related categories for that tag and save.
Path example:
WP Admin -> Directory Listings -> Tags -> Edit Tag

Go to Directorist settings and enable Category Based Tags.
If you want all tags to appear when no related tags are found, also enable Show All Tags If Empty.
On the add listing form:
- the tag field initially shows all tags
- when a category is selected in
#at_biz_dir-categories, the plugin fetches related tags through AJAX - the tag field
#at_biz_dir-tagsis updated dynamically - if no related tags are found, the fallback behavior depends on
Show All Tags If Empty

On the Directorist search form:
- the tag field initially shows all tags
- when a category is selected in
select[name="in_cat"], the plugin fetches related tags through AJAX - the tag inputs
in_tag[]are rebuilt dynamically - if no related tags are found, the fallback behavior depends on
Show All Tags If Empty

- Tags are shown by default
- No category selection means the full tag list is available
- The plugin looks up tags whose saved related categories match the selected category IDs
- Matching tags are returned and displayed
- If
Show All Tags If Emptyis enabled, the plugin returns all tags - If
Show All Tags If Emptyis disabled, the plugin returns an empty result
- Category assignment for tags is managed per tag on the edit screen
- The category selector uses Select2 when Directorist Select2 assets are available
directorist-custom-code.phpPlugin bootstrap and loadinginc/class-directorist-category-based-tags-tag-field.phpAdmin tag edit field and tag-category meta savinginc/class-directorist-category-based-tags-manager.phpAJAX handling, Directorist settings integration, and runtime asset loadingassets/js/directorist-category-based-tags-admin.jsSelect2 initialization for the admin tag edit fieldassets/js/directorist-category-based-tags.jsDynamic tag filtering for listing and search forms
Related category IDs for each tag are stored in term meta using:
_directorist_category_based_tags_categories
The plugin uses this AJAX action:
directorist_category_based_tags_get_related_tags
Check the following:
- Directorist is active
Category Based Tagsis enabled in Directorist settings- the tag has related categories assigned on its edit screen
Check whether Directorist Select2 assets are registered on the tag edit screen.
This usually means one of the following:
- no related categories were assigned to the selected tags
Show All Tags If Emptyis disabled- no matching tags exist for the selected categories
- renamed and reorganized the plugin
- added category assignment field on the tag edit screen
- added dynamic category-based tag filtering for add listing form
- added dynamic category-based tag filtering for search form
- added Directorist settings integration for feature control
GPL v2 or later
Related Products
Directorist - Advanced Social Links
An extension for Directorist plugin that adds advanced social networking options to listing forms and single listing pages.
Directorist - Custom Badges
A Directorist extension that allows you to create and manage custom badges for your listings with advanced conditions.
Directorist - Custom Map Styles
A Directorist extension enabling custom Google Maps styling, letting users override default map designs with personalized configurations.
Directorist - Nearby Amenities
A powerful extension for Directorist that displays nearby amenities on single listing pages using Google Places API only.


