How to add labels to confluence pages in bulk?
Asked by Rahini Balamurugan:

We are using confluence server. I know how to add label to a particular page. but I wanted to know if there is an option for the below requirement?

* Is there a way to select multiple pages and do a bulk update to apply a label ?
* Is a way to apply a label recursively from the parent page to all of the corresponding child pages.
* At last, what are all the available options to apply labels to pages in Confluence.  

  Kindly someone help !!!!!

\~Rahini


Answers:
author: Kishan Sharma
body: Hi [@Rahini Balamurugan](/t5/user/viewprofilepage/user-id/2106965) You can use REST API to find out pages by content ID and apply labels to them. Alternatively if you have ScriptRunner for Confluence app you can do some bulk operations on labels. Refer [this thread](https://community.atlassian.com/t5/Confluence-questions/labels-in-confluence/qaq-p/782291) for details.


author: Rahini Balamurugan
body: [@Kishan Sharma](/t5/user/viewprofilepage/user-id/554991) / [@Jillian Patterson](/t5/user/viewprofilepage/user-id/1842270) ,  

Can you share the steps for updating labels in bulk using REST API for confluence?

Thanks,

Rahini

comments: author: Kishan Sharma
body: Please refer [Add Labels](https://docs.atlassian.com/ConfluenceServer/rest/7.12.3/#api/content/{id}/label-addLabels) method to add labels to your confluence page. You can try it once on a sample page. Once you find it working, just use "Get content" method to get all your pages IDs, and loop through them and add labels to them one by one.


author: Rahini Balamurugan
body: Thanks [@Kishan Sharma](/t5/user/viewprofilepage/user-id/554991)


author: Rahini Balamurugan
body: [@Kishan Sharma](/t5/user/viewprofilepage/user-id/554991) / [@Jillian Patterson](/t5/user/viewprofilepage/user-id/1842270) ,  

**curl -u admin:admin -X GET "<https://devconfluence61000.example.com/display/RS/API+TESTING+page>"**   

The above command retrieves the entire page details along with the label name.

whereas, while using the page id of the above page like below  

**curl -u admin:admin -X GET "<https://devconfluence61000.example.com/confluence/rest/api/content/301663506/label>"**

The above command also retrieves the entire page details but I couldn't see the label details.

Please help !!!


author: Kishan Sharma
body: In the second command you should get a response something like this -

*{"results":\[{"prefix":"global","name":"**label1**",*

here ++label1++ is the label attached to the page.


author: Philip Domenico
body: How about for the those of use who are NOT admins?


author: Jillian Patterson
body: Hi [@Rahini Balamurugan](/t5/user/viewprofilepage/user-id/2106965)

Like Kishan mentioned, if you've got ScriptRunner for Confluence you can add, remove, or rename labels in bulk (and many other operations) and code-free using the built-in scripts. Hope that helps!

comments: author: Rahini Balamurugan
body: Sure thanks [@Jillian Patterson](/t5/user/viewprofilepage/user-id/1842270) and [@Kishan Sharma](/t5/user/viewprofilepage/user-id/554991)   

we are not having ScriptRunner for Confluence. Do we have any plugin which will help me?

Thanks!!!!


author: Stavros_Rougas_EasyApps
body: This post is from 2021 [@Rahini Balamurugan](/t5/user/viewprofilepage/user-id/2106965), if you have moved to cloud then you might want to get an app. For us it was important to restrict some label features, like merging, so we built an app called [Label Manger by Easy Apps](https://marketplace.atlassian.com/apps/1232224/label-manager-by-easy-apps?hosting=cloud&tab=overview) that does this.

In my opinion you don't want all users having access to all the bulk editing features.


Tags: confluence-server

server