Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Can I automatically find and delete unused (orphaned) attachments?

Steffen Heller
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.
October 17, 2012

Hello,

I have wiki pages where a lot of images are still attached to the page but are not included in the page anymore (because they were replaced or updated).

I was wondering if there is a way to erase this outdated images automatically. So far I do it all manually by making a copy of the wiki code, search for missing images and then reinclude them.

Thanks.

6 answers

1 accepted

1 vote
Answer accepted
Denise Unterwurzacher [Atlassian]
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 15, 2013
4 votes
RianA
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.
October 17, 2012

Hi Steffen,

There are scripts written for this. Please refer to this page for more information. If it worked correctly it will flush the missing attachment.

Hope it helps

Josua

Steffen Heller
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.
October 17, 2012

Thanks Josua.

But I am afraid this is not for me. I am just a normal user and I can't access the server's installation or run SQL commands. I was hoping to find a "frontend solutions" where things like that are not necessary.

Can I count that out? (Knowing this wouldn't be that bad and at least I knew that I could stop searching.)

Denise Unterwurzacher [Atlassian]
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 15, 2013

Hi Steffen,

Sorry for the delay in responding to you! There's currently no way to do this through the front end, but a feature request has been created here:

https://jira.atlassian.com/browse/CONF-16577

At Atlassian we allow our customers to input into our bug fix and feature request prioritisation. We do this with the voting system - the more votes and detailed comments a ticket has, the more likely it is to be implemented. We use this as a way of gauging the needs of our customer base as a whole. I'd recommend voting on that ticket, and adding a comment detailing how it affects your system and what you would like to see. If you also add yourself as a watcher to the ticket, you'll be notified whenever it's updated.

-Denise.

PS. I actually just found some scripts which might help, so I'll post that as a separate answer.

1 vote
Adilson Garcia May 23, 2019

The accepted answer do not consider attachments in comments and page history :-(

Using the script of the accepted answer as a base, I've corrected it, and unified all the tasks in only one script:

https://jira.atlassian.com/browse/CONFSERVER-16577

0 votes
Jan March 8, 2018

The links provided here help me a lot, thanks! 

Many of our users not working much with Confluence assume that deleting an attachment link, file viewer etc. on the page / blog post will also delete the attachment. Some also forget about this. They take the attachment off the page and forget about it being physically still there. I guess this is the reason why we have quite a mess here, too. The fact, that attachments do not always have to be linked or embedded in order to be displayed makes it not easier (I think about macros like attachments / attachment table etc.) 

0 votes
AlutusTech December 14, 2016

Hello,

We came across the same need to be able to easily identify all unused attachments in a Confluence instance and decided to create a plugin for it.

You can find it here:

https://marketplace.atlassian.com/plugins/com.alutustech.confluentis.confluentis-unused-attachments/

Let us know if it helps.

AlutusTech Team

0 votes
Midori
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 20, 2015

Archiving Plugin automatically tracks unused pages, and this mechanism could be easily extended to track unused attachments, as well. (The tracking code does not actually depend on the content type at all.)

There is a public feature request for this. Please vote for this and when it gains enough interest, we will make sure to implement it: https://midori.zendesk.com/entries/26965398-Archiving-orphaned-attachments

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events