NameGuard
approvedby toadfans
Strictly enforce vault-wide unique note names. Blocks new notes (and moves/renames) that would collide with an existing name, so shortest-format links are never silently rewritten. - This plugin has not been manually reviewed by Obsidian staff.
š”ļø NameGuard
Keep every note name unique ā and stop Obsidian from silently rewriting your links.
The problem
With Settings ā Files and links ā New link format set to Shortest path when possible,
Obsidian keeps your [[wikilinks]] short only while a note name is unique. The moment a second note
with the same name appears anywhere in the vault, Obsidian rewrites your existing links to keep
them pointing at the original file:
- [[Foobar]]
+ [[notes/Foobar]]
You never touched those notes ā yet your links changed, your git diff is noisy, and a careless undo can leave links resolving to the wrong file.
The fix
NameGuard treats a note name as a vault-wide unique key. When an operation would introduce a duplicate name, NameGuard blocks it before the file is created ā so the rewrite never happens.
š Pre-existing duplicates are left untouched. NameGuard only guards new collisions.
| Feature | |
|---|---|
| š« | Blocks duplicate creation ā new notes, "create from link", and templates all run through one guard |
| š | Guards moves & renames ā renaming a note into a name that's already taken is blocked too |
| šÆ | Shortest-mode aware ā only acts when it actually matters (configurable) |
| š | Markdown-first ā guards .md by default; opt in to every file type |
| š§© | Zero config ā sensible defaults, with a settings tab when you want control |
| š | 100% local ā no network, no telemetry |
How it works (in one breath)
Obsidian's MetadataCache.fileToLinktext falls back to a full path once a name stops being unique,
and FileManager rewrites the affected links right after a create/rename. NameGuard wraps the vault's
create / createBinary / rename and rejects the operation when the new name already resolves to
an existing note ā so the trigger never fires.
š Full write-up in docs/how-it-works.md.
Install
Manually
- Download
main.js,manifest.json, andstyles.cssfrom the latest release. - Copy them into
<your-vault>/.obsidian/plugins/name-guard/. - Reload Obsidian, then enable NameGuard under Settings ā Community plugins.
From source
bun install
bun run build # bundles main.js
Settings
NameGuard works with its defaults. Settings ā NameGuard exposes only file-type scope and release note preferences; see the settings reference for details.
Documentation
- š Getting started
- š¬ How it works
- āļø Settings reference
- ā FAQ
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.