Tag Groups

Note: This plugin is provided for free. Particularly if you use it to make money or in a profit-making context, however, I would appreciate if you could make a donation. Thank you!

This plugin enables you to define groups for tags (or categories) and then assign tags (or categories) to them. The group membership is saved in the native WP table field term_group, so it won’t create additional tables in the database. The plugin comes with a configurable tag cloud where tags are displayed in tabs sorted by groups.

Possible applications are:

  • Display your tags grouped by language or by topic.
  • Display your tags in any order, independently from their names or slugs.
  • Display with each posts tags that are related to the tags of this post.
  • Choose which tags to display in different sections of your blog.
  • Make it easier to manage your tags in the back end.


Please proceed to the WordPress plugin repository.


  1. Find the plugin in the list at the backend and click to install it. Or, upload the ZIP file through the admin backend. Or, upload the unzipped tag-groups folder to the /wp-content/plugins/ directory.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.


  1. The plugin creates a new submenu in the Settings menu where you find the description of the parameters. In the settings you can also set another taxonomy than posts, change the appearance and other things.
  2. Depending on the taxonomy, another submenu called “Tag Groups” will appear under the Post section (default) or what other taxonomy you have chosen.
  3. Before you can organize your tags in groups, you need to create groups on that “Tag Groups” page. You can later always rearrange their order, add new groups or delete them.
  4. Then you assign your existing tags to one of these groups. You can assign the tags also while you create them.
  5. In order to see the tabbed tag cloud, you need to use the shortcode or add a piece of PHP code to your template. The first method is the easier and the recommended one. The appearance can be changed through themes (in the tag group settings) or by accessing the elements directly with CSS (again for advanced users).

Tools on the Tags Page

On the Tags (or other terms, depending on your taxonomy) page you have two useful tools:

Bulk Changes

This tool lets you assign multiple tags to one group, or unassign them all at once.

  1. Select multiple tags.
  2. Choose a group. (“Assign to” in the “Bulk Actions” menu should be selected automatically.)
  3. Click Apply


You can filter the list by a group to show only tags that belong to that group.

Filter on the Posts Page

On the Posts page (“All Posts” menu) you find a filter on top of the list that filters the posts by tag groups. If the filter is active, only posts are displayed that have at least one tag that belongs to the selected tag group.

Restrictions: The filter does not work for multiple taxonomies (because the standard WP query would connect them with the condition “AND”) and not for “category” (because it interferes with the category pull down menu).

Tag Cloud

If you don’t want to mess around with the code, you can simply embed a tag cloud into a post, page or widget by using the shortcode below. The design of the tag cloud can be customized from the Tag Groups settings in the backend.

Tag clouds are by default tabbed (each group having its own tab) but you can also have a “normal” tag cloud for only one group.

If you select more than one taxonomy then all the terms of the various categories will be mixed into one cloud. You can use the “taxonomy” parameter to restrict the cloud to particular taxonomies.

The tag cloud can be inserted by a shortcode (in a post, page or widget) or directly hard-coded into a theme:

a) Shortcode



Tags or Terms:

  • smallest=x Font-size in pt of the smallest tags. Default: 12
  • largest=x Font-size in pt of the largest tags. Default: 22
  • orderby=abc Which field to use for sorting, e.g. count. Default: name
  • order=ASC or =DESC Whether to sort the tags in ascending or descending order. Default: ASC
  • amount=x Maximum amount of tags in one cloud (per group). Default: 40
  • hide_empty=1 or =0 Whether to hide or show tags that are not assigned to any post. Default: 1 (hide empty)
  • tags_post_id=x Display only tags that are assigned to the post (or page) with the ID x. If set to 0, it will try to retrieve the current post ID. Default: -1 (all tags displayed)
  • assigned_class=”something” A modification of the tags_post_id parameter: Rather than hiding tags that are not assigned to the post (or page), they can be styled differently. Tags will receive this class name with appended _1 or _0. (If you output the tags as an array, a new element with the key “assigned” will be true or false.)
  • separator=”•” A separator between the tags. Default: empty
  • separator_size=12 The size of the separator. Default: 12
  • adjust_separator_size=1 or =0 Whether to adjust the separator’s size to the size of the following tag. Default: 0
  • prepend=”#” Prepend to each tag label. Default: empty
  • append=”something” Append to each tag label. Default: empty
  • taxonomy=”x,y,…” Restrict the tags only to these taxonomies. Default: empty (= no restriction)
  • link_target=”_blank” Set the “target” attribute for the links of the tags. Possible values: _blank, _self, _parent, _top, or the name of a frame. Default: empty (= opens in the same window, same as using _self)
  • show_tag_count=1 or =0 Whether to show the number of posts as tooltip (behind the tag description) when hovering the mouse over the tag. Default: 1 (show)

Groups and Tabs:

  • include=”x,y,…” IDs of tag groups (left column in list of groups) that will be considered in the tag cloud. Empty or not used means that all tag groups will be used. Default: empty
  • groups_post_id=x Display only groups of which at least one assigned tag is also assigned to the post (or page) with the ID x. If set to 0, it will try to retrieve the current post ID. Default: -1 (all groups displayed). Matching groups will be added to the list specified by the parameter include.
  • show_tabs=1 or =0 Whether to show the tabs. Default: 1
  • hide_empty_tabs=1 or =0 Whether to hide tabs without tags. Default: 0 (Not implemented for PHP function with second parameter set to ‘true’. Not effective with groups_post_id.)
  • show_all_groups=1 or =0 Whether to force showing all groups. Useful with the parameters tags_post_id and assigned_class. Default: 0
  • collapsible=1 or =0 Whether tabs are collapsible (toggle open/close). Default: general settings in the back end
  • mouseover=1 or =0 Whether tabs can be selected by hovering over with the mouse pointer (without clicking). Default: general settings in the back end
  • active=1 or =0 Whether tabs are initially expanded or collapsed. Useful in connection with the parameter collapsible. Default: 1

Advanced Styling:

  • div_id=abc Define an id for the enclosing <div>. You need this parameter particularly if you display more than one tag cloud on the same page, in which case each shortcode needs a different value. Default: tag-groups-cloud-tabs
  • div_class=abc Define a class for the enclosing <div>. Default: tag-groups-cloud-tabs
  • ul_class=abc Define a class for the <ul> that generates the tabs with the group labels. Default: empty
Multiple Tag Clouds

If you want to use more than one tag cloud, then the div_id parameter needs to be set, starting from the second shortcode, and each values must be different. You can use div_class to have a shared styling for a particular set of tag clouds.

b) PHP

By default the function tag_groups_cloud returns the html for a tabbed tag cloud. If you want to add the tag cloud directly into your theme, you could do it like this:

if ( function_exists( 'tag_groups_cloud' ) ) echo tag_groups_cloud( array( 'amount' => 10 ) );

The array can, of course, contain also more parameters: array( 'include' => '1,2,5,6', 'amount' => 10 )

If the optional second parameter is set to ‘true’, the function will return a multidimensional array containing tag groups and tags:

if ( function_exists( 'tag_groups_cloud' ) ) print_r( tag_groups_cloud( array( 'orderby' => 'count', 'order' => 'DESC' ) , true ) );

Other Functions

post_in_tag_group( $post_id, $tag_group_id )

Checks whether the post with the given $post_id has at least one tag that is part of the tag group with the given $tag_group_id. Returns true or false.

Further Examples

You can find more examples on this page.

Example of the Tag Groups cloud

This tag cloud uses jQuery UI’s theme “blitzer” with “mouseover” enabled. Tags are sorted by ‘count’ in descending order.

Creating Your Own Theme

The tag cloud comes bundled with three themes 1. Alternatively, you can also use your own theme. The easiest way to achieve this is to create one using the jQuery UI ThemeRoller, then download the file, extract from it the part containing CSS and images, upload the contained css folder to your WordPress wp-content/upload folder and then tell Tag Groups where to find it.

Here it is step by step:

  1. Go to jQuery UI ThemeRoller. On their page you find on the left side “Roll your own”; or pick one ready-made theme from the “Gallery.” In the center part of the page you can see a preview.
  2. Under the thumbnails in the Gallery or below the “Roll your own” tab you find the download button, taking you to another page (“Download Builder”) with several further options. You will need to select the components “Core”, “Widget” and “Tabs”. The latest version should work with your WordPress installation, or try another one. . Go to the settings at the bottom and enter as “CSS Scope” the class .tab-groups-cloud (including the leading dot) and as “Theme Folder Name” something that will make a good folder name – for example “my-theme” or “red-and-blue”, or just the name from theme gallery.
  3. Go ahead and download the zipped file. After you unpacked it, open the resulting folder (“jquery-ui- …) and the “css” folder inside it. Inside the “css” folder you find a folder with the previously chosen “Theme Folder Name”.
  4. Copy this folder with all its contents to your /wp-content/uploads folder of your WordPress installation (e.g. with a FTP client). This place should be save from being overwritten by future updates of WordPress or plugins.
  5. Enter the chosen “Theme Folder Name” in the field on the Tab Groups Settings page on the backend, select “own theme” and save the changes. If you want to keep your uploads folder organized, you can also create a containing folder for your css and add it to the “Theme Folder Name (e.g. “tag-cloud-themes/blue-theme”).

You can also leave the field for your custom theme empty. You may want to do this for example if the theme of your blog already provides tabs and you like to blend the tag cloud into this design.

Other Use

Theme developers can make use of the groups through the property $tag->term_group.

Multilingual Support with WPML

Since version 0.3, Tag Groups is ready to be used on multilingual blogs with WPML installed. WPML ensures that tags will automatically show their correct language version depending on the selected language. Tags can be translated directly where you enter and edit them.

All left to do is to translate the tag group labels. To enable this, you need to make sure that they appear in WPML’s string translation module where you can easily translate them. Tag Groups automatically registers new tag groups that you create with WPML installed. Alternatively, you can register your existing groups after installing WPML through the button on the Tag Groups page.

Once you have entered the translations for the tag group labels on the WPML string translation, they will be displayed in the tag cloud on the frontend for each corresponding language.

If you want to have a different design for different languages, you simply change the parameters in the shortcode that you use on the posts or pages of each language.


The tag cloud doesn’t show in a text widget, instead I see the shortcode

Try “Enable shortcode in sidebar widgets” in the settings.

The list on the post page is messed up

Some users have experienced interference with other plugins that caused the list being messed up, showing wrong content etc. If that happens, turn off the filter in the settings at “filter on post admin”.

Other plugins don’t work properly when a page reloads

Other plugins that use sessions may be affected. Possible symptoms are that calendars, lists etc. (also on the front end) cannot switch to the next page, next month or similar. Try to turn off the “filter on tag admin” in the settings.

Other (mostly dynamic) content stopped working properly

Try to turn off “Use jQuery” in the settings. It is possible that another theme or plugin uses their own jQuery, causing a conflict.

The tabbed tag cloud displays as a list

Check if “Use jQuery” in the settings is turned on.

I have multiple tag clouds on the same page – the first is fine, all other display as a list

Make sure that starting from the second tag cloud you use in each shortcode a different value for the parameter div_id.

Styling doesn’t seem to be effective

Check if the values for div_id, div_class etc. are valid names for ids and classes. Maybe you also need to purge the cache of your WordPress installation. Use the developer tools of your browser to check if your styling gets overridden by other instructions (try “!important” to enforce yours).


The changelog is maintained on the WP plugin page.

Questions, Comments and Requests

Please submit them only on the WP discussion forum.

Known Issues

  • Quick editing (i.e. inline editing in the table) of terms doesn’t display the current tag group when using Opera (version 12, maybe others too) while saving still works.


… with no clear time frame.

  • bulk changes to tags

Other Notes

Styling created by jQuery UI who also provided the Javascript that is used for the tabs to do their magic. Find their license in the package.

The license of this plugin is GPLv2 or later.

Tip Jar

Yes, this plugin is free but it takes much effort to maintain it. Please donate to this charity or below to the author:

BTC-QR-request-donationBitcoin: 1GEigZ7E49eqLNHvVSXdRhQUqt8Hu1atgK

If you find this plugin useful, I would also appreciate a five-star-rating.

Show 1 footnote

  1. What I call “Gray” is actually”Smoothness” in the jQuery UI gallery – for historical reasons.


  1. Hello Christoph,

    Thank you for this beautiful plugin contribution.

    Is the tag groups compatible with multisites?

    All the best
    Israel David

    • Hi Israel, I tried it on a multisite installation (latest WP, enabled per-site) and have not encountered any problems so far. I haven’t done any in-depth testing though, so it might be recommended to test on a non-public installation first. Please let me know if you run into problems.

    • Are you familiar with using code?
      I would probably use a table and fill in the values retrieved from the array:

      EDIT: The code doesn’t display here in the comments, so I put it there

  2. Elvis says

    Hi, help please… I cant change iQ style to “Tabs” as in example… I have even rewrite plugins/tag-groups/css .css files, but couldnot get resalt – no “Tabs”…

    • The styling is very specific for each website, it depends on themes and plugins that you use and the general problem that something doesn’t work could have many reasons. Before changing the files, you should switch to the standard WordPress theme (Twenty-…), deactivate other plugins and then try again.

  3. Is there a way from the dashboard to see what posts are in the individual tag groups? My client would like to be able to check that from the back end…maybe via a link in the group listing?

    • I think it would make most sense to have an additional filter above the list of posts. I will try to implement that in the next version.

    • Not on the “Posts” page, /wp-admin/edit.php ? Maybe disabled in settings, although should be enabled by default. Which taxonomy do you use?

    • Thanks! :-)
      But I think that you were right, there was a small bug affecting some settings (wrongly used ‘post’ as taxonomy name. Hope to fix that with 0.9.1 (..without at the same time introducing new errors 😉 )

  4. Malte says

    Hello, I want to show a “table” of tags assigned to a post. (so that each POST have its one table tag-groud-cloud) But in the order of the tag-groups.

    I found something but this works only with the normal wordpress tag cloud, how do i combine these scripts?

    $tag_ids = wp_get_post_tags( $post->ID, array( ‘fields’ => ‘ids’ ) );

    // Check if there is any tag_ids, if print wp_tag_cloud
    if ( $tag_ids ) {

    wp_tag_cloud( array(
    ‘unit’ => ‘px’, // font sizing choice (pt, em, px, etc)
    ‘include’ => $tag_ids, // ID’s of tags to include, displays none except these
    ) );

    Please help!


  5. Announcement: The latest version 0.10 offers the option to display a tag cloud that filters the tags according to the tags of particular posts and pages. That has been a frequent request.
    Also added a new link for donations: http://www.burma-center.org/donate/ Money doesn’t go to me but to my favourite charity. 😉

  6. Pedro says

    Hi, thanks for the plugin, I tried the plugin and works perfect. But I need to display also the tags in the post. For example, I have a group called TRADEMARK. When I write a new post, I add the tags, for example: cars, bmw, germany,
    Now, I assign bmw to trademark group.
    And now I want to display this in the post (if exist):


    This is possible with a shortcode of this nice plugin? I am very new with php :(

    Thank you.

  7. Your latest version does not save the assigned category.
    I assign a tag to a group, that click “update” and it still says “not assigned”

    • I cannot confirm it, or I’m searching at the wrong place. So you set as Taxonomy “Categories”, on the Categories screen you edit directly in the table with “Quick Edit”, you select a Group and click “Update Category”, and the selected name of the group is not saved? Do you use any unusual characters in the group name?

      • Dapper says

        I am finding the same issue. I just installed the latest (v 0.12) and created 2 Tag Groups. I started to edit my existing Post Tags and it does not save the change. I can edit a Tag, and the “Tag group” pulldown is available in the Tag editor, but when I select a Tag group and save the Tag, it remains “not assigned”.

        • Dapper says

          Here’s some more information.

          The Tag Group assignment works on a Post Tag when creating the Tag. It does not work when editing an existing Tag.

          I checked for PHP errors and found that this occurs when saving the edited Tag:

          PHP Notice: Undefined variable: category in /wp-content/plugins/tag-groups/tag-groups.php on line 283

          Viewing the code, it appears that it initializes $category only when $_POST[‘tag-groups-taxonomy’] is available. Looking at the HTML src of the Edit Tag page, I don’t see that this is submitted (but it is submitted in the create tag form).

          It doesn’t look like wp_update_term will work without the 2nd ($category) argument.

          (Using WordPress 3.6.1).

          • Dapper says

            Sorry, for the repeated posts.

            I just discovered “Quick Edit” DOES work, and looking at the code, I see that it includes the hidden ‘tag-groups-taxonomy’ field. Looks like the same just needs to be done for the for the full Tag edit page (set up in tg_tag_input_metabox I think).

  8. Thanks a lot, that was really helpful!

    I have fixed it and will just make some checks before uploading.

    The new version is 0.12.1

  9. Fernando says

    Hi, I installed the tag cloud group and actived de tag cloud on widgets menu, but the tags just appear like a list of all tags, not groups and tags inside each group.

    I looked at settings and everything is default,

    • So you try the short code in a widget? Have you tried to enable “Enable shortcode in sidebar widgets” on the “Tag Cloud” tab in the settings?

  10. Dirk says

    Hi Christoph, great plugin!
    Is there a way to assign tags to several groups?

    Tx a lot, Dirk

    • Hi Dirk,
      Apologies for the late reply. Better use the official support forum at WordPress.
      Each tag (or term) can only be assigned to one group. (Because the plugin is using the built-in term-group field.)

  11. Andras Nagy says


    How can I hide the numbers from the mouse. For example in your post; I am thinking, English – United Nations >>>> (4) <<<< this number (sorry for bad English)


  12. Hallo Christoph,

    erstmal ein großes Dankeschön für dieses tolle Plugin.
    Gibt es eine Möglichkeit die Anordnung der Tags als Liste untereinander darzustellen?
    Ich bin nicht so fit in Stylesheets….

    Danke schon mal:-)


    • Hallo Stefan,

      so ganz ohne Stylesheets wird es wohl nicht gehen. Wenn die Tabs oben erhalten bleiben sollen und nur die Tags untereinander stehen sollen, dann müsste im “head”-Abschnitt der Seite (in “style”-Tags eingeschlossen) .tag-groups-cloud-tabs a {display: block;} reichen (oder entsprechend im Shortcode mit div_id="irgendetwas" einen Bezeichner auswählen und dann statt .tag-groups-cloud-tabs eben #irgendetwas verwenden, falls nur eine bestimmte Tag-Cloud verändert werden soll). Ggf. lassen sich die Tabs mit den entsprechenden Shortcode-Parametern unterdrücken.

  13. Patrick says

    I just install this plugin and I want to call a function that returns all tags of a particular group in my custom plugin.

    Any help?

    • Have you tried the function tag_groups_cloud (as described above)? You can pass the shortcode parameters as array. e.g. tag_groups_cloud( array( ‘include’ => 1) , true ) This should return an array.

  14. Amo says

    Hi there,
    Great plugin, congrats !
    Can you please help me ? I’d like to display on a page all my tags, classified into different groups
    One div with the tags from group A
    One div with the tags of group B
    But not into tabs
    Thxs in advance for ur help
    Cheers from France

  15. miklog says

    Hallo Chris

    Id like to use Your Display tags in columuns with the tag-groups Plugin in WP

    But how and where do i actually apply the PHP Code provided ?

    The how to is not documented an i am not an expert regarding php.

    Any help appreciated!


Leave a Reply

Your email address will not be published. Required fields are marked *