I’ve been searching for a solution to this, and wanted to share mine! Can’t believe I didn’t think of this before. My goal was simple: delete the tag literature
from my vault. The wonderful Tag Wrangler plugin doesn’t support deletion, but it does support renaming.
First, I renamed the literature
tag to a random string (let’s say OmGsQgSzTw
, generated here). After, I opened my vault in VSCode and used their find and replace to replace all occurences of OmGsQgSzTw
with nothing. However, tags can come in a few formats, and just removing the string might not work. For instance, I replaced the strings (everything in quotes, including commas): " OmGsQgSzTw," & “, OmGsQgSzTw” & “#OmGsQgSzTw”. That did the trick!
In hindsight, unbelieveably obvious. I was trying to regex and script my way through it, but this is significantly easier. Just wanted to drop this for anyone else also looking for tag deletion! Of course, make backups of your vault or labelled git commits just in case, but I didn’t run into any problems. Depending on the number of notes you have, the renaming, find and replace, and re-indexing can take a little while.