Skip to content

anjana-kanzariya/ajax-taxonomy-search-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Admin Taxonomy Search

A lightweight utility that adds instant search inside taxonomy metaboxes in the WordPress admin editor.
Works with both hierarchical taxonomies (categories-style) and non-hierarchical taxonomies (tags-style) with zero configuration.

Quick Start

  1. Copy taxonomy-search.js into your theme’s /js/ folder.
  2. Copy the contents of ajax-taxonomy-search.php file to your functions.php or the file where you enqueue scripts.
  3. Open any post editor → taxonomy boxes now include a search field.

Features

  • Works with any taxonomy automatically
  • Supports:
    • Hierarchical UI (categories with checkbox tree)
    • Non-hierarchical UI (tags style)
  • Instant client-side filtering
  • Keeps checked terms visible
  • Works with “All / Most Used” tab switch
  • No database queries
  • No dependencies beyond WordPress core

Installation

  1. Add the JavaScript file
  • Place taxonomy-search.js inside:
your-theme/js/taxonomy-search.js
  1. Add the enqueue code
  • Paste the PHP snippet into your theme’s functions.php or an included file.
  1. Done
  • The search field will appear automatically in all taxonomy metaboxes.

How to Use

  • Open any post, page, or custom post type editor
  • Each taxonomy metabox will show a search input
  • Typing filters the visible terms instantly
  • Checked terms always remain visible
  • Works for both categories and tags interfaces

Optional Filter

Disable for specific taxonomies

You can prevent the search field from appearing on selected taxonomies:

add_filter('admin_taxonomy_search_disabled', function($taxonomies){
    return ['category', 'post_tag'];
});

Notes

  • Pure admin enhancement - no front-end impact
  • Safe for large term lists
  • Does not modify WordPress core behavior
  • Fully generic and theme-agnostic
  • Performance friendly (debounced client search)

About

Adds instant client-side search inside WordPress taxonomy metaboxes in the admin editor. Works with any taxonomy, no configuration required.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors