How to find all pages that link to a specific attachment?

I have several pages with dublicated attachments. But how do I find out which attachments haven't got any incomming links? In other words how do I find pages that link to a specific attachment?

1 answer

Hi Tom,

This can't be done through Confluence UI yet. If you have access to the database, you can run this query to find the page/blog that link to specific attachment:

select s.spacename, c.title, c.contenttype from content c inner join spaces s on c.spaceid = s.spaceid where c.contentid in (select contentid from bodycontent where prevver is null and body like '%filename="filename.ext%');

Change the filename.ext to the name of attachment (e.g.: README.txt).

Regards,
Samuel

Thank you for your reply. I do have database access, but the query you suggest will not work as there are likely to be many pages in a space with attachments with same filename, for instance 'readme.txt'.

Also a sql query is not very applicaple for the average confluence users.

Do you know if there is a JIRA request to fix this?

It seems odd that links to attachments are not listed on the 'page information' page, and that you get no warning when deleting a page if there are other pages with links to attachements on the page being deleted.

@Samuel Patrice Rompas [Atlassian]'s reply back in 2014 mentioned this can't be done through Confluence UI yet - is this feature on the Roadmap? It would be very useful to be able to display a list of all the pages in a space that link to a specific attachment - for example, via an 'incoming links' information section, perhaps under 'Properties'.

The use-case would be to see at a glance which pages an image has been used on. This would save time in my situation when updating screenshots in technical documentation. Thanks

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

781 views 23 12
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