Don't create note when alias exists

Things I have tried

  1. Create “note A” with frontmatter aliases: ["topic A"]

  2. Make sure there is not note named “topic A”

  3. Go to another note and create an internal link to [[topic A]]

  4. Click on that link. It will create a new note named “topic A”

What I’m trying to do

Instead of creating a new note, I would like the link to open “note A” (which has “topic A” as an alias.

So, in more general terms, I would like to prevent a new note from being created when the name of the note already exists as an alias for another note.

I am not sure if this is a request for help or a feature request, so I’ll start by posting this in the #get-help category. Would be great if this is already possible. :slight_smile: Since this is apparently not possible, I’m posting this to #feature-requests, hoping that this can be added. I think this feature would help to prevent some confusion around aliases (see below).

Edit: The example-steps above fails to accurately capture the problem I’m trying to remedy concerns not so much topic A links created after the alias has been added to some note, but before.

When there are a number of notes with dead-end links totopic A and then topic Ais added as an alias to another note, that’s the scenario where the current (default) behaviour is not only inconvenient but can also lead to inconsistencies when a note that is synonymous to an existing alias is created so that there essentially exist two notes “claiming” that name.

1 Like

If you use auto completion, and start typing [[topic A, it should suggest the aliased version of “Note A”, and you’ll end up with [[Note A|topic A]] which is the correct version to link to “Note A” using the alias “topic A”.

If you do it manually, you’ll still need to use that syntax to get the correct link with your wanted alias. (And in fact, if you’re doing it manually, you don’t need to have the alias defined, and can use whatever as an alias)

Yes, that is the manual way of doing it once there is a note with the desired alias.

I realize that my attempt to create a kind of minimial (non-)working example, I simplified the problem a bit too far. My problem pertains more to notes that already have the [[topic A]] link. I create lots of such dead end links and in some cases they will eventually become real links once a note by that name is created. No problem there.

But in some cases, no note by that name will be created. Instead, topic A is added as an alias to another note. It is in this scenario where the current (default) behaviour is not only inconvenient but can also lead to inconsistencies when a note that is synonymous to an existing alias is created so that there essentially exist two notes “claiming” that name.

I will try to clarify this in the OP.

Now it sounds like what you really want is more of a permanent redirect from topic A, to another file, like Note A (where you for future links have created the alias of Topic A)

To my knowledge there doesn’t exist such a redirect feature in Obsidian.

One way to handle this would be to actually create Topic A, with a simple link to Note A, and possibly a task (or note to yourself) to clear out all of the backlinks to this page. When they’re all cleared out, you can safely remove the page.

Alternatively, you could upon noting you don’t want to have a Topic A in your vault, you could do a global search for [[Topic A, and replace them there and then. (This could of course also be done using search and replace in an external tool like VS Code)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.