How do you delete unused labels?

David Meacock March 28, 2012

We have a label map on our landing page showing all the popular labels in our space - it contains a whole bunch of labels that simply don't have pages associated with them. At first I assumed they existed on pages that were in the Trash, but I've since checked and the Trash is empty.

So how do I get rid of these labels? Or are we doomed to have an ever-growing map of unused tags?

That would make the product a lot less useful :(

10 answers

1 accepted

3 votes
Answer accepted
Jeremy Largman
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 29, 2012

You could also use the CLI for this:

confluence --action removeLabels --space "zconfluencecli" --title "This is title 0" --labels "testLabel1, testLabel2"

You can also getLabelList. In general that's a great utility for any kind of mass operation.

David Meacock March 29, 2012

Ah, that looks like a handy option. I'll give it a try later, thanks!

David Meacock March 29, 2012

Ok, so I've given that a crack - it says it has removed them, but sadly they have not disappeared from my labels heatmap macro. Any idea why that could be?

Angelo Hannes May 27, 2015

I completely agree with @Phil Lancaster on this matter. This absolutely needs to become a standard feature of confluence. Actually it seems to be a bug, that labels attached to no content at all, are displayed in popular label lists, etc. But I've browsed some related issues, and there seems to be quite some history with this matter. Unfortunately, the outcome is rather unsatisfying.

Like # people like this
Craig Schaefer January 25, 2017

I agree with @Phil Lancaster and @Angelo Hannes as well, and think this should be a standard feature.  I've seen some plugins, but it makes no sense that a standard Macro would show labels that are not in use.  What purpose would that serve other than to clutter the interface.  

Is there anyway to stop this, other than find and filter out all the unwanted labels from the macro?

Like # people like this

Hi Craig,

We shared our solution for this problem with Label Manager for Confluence before. You can find detail from link.

Moreover,if you need,this can be automated with a job as a new feature .

Coline Macorol December 5, 2017

@Mert Karadağlı _ Köstebek Teknoloji _ your add-on is not a solution for this problem.

Hi @Coline Macorol,

If you can create ticket from link , we can try to resolve your problem.

However, this feature was developed after other customers request and it worked successfully.

Coline Macorol December 5, 2017

@Mert Karadağlı _ Köstebek Teknoloji _ I have created a ticket for this issue, and I really hope you can resolve it. 

13 votes
Phil Lancaster May 22, 2013

I have exactly the same problem. Labels that are not attached to any page appearing in the labels list macro. Reindexing makes no difference except to inconvenience users while it's happening. I have no intention of using either the CLI or mucking around with the database to fix something that so obviously should just happen. If there are no pages associated with a label, it should disappear. This is a bug and should be just fixed without requiring a use case or 100 people reporting or documenting it. There's far to much of this kind of thing in Atlassian products.

David August 20, 2019

Wow, just stumbled across this post from 2013 and it seems like this is still an issue. Crazy!

Like # people like this
1 vote
Thu Nguyen August 8, 2019

Hi,

you can try to empty pages in Trash. It works for us. 

1 vote

Hi,

We added new features to  Label Manager for Confluence plugin to remove unused (orphaned) labels exists on deleted contents

You can find detail from link.

Best regards,

1 vote
RianA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 28, 2012

Hi f1dave,

For this case, to get rid of this label I think it will be better to do it from database side. However please bear in mind that this might cause database inconsistency in your Confluence database, thus please shutdown your Confluence and backup your Confluence database and home directory before doing this.

You can delete it by running the following SQL query.

DELETE FROM LABEL WHERE LABELID NOT IN (SELECT LABELID FROM CONTENT_LABEL);

Please reindex after you've done so. Hope it helps.

Best regards,
Josua

David Meacock March 29, 2012

Wow... having to do database queries to solve this? I would have thought this would be a reasonably common use case. :( Kind of makes the product a little less useful in that way.

Like # people like this
0 votes
Jen Eldridge December 6, 2019

Can you rename a label? I accidentally created a few with a "+" symbol between words and it throws an error whenever I attempt to add another label to that doc, and it won't let me remove it. 

Jen Eldridge December 6, 2019

PS - I created an entirely new doc without the label, purged the old one from trash and the label still shows up in my browse by label macro. 

0 votes
Coline Macorol December 5, 2017

@Mert Karadağlı _ Köstebek Teknoloji _ your solution is faulty.

I bought your add-on because your trial version limits most label management actions. Follow all your steps to get rid of orphaned labels, yet the labels are still showing up on the "popular macros" heat map. 

Am I missing something, or are you deceiving customers?

Hi @Coline Macorol,

If you can create ticket from link , we can try to resolve your problem.

However, this feature was developed after other customers request and it worked successfully.

Like Travis Campbell likes this
Coline Macorol December 5, 2017

I will

Justin Cimino June 28, 2018

I have the same issue David and I'm in agreement with you.

Coline Macorol June 29, 2018

Hey @Justin Cimino@Mert Karadağlı _ Köstebek Teknoloji _ did a great job helping me figuring out the problem.

It was really simple, in my case.

Basically, Confluence was saving in the database all the labels for drafts that were still live, under several user accounts.

The solution was to delete these drafts. Then, run the function again, and voila! the voodoo magic worked.

Like Erik Anderson likes this
Justin Cimino July 2, 2018

Thank you @Coline Macorol!

0 votes
Phil Schwab May 24, 2015

Are the labels on attachments?

0 votes
Informatik Einkauf, IT-EL NA December 12, 2014

Having the same Problem with Version 5.5.3

Mario SBB Switzerland

0 votes
Joerg Bencke
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 29, 2012

Hm ... does the heatmap show spacewide or confluencewide tags ? Maybe you got them in another space.

Jeremy Largman
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 29, 2012

Or perhaps this is an indexing problem? If so, it's a bug that we should report. Try reindexing (Administration >> Content Indexing).

David Meacock April 1, 2012

It's for a specific space. All trash emptied for it. Content re-indexed. Same issue :(

Jeremy Largman
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 1, 2012

Ah - sorry about the guess on the index. I just found it. It's at https://jira.atlassian.com/browse/CONF-6520. You'll need to purge the trash.

David Meacock April 1, 2012

As I said in the original post, the trash has already been purged :(

J C June 2, 2014

I've deleted all the labels that I didn't want from the LABEL table, and the corresponding rows from the CONTENT_LABEL table, but the deleted labels are STILL showing up in the popular labels heatmap. How can I purge them from the heatmap as well? I have re-indexed, purged trash, looked for orphaned pages, etc. They are all gone. There are no labels which correspond to these entries. Where else can I go to delete them from the heatmap?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events