Note composer: Relink mentions (backlinks) from a note to another file

Use case or problem

I frequently end up having duplicated notes in my vault (e.g. after a renaming of a file, sync sometimes recreate the old version).
Some notes are no longer relevant, and its backlinks should instead mention another more relevant note.

As a workaround, I want to be able to remap (relink) backlinks of the duplicated note to the other most recent note and delete the duplicated.

Proposed solution

Leverage the Note composer core plugin by adding an option to tackle this use case:

  • Add a relink option in the command palette (e.g. “Note composer: Relink backlinks of this file to another file…”). It behaves almost the same way as “Note composer: Merge current file with another file…”, but this time without importing the current note content into the destination file.

Current workaround (optional)

For now, it’s a bit time-consuming.

  • I need to either go through all backlinks to change them to point to the other file.
  • Or do the merge, then delete the imported content that I actually didn’t want to import.

Then, I can safely delete the older note.

Related feature requests (optional)

Couldn’t find related feature requests, will update if I end up finding some.

1 Like

To save a little time you could select all the content (Ctrl/Cmd A) and delete it before merging.

In my case I would still need to delete content in the merged note, because my template contains a frontmatter.

I’ve submitted a complementary feature request to differentiate template for new notes and merging notes like here. Check it out here: Note composer: Differenciate templates for merge notes and create new note

I am struggling with a lot of notes with some duplicate content, and could totally see this as well as a diff function as part of a set of tools (or workflow) for unscrambling a difficult vault. Thanks.