Adding tags to images in WordPress

How can I add support for adding tags to images the same way you can add tags to posts in WordPress?

I know I can do this by installing a plugin such as the Shiba media library plugin, but that adds a whole lot more than I need. I just need to be able to add tags, no more.

Related posts

Leave a Reply

3 comments

  1. see this tutorial http://code.tutsplus.com/articles/applying-categories-tags-and-custom-taxonomies-to-media-attachments–wp-32319 that explains it all very well.

    To use the same tags as your posts you’ll just need to add those lines to your functions.php file:

        function wptp_add_tags_to_attachments() {
            register_taxonomy_for_object_type( 'post_tag', 'attachment' );
        }
        add_action( 'init' , 'wptp_add_tags_to_attachments' );
    

    After adding those, the tags box will start showing up on your media library items.

    The article also describes how to create custom taxonomy (a separate set of tags / categories) but that’s probably not required for what you’re after.