Is there a somewhat efficient (and easier) way to manage media files that are not used in a content page, so that it’s not taking up space? I know I can go into each individual media file’s “info” and see what it’s being used on, but I was curious if there’s a better way?
You could use the IRelationServiceto query the “Related Media” relation type in Umbraco. This will provide a list of all media items that have a related document, with the parent being the document and the child being the media item.
If you want to find items that are un-referenced you could team this with the IMediaServiceto loop through the tree and discover which are/aren’t referenced in your content.
1 Like