Recently, one of our readers asked if it was possible to add categories and tags to images in the WordPress library. Adding categories and tags to images in the media library can help you easily sort and locate images on WordPress. In this tutorial, we are going to show you how to add categories and tags for the WordPress media library.

Why add taxonomies to the WordPress media library?

WordPress offers a feature called " taxonomies Which allows you to sort your articles into categories and labels or even create your own custom taxonomies.

Default categories and tags are available for articles only. However, taxonomies can be added to any WordPress post type like pages, attachments, or any custom post types you may be using on your blog.

When you add an image to your WordPress posts or pages, it is stored in the WordPress media library as an attachment. Attachment is a post type, which means it can have its own taxonomies as well.

Adding categories and labels to your images on WordPress can help you find and sort images more easily.

Method 1: How to add categories and tags with "Taxonomies Attachment"

The first thing you need to do is install and activate the plugin " taxonomies Attachment ". For more details, check out our step by step guide on how to install a WordPress plugin.

This plugin works without configuration. Just go to " Media> Library And click the view as list button at the top.

media library WordPress plugin

This will open the media library as a list. Click on the link "Edit" under the name of an image and WordPress takes you to the image editing page.

You will notice the new box section catégorie " and " Labels In the right column on the screen.

mediatheque label categories WordPress

Click on the link " add a new category To add a new category. You can also create subcategories. This works in the same way as the article categories.

Once you're done, just click the update button to save your changes.

To display images or media classified in a category, you must use the shortcode with the category parameter.

[gallery category = ”14 ″]

Replace 14 with the ID of the category you want to recover.

2 Method: Adding Labels to Articles with Envira Gallery

Envira Gallery is one of best WordPress plugins for photo gallery available in the market. It lets you create beautiful, user-friendly image galleries on WordPress.

Envira Gallery comes with an extension " Tags Which allows you to add tags to the images you add to your gallery.

It's a premium plugin, and you'll need at least one premium license to access it.

The first thing you need to do is install and activate the Envira Gallery plugin.

For more details, see our step-by-step guide on way to install a WordPress plugin.

After activating the plugin, you must visit " Envira Gallery> Settings To enter your license key. You can get your account key from Envira Gallery.

Envira galery WordPress plugin

After verification, you must visit " Envira Gallery> Addons ". Locate or search for the extension " Tags And click Install. Once installed, click on the button Enable addon ».

envira extension for WordPress labels

After enabling tag extension, you can create a new gallery or edit an existing gallery. If you're new to Envira Gallery, then check out our guide on how to create galleries with Envira Gallery.

After adding an image to your gallery, you can click the pencil icon on the image to edit its meta-data.

Envira will open the image in a window with meta fields.data in the right column. At the bottom of the meta fieldsdata, you will notice the “ Tags ».

field labels envira gallery

Go ahead and type your keywords.

If you are adding more than one label, then separate each label with a comma. Don't forget to click on the save metadata button to store your changes.

Repeat the process to add tags to other images in your gallery.

You can also display the tags in your gallery. Just click on the tags tab while editing your gallery and check the " Enable Tag Filtering ».

WordPress filter option

You can choose which labels to show or exclude, sort the labels alphabetically or manually, and other settings as well. Once you are done, click on the " Publish »Or button« Save To save your gallery.

Envira demo plugin gallery

That's it for this tutorial. I hope you'll be able to add labels to your different galleries. Feel free to share the article with your friends on your favorite social networks.