The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

How can I find unused attachments?

Martin
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 Champions.
January 23, 2020

We can have a page on our Confluence environment which has over 30 images and PDF attachments. 10 of those for example might no be shown on the page any more because they have replaced with a file using a different name.

How can we locate all unused attachments? Is there a select SQL we can execute which can help us find this out?

Our site storage is forever increasing. Having a list of all the redundant files will allow us to clear some space.

 

4 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Lucas Modzelewski _Lumo_
Atlassian Partner
January 26, 2025

There is an ongoing ticket for Confluence: https://jira.atlassian.com/browse/CONFCLOUD-16577

I recently had to remove some attachments, and I've made an app for that. You can check out the app here: https://marketplace.atlassian.com/apps/1236523?tab=overview&hosting=cloud 

0 votes
Robert Hellmann
Contributor
October 6, 2021

I just created a SQL statement for Oracle. It returns the file size and whether the attachment title is found in bodycontent clob field (the real content).

select 
c.contentid,
c.title,
c.lastmoddate,
c.pageid,
round(cp.longval / 1024 / 1024, 1) as "size MB",
(case
when DBMS_LOB.INSTR(b.body, c.title) > 0 then
'true'
ELSE
'false'
end) "found in page"
from content c
join spaces s
on s.spaceid = c.spaceid
JOIN Contentproperties cp
on cp.contentid = c.contentid
join bodycontent b
on b.contentid = c.pageid
where lower(s.spacekey) = 'amerisc'
and lower(c.contenttype) = 'attachment'
and cp.propertyname = 'FILESIZE'
order by c.pageid, c.title
0 votes
AlutusTech
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 1, 2020

We have created this plugin which scans the Confluence database to identify unused attachments:
https://marketplace.atlassian.com/apps/1216349/confluentis-unused-attachments?hosting=server&tab=overview

0 votes
Nic Brough -Adaptavist-
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 Champions.
January 23, 2020

Confluence doesn't track if something is used or not, unless you install and configure one of the apps that tracks views.  I have a feeling there is only one that tracks attachment "view" (I use quotes because preview, view-in-place and download are all tracked as the same thing)

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events