Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do you know which pages are referring to / using an image?

Greg Kullberg
Contributor
November 5, 2014

When you're viewing what's attached to a page, you can click Properties to see some basic details about an image.  An image could be displayed on the current page or any other page on the site.  Is there any way to determine which pages are displaying that image?

3 answers

1 accepted

6 votes
Answer accepted
Deividi Luvison
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 8, 2014

Hey Greg,

In that case try the following:

select s.SPACENAME, c.CONTENTID from CONTENT c 
inner join BODYCONTENT b on c.CONTENTID = b.CONTENTID
inner join SPACES s on c.SPACEID = s.SPACEID
WHERE b.BODY LIKE '%ri:filename="Capturar.PNG%'
AND c.PREVVER IS NULL
AND c.CONTENT_STATUS != 'deleted';

The above query will search for all pages that have the image you want in it's xhml storage format. In above query my file was Capturar.PNG, so when you try it make sure to change that to the file you want, after you run it you will get the space name and page id where the attachment is being used smile.

Hope it helps.
Thanks and Regards,
David|Confluence Support Engineer
2 votes
Guilherme Nedel [Atlassian]
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 6, 2014

Hello Greg, you can run a site wide search using the image title. Alternatively there are a couple of routes:

  • Querying the database directly:
select pageid from attachments where title like '%<ATTACHMENTNAME>%';
  • Using the Attachment list macro to display attachments in each page:

https://confluence.atlassian.com/display/DOC/Displaying+a+List+of+Attachments

Hope this helps.

0 votes
Greg Kullberg
Contributor
November 6, 2014

Hey Guilherme - I think that's a little different that what I'm talking about.  For example, I can attach "image.png" to a page, and then display it on that page.  While still in edit mode, I can copy the contents of that page and paste it onto another page.  Doing so will still display "image.png" from the original page on the new page.  Basically I'm trying to see all the places where "image.png" might be displayed on other pages - not where it's attached to other pages.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events