JK112 downloadsAutomatically adds tags to notes based on their folder path — nested folders add nested tags too (e.g. History/Medieval Europe → #history and #medieval-europe).
Automatically tags notes based on the folders they're in. A note inside
History/Medieval Europe/ gets tagged with both #history and
#medieval-europe — nested folders stack up tags as you go deeper.
No build step needed — it's plain JavaScript, just drop it in and enable it.
.obsidian/plugins/ (a hidden folder at the root of
your vault). Create a new folder there called folder-auto-tagger.main.js and manifest.json into that folder.Your folder structure should look like:
YourVault/.obsidian/plugins/folder-auto-tagger/main.js
YourVault/.obsidian/plugins/folder-auto-tagger/manifest.json
#tags on a single
dedicated line near the top of the note (right after frontmatter, if the
note has any).%%folder-auto-tagger%% marker — Obsidian's
own comment syntax. It's hidden in Reading view and Live Preview, and is
only there so the plugin can find and update its own line later. It's
visible as plain text if you switch to Source mode, as a reminder that the
line is plugin-managed.#tags you
type elsewhere in the note — in the title, body, wherever — are left
completely alone.Ctrl/Cmd + P) to backfill everything.Open Settings → Folder Auto Tagger:
#medieval-europe from the managed line.
Turn off to keep old folder tags around indefinitely (new ones still get
added on top).#history #medieval-europe#history #history/medieval-europe — uses
Obsidian's built-in nested tag feature, so it groups visually in the tag
pane.Templates, Attachments).
Notes in subfolders beneath an excluded folder still pick up tags from
those deeper folders.novel-studies = analytical
wwii = world-war-2, 20th-century
templates =
Novel Studies, novel-studies, and
novel studies all match the same folder.Areas/History/Medieval Europe/ and you don't want an #areas tag on everything.With default settings, this structure:
History/
Medieval Europe/
Charlemagne.md
Ancient Rome/
Julius Caesar.md
turns Charlemagne.md into something like:
#history #medieval-europe %%folder-auto-tagger%%
# Charlemagne
...your existing note content, untouched...
and Julius Caesar.md gets #history #ancient-rome the same way.
If you manually edit the tag line itself (not just other tags elsewhere in
the note), keep the %%folder-auto-tagger%% marker in place so the plugin
can still find it. If you remove the marker entirely, the plugin will treat
the note as untagged and insert a fresh line the next time it runs — leaving
your edited line as ordinary, unmanaged text.
(Note that this plugin is entirely vibecoded, tested by me though, if you have any complaints let me know)