Global delete labels

In our large confluence instance we want to delete strange/unwanted labels which have been created by unknown occasion/reason but to delete then manually from the pages is a tedieus task.

Is this prossible with sql, directly on the database or other plugin/option?

4 answers

1 accepted

1 vote
Robert Chang Atlassian Team Dec 18, 2012

Hi Arthur,

Because of the foreign key, you'd need to remove the relevant entries form the content_label table first. For example:

DELETE FROM content_label WHERE labelid IN (SELECT labelid FROM label WHERE name = 'labelname');

Then follow that with:

DELETE FROM label WHERE name = 'labelname';

Please keep in mind this has not been tested, so be sure you back up your database first, or better yet, test this on a dev instance.

Thanks Robbert, this is realy something for a plugin to support Maintenance on larger installations. Do you now this on some backlog?

Hi Arthur,

Labels are stored in the LABEL table, so you could use SQL to remove the labels that way. The other option would be to use the Command Line Interface plugin as this will also allow you to manage and delete the labels stored in your Confluence instance.

All the best,
John

When i try to delete a label is complains:

#1451 - Cannot delete or update a parent row: a foreign key constraint fails ("confluencedb"."CONTENT_LABEL", CONSTRAINT "FKF0E7436E27072AEF" FOREIGN KEY ("LABELID") REFERENCES "LABEL" ("LABELID"))

Hi,

You could do it with Label Manager for Confluence plug in.https://marketplace.atlassian.com/plugins/com.kostebekteknoloji.plugins.confluence.confluence-label-manager
You could search for similar labels in a space and then merge them into one standard label.
You could also do bulk operations like appending , adding and removing labels.
Documentation is here:http://www.confluence.kostebekteknoloji.com/display/PLUG/Label+Manager+for+Confluence
Regards,

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

357 views 20 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you