It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

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.

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:

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:

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.

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:

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.

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?

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
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published Thursday in Confluence

Confluence CVEs and common questions

Two vulnerabilities have been published for Confluence Server and Data Center recently: March 20, 2019 CVE-2019-3395 / CVE-2019-3396 April 17, 2019 CVE-2019-3398 The goal of this article is...

268 views 0 12
Read article

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