[New Plugin] YAML Toolkit for Obsidian– Batch manipulate front matter with conditional rules

Ever wanted to add a runtime field to 200 movie notes without opening each file? Or auto-tag overdue tasks? Or update nested metadata in arrays and objects?

I got tired of doing this manually, so I built a plugin: YAML Toolkit for Obsidian. I’ve been using it for a few months and it’s been a huge time saver, so I’m excited (and a little nervous :sweat_smile:) to share it.

A few things it can do (this is just the surface)

1) Simple: add missing fields

IF tags contains "movie" AND NOT HAS runtime
THEN SET runtime ""

2) Conditional chains: cleanup + tag in one pass

IF due < "{{today}}" AND status != "done"
THEN
  FOR tags APPEND "overdue"
  SET priority 1
  SET status "URGENT"

The key thing here: actions chain. One rule can do multiple updates without re-scanning your vault over and over.

3) Working with objects: update nested metadata

IF tags contains "person"
THEN
  SET contact.email "", SET contact.phone ""
  SET social.twitter "", SET social.linkedin ""

This will create nested objects automatically if they don’t exist. You can also update deeper fields directly:

IF type = "meeting"
THEN SET metadata.location.room "Conference A", SET metadata.duration 60

4) Advanced: transform nested arrays

IF tags contains "project"
THEN FOR tasks WHERE status = "pending"
  SET status "active", priority 1, started "{{today}}"

This reaches into arrays (like tasks), filters the items you care about, and updates multiple fields at once.

5) String cleanup: pattern replacement + tag hygiene

IF tags contains "book"
THEN
  REPLACE author /^Dr\.?\s+// ""
  REPLACE title /\s+/ "_"
  FOR tags DEDUPLICATE
  FOR tags SORT ASC

6) Bulk cleanup: rename + delete + organize

IF folder = "archive"
THEN
  RENAME old_field TO archived_date
  DELETE draft, wip, temp_notes
  FOR tags DEDUPLICATE
  FOR tags SORT ASC

How it works

Each rule has two parts:

  1. A condition that identifies candidate files (the notes you want to target).

  2. One or more operations that modify YAML in those files.

Think of it like: “Find notes that match X… then apply these edits to their frontmatter.”

The real power comes from combining conditions + multiple actions. One rule can:

  • Check multiple conditions (AND / OR / NOT)

  • Run multiple operations in sequence

  • Modify scalars (strings/numbers/booleans) with SET, math ops, dates ({{today}}, {{now}})

  • Manipulate arrays (append, dedupe, sort) with FOR ...

  • Work with objects using dot notation (contact.email, metadata.location.room)

  • Update arrays of objects using FOR ... WHERE ... filters

So instead of “add a tag,” you can write rules like:

  • “For meeting notes from Q1: normalize attendee names (regex), dedupe/sort tags, update the location object, and add a reviewed flag.”

  • “Find project notes with overdue tasks: bump priority, append urgent, set nested review metadata, and update project status.”

  • “For all person notes: ensure contact and social objects exist with defaults, then clean up formatting with regex.”

If you want more, the docs go hard: 50+ examples, plus things like INCREMENT/DECREMENT, date handling, and complex nested updates.

Safety / sanity checks

I built this with paranoia baked in: syntax validation, preview mode, and backups — because nobody wants to learn the hard way what “mass edit” means.

Fair warning

Still in active development, so expect rough edges and the occasional bug. But I use it daily, and it has 1,264 automated tests (yes, I’m that worried about vault corruption).

Install

Install via BRAT: ramnathk/obsidian-yaml-toolkit

A little context

I started with shell scripts, but working with markdown + YAML got painful fast. jq is incredible, but it was more power (and complexity) than I wanted for “I just need to normalize my vault.” Anything non-trivial — like adding/updating nested objects — turned into custom one-off work each time.

My personal vault is 2,000+ notes and this has worked well for me so far, but I haven’t tested it on truly massive vaults yet — if you try it on one, I’d love to hear how it goes (and what breaks).

Also: I’ve leaned heavily on AI while building this, and it’s been a genuinely fascinating experience watching it all come together.

I’d be honored if you try it.


:open_book: Docs: https://ramnathk.github.io/obsidian-yaml-toolkit/
:laptop: GitHub: https://github.com/ramnathk/obsidian-yaml-toolkit

1 Like