Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Folder Auto Tagger

JKJK112 downloads

Automatically adds tags to notes based on their folder path — nested folders add nested tags too (e.g. History/Medieval Europe → #history and #medieval-europe).

Add to Obsidian
  • Overview
  • Scorecard
  • Updates2

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.

Install

  1. In your vault, go to .obsidian/plugins/ (a hidden folder at the root of your vault). Create a new folder there called folder-auto-tagger.
  2. Copy main.js and manifest.json into that folder.
  3. In Obsidian: Settings → Community plugins. If "Restricted mode" is on, turn it off.
  4. Click the reload icon next to "Installed plugins" (or restart Obsidian).
  5. Find Folder Auto Tagger in the list and enable it.

Your folder structure should look like:

YourVault/.obsidian/plugins/folder-auto-tagger/main.js
YourVault/.obsidian/plugins/folder-auto-tagger/manifest.json

How it works

  • Folder tags are written as real, visible inline #tags on a single dedicated line near the top of the note (right after frontmatter, if the note has any).
  • That line ends with a small %%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.
  • The plugin only ever touches that one marked line. Any other #tags you type elsewhere in the note — in the title, body, wherever — are left completely alone.
  • New notes and notes moved into a folder get tagged automatically.
  • Move a note to a different folder and the line is regenerated to match. Whether tags that no longer apply get dropped or kept is a setting (see below).
  • Existing notes aren't retagged automatically when you first install the plugin (so it doesn't rewrite your whole vault on a whim). Run the command "Apply folder tags to entire vault" once from the command palette (Ctrl/Cmd + P) to backfill everything.
  • There's also "Apply folder tags to current note" for a one-off refresh.

Settings

Open Settings → Folder Auto Tagger:

  • Automatically tag new and moved notes — turn off if you'd rather run it manually via the commands above.
  • Remove tags when a note leaves a folder — on by default: moving a note out of "Medieval Europe" drops #medieval-europe from the managed line. Turn off to keep old folder tags around indefinitely (new ones still get added on top).
  • Tag style
    • Separate tag per folder (default): #history #medieval-europe
    • Nested path tag: #history #history/medieval-europe — uses Obsidian's built-in nested tag feature, so it groups visually in the tag pane.
    • Both: gives you all of the above.
  • Word separator — how a multi-word folder name like "Medieval Europe" becomes valid tag text (tags can't contain spaces): hyphen (default), underscore, camelCase, or just remove the spaces.
  • Lowercase tags — on by default.
  • Excluded folder names — comma-separated list of folder names that should never become a tag themselves (e.g. Templates, Attachments). Notes in subfolders beneath an excluded folder still pick up tags from those deeper folders.
  • Folder tag overrides — replace the auto-generated tag for a specific folder with whatever tag(s) you actually want, instead of the folder's own name. One per line:
    novel-studies = analytical
    wwii = world-war-2, 20th-century
    templates =
    
    • Matches by the folder's own name, not its full path, and ignores case and spacing/hyphenation — Novel Studies, novel-studies, and novel studies all match the same folder.
    • You can list more than one replacement tag, comma-separated.
    • Leave the right side blank to give that folder no tag at all (same idea as the excluded list above, just one-by-one).
    • With Nested path tag style, only the first listed replacement tag is used to build the nested path; switch to Both to also get any extra replacement tags as standalone flat tags.
    • This only changes the tag for that exact folder — subfolders beneath it still get their own normal (or overridden) tags.
  • Ignore top-level folders — skip this many folder levels from the vault root. Handy if your vault root is organized like Areas/History/Medieval Europe/ and you don't want an #areas tag on everything.

Example

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.

A note on hand-editing the managed line

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)

HealthExcellent
ReviewPassed
About
Tag notes automatically based on folder path, stacking nested folders into tags (e.g., History/Medieval Europe → #history #medieval-europe). Place folder tags on one marked inline line near the top (hidden in Reading/Live Preview), update it when notes move, and run commands to apply tags to the current note or entire vault.
TagsFoldersAutomation
Details
Current version
1.0.1
Last updated
Last week
Created
Last week
Updates
2 releases
Downloads
112
Compatible with
Obsidian 1.4.0+
Platforms
Desktop, Mobile
License
MIT
Report bugRequest featureReport plugin
Author
JKJKjk-cpu-jpg
GitHubjk-cpu-jpg
  1. Community
  2. Plugins
  3. Tags
  4. Folder Auto Tagger

Related plugins

Waypoint

Easily generate dynamic MOCs in your folder notes using waypoints. Enables folders to show up in the graph view and removes the need for messy tags!

Advanced Note Mover

Quickly and easily move notes to a predefined folder. Perfect for organizing your notes.

Homepage

Open a note, base, or workspace on startup, or set it for quick access later.

Linter

Format and style your notes. Linter can be used to format YAML tags, aliases, arrays, and metadata; footnotes; headings; spacing; math blocks; regular Markdown contents like list, italics, and bold styles; and more with the use of custom rule options.

BRAT

Easily install a beta version of a plugin for testing.

Advanced URI

Control everything with URI.

Tag Wrangler

Rename, merge, toggle, and search tags from the tag pane.

QuickAdd

Quickly add new notes or content to your vault.

Supercharged Links

Add attributes to internal links with the values of target note's frontmatter attributes.

Lazy Loader

Load plugins with a delay on startup, so that you can get your app startup down into the sub-second loading time.