Hi everyone! Has this just been dropped suddenly? Or is it implemented and I have not found it? I am only starting with Obsidian now, but can already tell that my attachments folder will be a huge mess if this is not available. Specifically when dragging a lot of screenshots into the notes, that usually do not have names suggesting their content.
This is an open feature request.
Above, youāll see a workaround using a plugin. (I havenāt tested it personally.) Remove unused attachments - #7 by Vinadon
Thanks for the quick reply! @rigmarole Iāll check out the third party plugin then.
Thereās also a new plugin called Janitor that does this (and other things)
Iāll check on the suggested plugins after I made progress on post import cleanup from Evernote.
My attachments folder currently has over 18k files in it. After I remove notes that whose only content was an attachment (think, pdf document) , Iāll run a plugin and see how many it cleans up.
This feature works be a great core feature imho. Maintaining a file reference count and deleting the file when the count hits 0 isnāt a small task, though.
Perhaps itās better to move those files in a folder āattachments_not_in_useā instead of more or less blindly delete them.
A temp location could be handy in case you restore a note that you deleted by accident. or we can say that the used is responsible for restoring it from the ātrashā folder or from backup.
ie
User deletes last note that references an attachment.
Obsidian deletes attachment
User restores note
attachment link is now broken.
Totally agree with the need of an āautomatic removalā of attachments after a note was deleted. It is painful to do this manually and really a bummer when using the app with attachments. Please add something that takes care of this.
If you read the thread, there are plugins that do this.
I use this plugins called nuke orphans btw
čæäøŖę©å±éåøøę£
This extension is great!
Use case or problem
I would like that if I delete a note, I would be asked what to do with the documents linked in it, if they have no other references, whether to keep them or delete them.
Proposed solution
When I delete a note I would like that if there are linked media that are only in that note, I would be asked whether to keep them or delete them
Current workaround (optional)
All files remain
Hi everybody!
DONāT EVER USE SHITTY PLUGINS FOR FILE CLEANING, THEY WILL ERASE EVERYTHING THAT DOESNāT NAILED TO YOUR DOCKS, AND YOU CANāT THAN RESTORE THE STRUCTURE!
THE MOST UGLY SOLUTIAN AS IT CAN BE. I LOST ALL MY ATTACHMENTS ![]()
In details:
- They just move files to bin, and you canāt restore them from bin to their previous location. You can get them as a huge of files and thats all you can do.
- They will not ask you about DO YOU REALLY WANT TO DO THIS HORRIBLE THING!
- The even will not show you the list of this filesā¦
You just lose everything.
This is why when you activate plugins you agree to the risk. It makes the suggestion that you backup your work. Even without plugins, itās a very good idea to make backups for any important data.
Iām sorry you lost some work, and I know thatās probably not what you want to hear right after losing some work.
Keep backups! Always.
And other suggestions are to use version control such as Git. And to use a test vault when youāre testing out new plugins.
You can do local backups.
You can do backups in Dropbox/ GDrive/ Onedrive / Git.
Familiarize yourself with how plugins work and make sure you configure them correctly.
If you combined different plugins, there is a risk things donāt go well e.g. plugin to clean orphan attachments automatically can run havoc with another plugin offering same or similar functionality or unrelated functionality e.g. plugin to move attachments or plugin to sync attachments (which also can delete attachments). So you have 2 plugins, one deleting when doing sync, another plugin handling orphan attachments⦠this can cause data loss.
Thatās why important to configure plugins conservatively at most so you preserve control.
If you have important content you canāt lose, I would suggest look for other options such as Joplin which also has plugins but they are non-destructive, meaning they handle add-on function on Joplin. The core function such as maintaining notes and attachments is handled by Joplin directly.
You do have the option to export your notes in MD format if you need.
ā
Thatās why I would stress the importance of this:
Obsidian should handle destructive functions as part of the core application, and not rely on 3rd party plugins:
1. creating notes
2. renaming notes
3. moving notes
4. deleting notes
5. moving attachments (have flexibility, root folder, note folder, subfolder in attachment folder etcā¦)
6. renaming attachments (e.g. rename attachment to match the note name, unique attachment namesā¦)
7. deleting attachments (orphans)
**If note is moved to another notebook folder, the attachment would be moved accordingly e.g. **
Example:
Vault / Notebook name / Note123.md
Vault / Notebook name / .attachments / Note123 / Note123.PDF (attachment)
I know there are other people managing things differently, in any case, it would be crucial to have these functions part of Obsidian because that would likely prevent some if not all issues like this one.
I wanted to edit my post and I canāt edit anynore ⦠here is what I wanted to add:
If note moves from Notebook Name to another notebook folder, both the note and the attachment can move.
If I add a new attachment to the note, the new attachment will be copied into the correct location Vault / Notebook name / .attachments / Note123 / ā¦
The reason I have a number of plugins installed is because how weak Obsidian is when it comes with attachment management and how much time it takes to solve the orphan files issues. If I let the plugins to clean the issues for me, I risk losing data relying on 3rd party plugin.
This is not an optimal situation.
Well, this would be useful!
Temporary solution
Please add command:
Delete current file with "lonely" attachments
ālonelyā - unused in another notes.
This sounds like a useful feature that should be implemented natively. People say plugins are unreliable in this regard, and cleaning files up manually can get annoying and tiresome.
Another use case is moving notes between vault. To my knowledge, you can open a parent folder to other vaults as a vault, and move notes between vaults that way. However, the parent vault has no way of know which subfolder(s) is the āattachmentsā folder and will likely not move the file.
So then you have attachments in vault A that link to a file in vault B.