Media Library Categories

Description

Adds the ability to use categories in the WordPress Media Library. When activated a dropdown of categories will show up in the media library.
You can change the category of multiple items at once with bulk actions.

Screenshots

  • Filter by category in the media library. Use bulk actions to add and remove categories of multiple images at once.
  • Manage categories in the media library
  • Filter by category when inserting media (premium version)

Installation

For an automatic installation through WordPress:

  1. Go to the ‘Add New’ plugins screen in your WordPress admin area
  2. Search for ‘Media Library Categories’
  3. Click ‘Install Now’ and activate the plugin
  4. A dropdown of categories will show up in the media library

For a manual installation via FTP:

  1. Upload the ‘Media Library Categories’ directory to the ‘/wp-content/plugins/’ directory
  2. Activate the plugin through the ‘Plugins’ screen in your WordPress admin area
  3. A dropdown of categories will show up in the media library

To upload the plugin through WordPress, instead of FTP:

  1. Upload the downloaded zip file on the ‘Add New’ plugins screen (see the ‘Upload’ tab) in your WordPress admin area and activate.
  2. Activate the plugin through the ‘Plugins’ screen in your WordPress admin area
  3. A dropdown of categories will show up in the media library

FAQ

Installation Instructions

For an automatic installation through WordPress:

  1. Go to the ‘Add New’ plugins screen in your WordPress admin area
  2. Search for ‘Media Library Categories’
  3. Click ‘Install Now’ and activate the plugin
  4. A dropdown of categories will show up in the media library

For a manual installation via FTP:

  1. Upload the ‘Media Library Categories’ directory to the ‘/wp-content/plugins/’ directory
  2. Activate the plugin through the ‘Plugins’ screen in your WordPress admin area
  3. A dropdown of categories will show up in the media library

To upload the plugin through WordPress, instead of FTP:

  1. Upload the downloaded zip file on the ‘Add New’ plugins screen (see the ‘Upload’ tab) in your WordPress admin area and activate.
  2. Activate the plugin through the ‘Plugins’ screen in your WordPress admin area
  3. A dropdown of categories will show up in the media library
How to use separate categories for the WordPress Media Library (and don’t use the same categories as in posts & pages)?

By default the WordPress Media Library uses the same categories as WordPress does (such as in posts & pages). If you want to use separate categories for the WordPress Media Library add this code to the file functions.php located in your theme or child-theme:
/**
* separate media categories from post categories
* use a custom category called ‘category_media’ for the categories in the media library
*/
add_filter( ‘wpmediacategory_taxonomy’, function(){ return ‘category_media’; } ); //requires PHP 5.3 or newer

Or if you have an older PHP version:
add_filter( ‘wpmediacategory_taxonomy’, create_function( ”, ‘return “category_media”;’ ) ); //requires PHP 4.0.1 or newer

How to use category in the [gallery] shortcode?

To only show images from one category in the gallery you have to add the ‘category‘ attribute to the [gallery] shortcode.
The value passed to the ‘category‘ attribute can be either the category slug or the term_id, for example with the category slug:
[gallery category=”my-category-slug”]
Or with term_id:
[gallery category=”14″]
If you use an incorrect slug by default WordPress shows the images that are attached to the page / post that is displayed. If you use an incorrect term_id no images are shown. Aside from this behavior, the [gallery] shortcode works as it does by default with the built-in shortcode from WordPress (see the WordPress gallery shortcode codex page). If you only want to show attachments uploaded to the page and filtered by category than use the ‘id‘ in combination with the ‘category‘ attribute. For example (the id of the post is 123):
[gallery category=”my-category-slug” id=”123″]
Or leave id empty for current page / post:
[gallery category=”my-category-slug” id=””]
In this example the slug is used, but you could also use the term_id.

How can I filter on categories when inserting media into a post or page?

This feature is only available in the premium version

I want to thank you, where can I make a donation?

Maintaining a plugin and keeping it up to date is hard work. Please support me by making a donation. Thank you.
Please donate here

Reviews

Ignore negative reviews

It baffles me why people are so unkind. I looked at the profiles of some of the negative reviewers and their only reviews are negative ones.

The negatives for this plugin are 1-star, as negative as possible. That is insane as the plugin is very straight-forward, easy to use, and works as advertised.

All features are included in the free version, save 1. I suspect the majority of users won’t need it but if either (1) you do need it or (2) would like to thank the generosity of the developer — the price for the paid version is very low.

One feature I noticed in the free version that is a paid feature in most others is bulk edit. Very nice. Thanks Jeffrey.

Simple Need, Simple Plugin

I’m using the free version and it’s working fine. (I can’t imagine why anyone would post “Useless without paid feautre” or “Useless. Not free”). Perhaps they wanted this simple plugin to do more than it was designed to do.

Simple to setup and use. Of course it took time to assign a category (or two) to every image, but it if you do it with bulk selects, it goes faster.

No complaints. Thanks for this free plugin.

Read all 40 reviews

Contributors & Developers

“Media Library Categories” is open source software. The following people have contributed to this plugin.

Contributors

“Media Library Categories” has been translated into 4 locales. Thank you to the translators for their contributions.

Translate “Media Library Categories” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.

Changelog

1.5.6

1.5.5

  • Better detection if category is empty in gallery shortcode.
  • Use id attribute in gallery shortcode and show attachments in selected category and uploaded to post ID. [gallery category="my-category-slug" id="123"]
  • Leave id attribute empty in gallery shortcode to show attachments in selected category and upload to current post. [gallery category="my-category-slug" id=""]

1.5.4

  • Before creating custom taxonomy check if taxonomy exists. Thanks @drpratten
  • Use filter instead of action for the displayed attachments. Thanks @clearsite
  • Japanese translations. Thanks @katsushi-kawamori
  • On some servers the active category was not selected in the dropdown in media list view.
  • Support PHP 7.1

1.5.3

  • Added some default languages en_US, nl_NL, de_DE
  • Updated all links to use https://

1.5.2

1.5.1

  • Support for WordPress 4.2
  • Security enhancement for add_query_arg
  • Remember selected category

1.5

  • Support for WordPress 4.1
  • Add category checkboxes to attachment details on insert media popup

1.4.15

  • Support for WordPress 4.0
  • Added categories filter to media grid view.
  • Security enhancement.
  • Resolved conflict with UberMenu plugin.

1.4.13

  • Improved compatibility with other plugins that use the [gallery] shortcode.
  • Remember author when changing categories.
  • Added example code in the FAQ for creating seperate categories with PHP 4. Read the FAQ for howto

1.4.12

  • Added category option to the default WordPress shortcode gallery. Read the FAQ for howto
  • Improved code styling to match WordPress code standard even more strictly.

1.4.11

  • Remember ordering when changing categories.

1.4.10

  • Stay on active page in the media library when changing categories.
  • Fixed PHP 5.4 strict warning.
  • Added hierarchical display of the filter menu when inserting media. (premium only)

1.4.9

  • Fixed error message which in some cases appears when updating multiple items at once. View support question

1.4.8

  • Fixed media count on the categories page.
  • Added item count in the category filter dropdown when using separate categories for the WordPress Media Library.
  • Support for WordPress 3.9

1.4.7

  • New images are now added to the default category (if a default category exists). I most cases the default category is called “no category”. View support question

1.4.6

  • Fixed bug where in some rare cases the filter by category didn’t work

1.4.5

  • Fixed bug in version 1.4.4 that made default categories in WordPress invisible

1.4.4

  • By default the WordPress Media Library uses the same categories as WordPress does (such as posts & pages). Now you can use separate categories for the WordPress Media Library. Read the FAQ for howto

1.4.2 & 1.4.3

1.4.1

  • Improved bulk actions: added option to remove category from multiple media items at once
  • Improved bulk actions: arranged options in option group

1.4

1.3.2

1.3.1

  • Fixed bug (when having a category with apostrophe)

1.3

  • Add support for bulk actions (to change category from multiple media items at once)
  • Support for WordPress 3.8

1.2

  • Better internationalisation

1.1

  • Add a link to media categories on the plugin page

1.0

  • Initial release.