Is there a way to bulk rename pages in confluence?
Asked by Gianna Migliorisi:

We have a bunch of pages that are prefixed with our "product" name, which has been re-branded. Is there a way to bulk rename these pages within confluence or is an external plugin required?  
[](https://community.atlassian.com/t5/Confluence-questions/Is-there-a-way-to-bulk-rename-pages-in-confluence/qaq-p/382824?attachment-id=10985){#link_118843e82aa2df}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/64766/1/scr.png){#display_118843e82aa2df_0}


Answers:
author: Andre Lehmann
body: I think the CLI from BobSwift is the best and easiest way to do that.

As mentioned in an other answer, that the script isn't working, here a working command:

```
-a runFromPageList --space SPACKEY--title "TITLE" --descendents --common "-a renamePage --space SPACKEY--title \"@title@\" --newTitle \"PREFIX-@title@\""
```

Replace SPACEKEY, TITLE and PREFIX.

Kind regards  
Andr?


author: Pascal Van Hecke
body: We use the <https://marketplace.atlassian.com/plugins/com.nurago.confluence.plugins.treecopy> plugin. Using that, copy a page tree, and before copying, bulk rename pages with a find-and-replace (third screenshot).


author: Davin Studer
body: Another option would be to use the WebDAV add-on(comes pre-installed). You could map Confluence as a drive and then use a batch/shell/powersehell script to change them.


author: Benoit Plet
body: You could use Atlassian Command Line Interface (CLI):

<https://marketplace.atlassian.com/plugins/org.swift.atlassian.cli>

I used it to do exactly what you have been describing.

comments: author: Michal Marko
body: Hi Benoit,

could you provide me some hint, which commands (or set of commands) did you use to rename bulk of pages?

Many thanks.

Mike


author: Nicolas Casel
body: Thanks @Benoit Plet .

Same question as @Michal Marko , could you provide an example? Because the vendor documentation does not talk about bulk renaming:

<https://bobswift.atlassian.net/wiki/display/CSOAP/User%27s+Guide>


author: BenoitP
body: Here is an example that adds a prefix ("RG - ") to all pages and descendants:

1. List the pages you want to use:  
   --action getPageList --space "MySpace" --title "MyPage" --descendents --file "getPageListOutputFormat2.txt" --outputFormat 2
2. Do the rename:  
   --action runFromList --common "--action renamePage --space ""MySpace"" --title @entry@ --newTitle ""RG - @entry@"" --name: getPageListOutputFormat2.txt --content: @entry@" --list "Title","Id","Parent id","Author","Created","Modifier","Modified","Version","Url"


author: Wiki Support
body: I tested your script and it's not working. The script is always trying to rename first page with name "Title", which does not exists.

Check it...


author: Wiki Support
body: See attachedscr.png also print screen


author: Adam Locke
body: Hi there! I am running into the same problem. Did you find a solution?

Cheers,

Adam


author: Alex Yasurek
body: The only way I currently know is to use the API and try to do it that way. You would need to write a script that pulls every page title, checks if that word appears in it, and if so then replace it and update the page.

comments: author: Ben Krichko
body: Hi [@Alex Yasurek](/t5/user/viewprofilepage/user-id/5055822)

Could you send me that API you are referring to? We have 40+ confluence pages that get copied every two weeks (Project updates) and i'm looking for a more efficient way to remove the leading "1" off the front of each copy rename.


author: Alex Yasurek
body: Hi,

You would need to use the API call to update a page:

<https://docs.atlassian.com/atlassian-confluence/REST/6.6.0/#content-update>

You would have to use a GET call to pull each page and then use the PUT call to update, unless you know before hand what the pageId is of each page you need to update.

If you want a plugin that will make this a little easier, but still manual, then check out: <https://marketplace.atlassian.com/apps/1214087/space-admin-for-confluence>


author: Ben Krichko
body: [@Alex Yasurek](/t5/user/viewprofilepage/user-id/5055822)

OK...I ran the GET call and fetched a specific page. I want to rename all items that show "1Nick" to just "Nick". In doing a search function, there are 45 references. Is there a certain REPLACE ALL function I'm missing.

![Confluence.png](https://community.atlassian.com/t5/image/serverpage/image-id/284259i6A772900591265AB/image-size/large?v=v2&px=999 "Confluence.png")


author: Alex Yasurek
body: There is no replace all function when it comes to the API. You would have to update each page one at a time with the API.

If you want a replace-all type function then that would be something done in the actual app with a plugin, like that space admin plugin I linked to.


Tags: confluence-administration