Plugin: Advanced Rename and Delete Handler - attachments follow the note when you rename or delete it

Disclaimer

Is this plugin open source? Yes
Is this plugin completely free? Yes
Is this plugin vibe-coded beyond the author’s ability to comprehend how it works? No
Community Directory: advanced-rename-and-delete-handler


Obsidian updates the links to a note when you rename it, and stops there. The images you pasted into that note stay behind under the old name. Delete the note and they’re left behind entirely, referenced by nothing, in a folder named after something that no longer exists.

This plugin takes over renaming and deleting for the vault:

  • Links follow a renamed or moved note, including link text that was just showing the old file name. A link you gave your own words is left alone.
  • Attachments travel with the note that owns them, folder and all.
  • Deleting a note can clean up after it: the attachments only that note used, and the folder it leaves empty. It’s off by default, because each option removes something. A Delete empty folders command sweeps up the ones already lying around.
  • A shared attachment is never deleted with one of the notes using it. It can move to the note that still uses it, and when that’s ambiguous the plugin asks instead of guessing.
  • Excalidraw drawings count as attachments, not notes, and you can limit the plugin to part of the vault.

It does nothing until you turn it on. Other plugins of mine (Custom Attachment Location, Consistent Attachments and Links and others) used to each carry their own copy of this logic. Two handlers acting on one rename corrupt links, so that logic now lives here once, and those plugins ask you to install this one. Its settings tab lists which plugins depend on it.

Rename a note and its attachments follow

The docs are a demo vault: run Advanced Rename and Delete Handler: Open demo vault, or read it on GitHub.