I need confluence Page IDs for all pages containing a specific string.

Peter DeWitt Community Champion Nov 01, 2017

OK,here is the scenario.  We have a Confluence instance that is a number of years old.  Over the years users have created many pages (2000+) that contain passwords in plain text.  Our security team has a list of these passwords and they need to remove them from the pages they appear on and remove the history of those pages.  They would like us to generate a list of page URLs for them.  If we have the page IDs we can concatenate the URLs in excel. 

1. Does anyone have any ideas on how to do this either through the API or direct to DB?

2. Has anyone come across a utility that would allow the scrubbing of specific strings within all of Confluence; find and replace like?

6 answers

4 accepted

1 vote
Ann Worley Atlassian Team Nov 01, 2017

I am not sure how to generate a list of URLs with the particular strings (passwords) but as far as a search and replace strategy, you could try a procedure similar to: How Do I replace all 'hard' links to my old Base URL The first two options will replace content in historical page versions.

1 vote
Stephen Deutsch Community Champion Nov 07, 2017

Here's another option:

Search and Replace User Macro

You could use this to search for the search terms, and it will create a table in Confluence with links that you could copy and paste into Excel, and then you wouldn't even have to look up the IDs. Either that or I could modify it so it would display the IDs as well.

It has replace functionality too, so you could use it to make the necessary changes. It has a preview option so you can see what changes it is making to the code of the page.

Davin Studer Community Champion Nov 07, 2017

Pretty slick user macro! I might be using this myself for some manual replacements I have been doing.

0 vote
Alexey Matveev Community Champion Nov 01, 2017
0 vote
Davin Studer Community Champion Nov 01, 2017

Keysight Admin Tools for Confluence has a utility for find and replace throughout the whole wiki. Use with caution and test first on a non-prod version. :)

0 vote
Peter DeWitt Community Champion Nov 07, 2017

Guys, tanks for the answers.  This is exactly what I was looking for.  Options. :)

Davin Studer Community Champion Nov 08, 2017

If we get to choose our tanks I'm gonna have to go with the good old Sherman.


0 vote
Davin Studer Community Champion Nov 07, 2017

If you want a SQL query to find the pages this should get you what you want.

select S.SPACENAME, C.*
C.PREVVER is null
and C.CONTENT_STATUS = 'current'
and B.BODY like '%YourStringHere%'

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 Friday 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...

301 views 11 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