How can I search for where a page is included in Confluence?

We use the "Include Page" macro extensively in Confluence for managing content that needs to be consistent across our documentation such as product names and common instructions. Sometimes when editing an included page, it's useful to see where the page is included. Is there any way to search within Confluence for where a page is included? Is there a plugin that provides this sort of advanced search?

5 answers

This widget could not be displayed.

When I am on a page and choose Page Information from the ... menu, the "Links to this page" section contains pages that include this page.

This widget could not be displayed.

I would write a macro. Here are the steps that should help you get started:

1. Get the root page of the space.

2. Load a sorted list of all child pages. Each page will be a ContentEntityObject. API details here: http://docs.atlassian.com/atlassian-confluence/latest/com/atlassian/confluence/core/ContentEntityObject.html

3. Iterate over each page in the list.

4. On each iteration, call the getAttachmentsNamed() method on the page, and pass in the current page's name as the String argument. See the API for more info: http://docs.atlassian.com/atlassian-confluence/latest/com/atlassian/confluence/core/ContentEntityObject.html#getAttachmentNamed(java.lang.String)

Interesting idea. I didn't know macros could do so much. To get started, I stole some code from "List attachment on another page", but I don't see any of my included pages in the list of attachments.

You know what, I think I misread your original post. Not sure if there's a way to find included pages (at least, not as attachments). There are a bunch of isIncluded() and similar sounding methods in the API, but without much doc on them, it's hard to tell if any would work.

This widget could not be displayed.

Just came across this post while looking for something else.

If you're willing to do manual work then you can do a search for any macro by doing a search for "macroName: include*" - note that this is case-sensitive. It will list every page which uses that macro. You can't, AFAIK, add parameters (e.g., which specific include page you're looking for), but at least you can find out every page that has an include.

For more info: http://ffeathers.wordpress.com/2011/11/04/how-to-search-confluence-for-usage-of-a-macro/

Thanks, that's a good tip. We use the include macro so heavily that knowing a list of pages that contain includes isn't enough (there are hundreds), its necessary to find the list of pages that (recursively) include a given target.

This widget could not be displayed.

I'm sorry I have no answer to the question, but wanted to bump it up in case anyone else out there has found a workaround solution.

We're placing images and video content in an 'Inclusion Library', as suggested by Sarah Maddox in her book 'Confluence, Tech Comm, Chocolate', but what is not covered in the book is what to do when you update the page in the Inclusion Library. In other words, how do you ensure the updated content is still relevant to the pages where it has been included?

We need to find out where a page has been included. Can anyone help with this please?

This widget could not be displayed.

In case my solution is useful to anyone else, I wrote my own "search engine" in python using the XML-RPC API to index content from all pages. It has a simple web interface that links to all pages that include a given target page.

I'm sure there's a more efficient way to do this with a Confluence plugin (or Gadget?), but I haven't yet figured out where to get started with that.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 17, 2018 in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

599 views 8 6
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