New Plugin Adds The Ability to Categorize and Tag Attachments in The WordPress Media Library

One of the most common complaints I often hear from those who have a large number of attachments in the WordPress media library is the lack of Category and Tag support to organize media. When combined, tags and categories are a decent way to organize content.

Three years ago, a ticket was created on WordPress Trac requesting that this feature be added to core. The ticket was closed with a reference to the following function: register_taxonomy_for_object_type( 'category', 'attachment' ); which enables plugin developers to register new taxonomies to objects.

A new plugin called Attachment Taxonomies developed by Felix Arntz takes advantage of this function and provides a no frills approach to adding category and tag taxonomies to attachments.

Once installed and activated, tag and category sub-menu items appear in the Media menu. Similar to managing categories and tags for posts, you can manage categories and tags for attachments.

Attachment Taxonomies Category Management Screen

Here’s what the tag management screen looks like.

Attachment Taxonomies Tag Management Screen

In addition to these screens, users can filter attachments by tags or categories on the Media Library screen and the Add New Media modal box.


Ideas For Improving The User Experience

While testing Attachment Taxonomies I discovered a couple of areas where the user experience can be improved. Unlike posts where you can add new and existing tags, you can only tag an attachment if the tag already exists.

Creating all of the tags you need up front doesn’t make sense and is a time-consuming process. I’d rather see the Tags metabox from the Post screen used instead. Not only would it make tagging attachments easier, it also has an auto-complete feature for commonly used tags.

Assigning Tags

At a glance, determining which categories are assigned to an attachment is confusing. On the screenshot below, it looks like the image is assigned to both categories available.


The Categories metabox on the Post screen already does a good job of allowing people to assign categories. It also provides a way for users to create them without having to visit the Category management screen.

Attempts to Improve The WordPress Media Library

As WordPress continues to age into a mature product and the number of attachments in media libraries across the web increases, so does the need for better organizing and search tools. It’s not as if these features have been ignored.

Four years ago, John Blackbourn created a ticket and suggested an enhancement that would allow the Media Library to search by filename. The ticket languished in Trac for two years until it was revived by Eric Andrew Lewis. At one point, it was assigned to the WordPress 4.0 release but it didn’t make it. The ticket is once again waiting for someone with interest to work on it. 

Three years ago, a ticket created by Titush requested better categorization options of media files such as folders, tags, and categories. Andrew Nacin responded to the ticket explaining why it was closed as wont fix.

We already allow for taxonomies for attachments. If a plugin wanted to make these more awesome or more intuitive, they certainly could.

Rather than directories that someone manually sorts files into, I would want core to improve on its existing filtering, sorting, and searching options. This kind of “smart” organization is more flexible, much less burden on the user, and allows for multiple ‘workflows’ (otherwise one user might dictate the workflow of many other users based on folder layouts, and that can be burdensome).

I’m closing this out again. This remains plugin material. If a plugin has yet to do this really, really well, that’s all the more reason for it to be done in a plugin before core tries to build it.

To this day, these features are only available through the use of plugins. If you want to search the media library using the Alt, Title, Caption fields and filename of attachments, check out the Media Enhanced Search plugin we reviewed in 2014.

Attachment Taxonomies Works Fine in WordPress 4.6 Beta 2

I tested Attachment Taxonomies on WordPress 4.6 beta 2 and didn’t encounter any issues. If you’re looking for an easy way to tag and categorize attachments, consider giving this plugin a try. It’s available for free from the WordPress plugin directory.


7 responses to “New Plugin Adds The Ability to Categorize and Tag Attachments in The WordPress Media Library”

    • Agreed, though both of those plugins try to do quite a bit more and solve other additional problems. This one tries to do one straight forward thing that the largest number of people might find useful. At least from my perspective. So while i really like the notion of being able to categorize my media, those others might be a little more than what some need (maybe with the exception of Media Tags). Since it so closely replicates the experance of using tags and categories through posts, it creates less of a barrier for clients. It’s nice when you don’t have to really explain a plugin all that much.

  1. Thanks for the feedback! I will work on improving the UI for single attachments to make use of the Categories/Tags interfaces from the post editing area in a future version of the plugin. It’s kind of tricky to get them in there, so I didn’t do it for the initial release.

    A note on attachment taxonomies in Core: I think the problem is that using `register_taxonomy_for_object_type()` isn’t sufficient to get a usable interface. While custom taxonomies integrate perfectly into regular post types, attachments have a custom UI and therefore work differently – and I wouldn’t have made a plugin if it had just been for the plain registration of taxonomies.

    I understand that Core doesn’t want to add these taxonomies by default, but it would certainly help if the underlying infrastructure would support custom attachment taxonomies out of the box. Maybe we can work on that someday.

  2. There was a call during Rian Rietveld’s presentation at WordCamp Europe for the whole of the media area to get a looking at as there are a number of accessibility issues with the user interface.

    That’s obviously a bigger job than a few tweaks, her aspiration was that it could be done as a feature plugin. Any design should take accessibility into account.

  3. I can recommend the WP Real Media Library plugin. It adds visual folders to your wordpress media library view for a better and faster organization:

    WP Real Media Library is a WordPress plugin that allows you to easily manage your media library in your blog. Using this plugin, you’ll be able to organize the thousands of images, audio, video, and PDF files in your media library in folders. Basically, it’s like WordPress categories for your media library.


Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

%d bloggers like this: