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.