🗂️ Adding a New WordPress Category via the Admin Bar
Originally published July 29, 2013 on an earlier version of this site, and recovered from the Wayback Machine while putting this site back together. The snippet below still works on modern WordPress with the Classic Editor enabled. If you're on Gutenberg / the block editor you already have a category sidebar in the post editor, so this tweak is most useful on sites still running the legacy admin.
ThompsonHall.com — a Minneapolis law firm I worked with at the time — used WordPress categories to organize a large hierarchy of legal topics. I was adding new categories constantly, and bouncing from the admin bar to Dashboard → Posts → Categories every time got tedious fast. It always struck me as a little odd that Category wasn't a default option under the + New admin bar menu, alongside Post, Media, Page, and User. Easy enough to fix.
The following snippet adds a Category option under the + New menu item in the WordPress admin bar. Drop it in your theme's functions.php (or a small site-specific plugin):
/*
---------------------------------------
ADD NEW CATEGORY VIA ADMIN BAR
---------------------------------------
*/
function add_categories_admin_bar() {
global $wp_admin_bar;
// Add 'Category' under the 'New' menu item in admin bar
$wp_admin_bar->add_menu( array(
'id' => 'new-category',
'title' => 'Category',
'href' => admin_url( 'edit-tags.php?taxonomy=category' ),
'parent' => 'new-content',
) );
}
add_action( 'wp_before_admin_bar_render', 'add_categories_admin_bar' );
That's the whole thing. Refresh the admin and hover + New — Category will appear right under User.
The same pattern works for any registered taxonomy: swap the taxonomy=category query arg for taxonomy=post_tag, a custom taxonomy slug, etc., and give the menu item a unique id.