Custom Post Type Filter Admin By Custom Taxonomy

This is a powerful little snippet to allow filtering your post or custom post type by a specific taxonomy term in the WordPress admin.

In my use case I had a custom post type for ‘wp_hooks’. I then had a custom taxonomy called ‘categories’.

My first thought was to use sortable columns, but that would still require scrolling and possibly paging to get the right people.

I tried a few things and ended up with this nice snippet…

The only thing you need to change is your post type and your taxonomy name.

Add the following code to active theme’s functions.php file