Remove unwanted tags from Notes in Obsidian
Over time, your tagging system in Obsidian may evolve. For example, you might add multiple tags to each Daily Note at the start, but later realise that one of them is unnecessary. Instead of editing every file manually, you can use Visual Studio Code to quickly remove a tag from all Daily Notes at once.
In this guide, we’ll demonstrate how to bulk-remove a tag from the YAML properties of your notes, leaving only the tags you want to keep.
Requirements
- A backup of your Obsidian vault (copy the folder to be safe).
- Visual Studio Code installed.
- Your vault opened in VS Code: File → Open Folder… →
~/Documents/Brain - Daily Notes folder:
Brain/Daily Notes/ - Notes with YAML frontmatter tags in list format, e.g.:
--- tags: - Tag1 - Tag2 ---
Step-by-step
-
Open your vault in VS Code
File → Open Folder… →~/Documents/Brain -
Open global search
Press⌘⇧F. -
Restrict the search to Daily Notes
In files to include, enter:
Daily Notes/*.md
-
(If the field is hidden: click the three dots
…and enable it.) -
Disable excludes
In the files to exclude section, click the gear icon → untick
Use Exclude Settings and Ignore Files. -
Enable replace mode
Click the small arrow ( > ) on the right-hand side of the search bar.
This opens the Replace field. -
Activate regex mode
Turn on the blue.*button (Regex).
Make sure:-
Aa (case-sensitive) is off.
-
ab (whole word) is off.
-
-
Remove the unwanted tag line
- Search (Regex):
^\s*-\s*Tag2\s*$
-
-
Replace: (leave empty)
- Run Replace All in all files (two arrows + document icon)
or shortcut ⌥⌘⏎.
- Run Replace All in all files (two arrows + document icon)
-
-
Check a few files
Open a couple of Daily Notes to confirm the result:
---
tags:
- Tag1
---
Troubleshooting
-
No results?
-
Check you’re searching for YAML lines (
- Tag2), not hashtags. -
Use relative path:
Daily Notes/*.md. -
Turn off exclude settings.
-
-
Regex not working?
-
Make sure the
.*button is active. -
Case sensitivity disabled.
-
-
Replace All missing?
-
Open Replace field (arrow
>). -
Use two arrows + document icon, or shortcut ⌥⌘⏎.
-