Forums

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

List of Pages where Attachment is used

Frederik Frey May 29, 2017

Hello,

I was wondering, if it is possible to get an overview of all pages, where one attachment is linked to.
I'm currently facing the issues, when deleting an attachment, it may be used in some other page too. When i delete a page, I do get the information where the page is set as a link, means I do know which pages i have to check.

Anybody had the same issue?

Thanks for your help.

Best,

Frederik

2 answers

1 vote
Robert Reiner _smartics_
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.
April 8, 2025

@James Dellow has answered a similar question here: https://community.atlassian.com/forums/Confluence-questions/Re-How-do-I-identify-which-pages-an-attachment-is-associ/qaq-p/662209/comment-id/88817#M88817

His solution certainly is not a to-be-sure-100% approach, especially if the name of the image is often "my-image.png", but it may be worth a try to get started.

I encountered some difficulties in case the filename contains dashes or spaces. So you may want to quote them, for instance

"photo - cats in spring.png"

You may also find the pages by using the attachment ID. Just paste the ID (you can extract them from the attachment URL on the "Attachments" page of the Confluence page). Again, there may be false positives.

The following may also be useful, where the number is the ID of the attachment (in this case you very likely do not get pages where the ID's number is used in another context):

"data-linked-resource-id=\"46793026\""

 For some reason the following has better results on our server (version 9.2 LTS, again mind the quotes):

"data-linked-resource-id=46793026"

One caveat: I am not sure what types of information are referenced by the data attribute. Maybe you find by chance a referenced user with that ID. So this may not be a solution for automation. :-) 

For the few times I have need it, it provided good enough results. For a bullet proof approach you may want to have a look directly at the database or create a script or app that uses the designated Confluence internal services.

Will
Contributor
April 8, 2025

Thanks so much! upvoted!

0 votes
Vero Rivas
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.
January 18, 2022
Will
Contributor
April 2, 2025

None of these are about links... they are to the attachment and host page.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events