Merge notes and update backlinks

This feature request was incorrectly posted in the “plugins” section before: Merge notes. A mod might want to move that post into the feature requests section.

It would be very useful if you could merge two documents into the same one by renaming document 1 to the same name as document 2. If you try that now you get an error. This is important because otherwise you have to manually update backlinks.

Without this feature, you have to put in a lot of thought to what your final page structure will look like when making a new page, because you know you can’t easily fix mistakes. With this feature the friction of adding new pages would be lower.

33 Likes

Merging two documents by merging one into the other should be possible. (The document being merged having its content added at the end of the first which retains its name. )
But doing it the way you suggest would impact a protective mechanism for existing links, which is why I assume you encounter the X.

2 Likes

The devs generally look at both as possible core features. I’m sure we’ll all get clearer on how to delineate plug-in development when the API goes public. For now I’ll leave that thread as-is.

1 Like

Yes, I encounter the X now because the devs are protecting me from overwriting content because they haven’t written code yet to do a smart merge. What you suggest is what I had in mind: concatenate the content, and update all the backlinks. It’s the backlink updating that is the tricky / [time consuming] part to do manually.

1 Like

@symme7ry I’m running into this issue now that I’m consolidating my notes from different places into Obsidian. Have you found a good work around?

This is a must-have feature for me, because of one specific use case – linking unlinked references for terms which are aliases of the page name.

Let’s say you have a massive database of notes, including the contents of articles you’ve clipped. You have a page about AI and you want to link it to all other notes that are roughly related to AI, including mentions of “artificial intelligence”, ML, singularity, and so on.

Well merging provides you with an extremely efficient way to link these unlinked references which are not currently matching your title:

  • Create new notes for all of the terms you want to match
  • Link all the unlinked references you want to ultimately transform into a backlink to AI
  • Rename your notes to merge them with the AI note and bring the backlinks with you

This is how it works in Roam and I assumed it would work this way for Obsidian too.

Where Obsidian could bring it’s own magic to this flow is by automatically creating alias links. e.g. when merging Machine Learning and AI, don’t rename [[Machine Learning]] to [[AI]], rename it to [[AI|Machine Learning]]. This way Obsidian would have an edge over Roam in that it would be able to preserve the original context.

9 Likes

This a great idea.

6 Likes

I would soooo love this!

solution/workaround:

Aim: Merge (“B” + “A”) → "A"
Assumtion: “Automatically update internal links” is turned ON.

Process:

  1. Add content from “A” (copy or cut) into “B” (paste). (You have control over the order of merged content parts.)
  2. Delete “A”. (links to “A” will be dead temporarily)
  3. Rename “B” to “A”. (Now links to “B” are updated and original links to “A” are resurected.)
11 Likes

Not sure if +1 is a thing in this forum, or you should just like the initial post, but I was about to create a merge feature request. Thought someone would want it already.

My case is when I elaborate my thoughts and I end up with more notes actually describing the same phenomenon but with different words, but already there’s a bunch of links in and out of both, I want to merge them to one, edit the text and have all the links pointing to this new merge and out of it.

Same when I find out I’m writing about something I’ve wrote already in the past, but, again, links in both.

2 Likes

It would be useful in many cases to merge two notes, and have the links to those notes merged as well.

(Or should this be a feature request? Honestly, I am often confused about what should be a plugin and what should be a feature…)

33 Likes

Would love this!

2 Likes

Came here to submit the same thing as a feature request!

1 Like

Also the opposite, split notes.

9 Likes

Adding a +1 to this.

1 Like

I think there is a need for a pack of operations. Like merging, splitting, extracting link lists and etc.

1 Like

Definitely agree! For a little while, I thought that I could do this by just renaming a note the name of another note, knowing that both were empty of content within, thinking that all links were to a note with that name, so the system wouldn’t even know it was merging.

Unfortunately, I made a mess of many links, so here I am. It is amazing how much damage can be done to a network in a short period of time when not careful and making assumptions. Obviously, totally my fault.

Really hope this plugin comes around. Thanks in advance.

2 Likes

I’ve been looking into this and found some posts on concatenating markdown files with pandoc. Unfortunately, I couldn’t quite get it to work! The main issue seems to be that some flavours of markdown use SeText headers while others use ATX style headers… so results always came out with forward slashes inserted between hashtags, messing up all of my headings!

This is what I used to combine all markdown files in a directory:

pandoc *.md -o final.md

Then I tried:

pandoc *.md --atx-headers -o final.md

But I couldn’t quite figure out how to employ the space_in_atx_header extension so I’ve given up for the time being!

1 Like

definitely, sometimes i have to split subtitles from my notes to keep it simple and clear

1 Like

+1 by me too!

This feature would be very useful particularly for students which like me create a new note for every lecture and would like to print all the notes for a subject by combining them in a single file.

Furthermore, it would be awesome for writers, too, to be able to combine several chapters in the same book.

Thanks a lot for suggesting this, @Luhmann!