find unused assets in aem | Community
Skip to main content
September 7, 2016
Solved

find unused assets in aem

  • September 7, 2016
  • 3 replies
  • 6267 views

Our assets library keeps growing in size and we need to figure out a way of finding all unused assets , then archive / delete them.

Has anyone solved this in aem 5.6?

thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by antoniom5495929

Tested in AEM 5.6 with SP2.

You can use the OOTB functionality.

It's necessary to select (from damadmin) the asset that you want to check and select -> tools -> references. In this way you can see if the image is used and in which pages.

The screen below:

3 replies

kautuk_sahni
Community Manager
Community Manager
September 8, 2016

Hi 

Please have a look at older forum post covering this same topic.

Link:- https://forums.adobe.com/thread/1105276

//You can use http://wemcode.wemblog.com/get_asset_reference_in_page to write your script. First find all Asset using either xpath query (With nodeType as dam:Asset) or iterate through all nodes under /content/dam and then find reference using above code and if reference count is zero then remove that node (Be careful, that non reference node does not mean you will not use it in future). After deleting all asset don't forget to run datastore Garbage collection. Also make sure that you remove all those asset from publish instance as well (Deactivation of those node should do that).

One more reference article:- http://stackoverflow.com/questions/35187627/how-to-find-unused-images-from-cq-dam

// How to find unused images from CQ DAM

 

I hope this will help you.

~kautuk

Kautuk Sahni
antoniom5495929
antoniom5495929Accepted solution
Level 7
September 10, 2016

Tested in AEM 5.6 with SP2.

You can use the OOTB functionality.

It's necessary to select (from damadmin) the asset that you want to check and select -> tools -> references. In this way you can see if the image is used and in which pages.

The screen below:

kautuk_sahni
Community Manager
Community Manager
September 12, 2016

---------------------

Not an Answer

---------------------

Adding Good reference articles.

 

If you need to further filter the search, like Find Assets Referenced By Image Components, please refer to article below:-

Link:-  http://stackoverflow.com/questions/35074708/aem-find-assets-referenced-by-image-components

 

If page specific, 

Link:- https://cqwemblog.wordpress.com/2013/12/07/how-to-get-image-dam-reference-from-any-cq5-page/

 

~kautuk

Kautuk Sahni