Vault-wide find and replace?

What I’m trying to do

I would like to know if it’s possible to “find and replace” text throughout a vault or if it’s only possible within individual notes.

Things I have tried

1 Like

Not in the core. VS Code is great at opening vaults and completing small or massive search-and-replace runs throughout a whole vault.

There is currently no core Obsidian ways to search and replace

You can see the feature request here,

The feature appears to be on the roadmap according to some insiders

Workarounds

Currently there are a couple work arounds!

Global Search and Replace Plugin

This plugin is not available through the community plugin browser. You should behave with caution but, the plugin’s code looks safe and there aren’t any reported issues!

Linter Plugin

obsidian://show-plugin?id=obsidian-linter

The linter plugin formats and styles your notes based on custom settings!

You can perform a global replace using “Custom Regex Replacement”

Its important to read,

In order to understand regex replacement. However, you still need to use caution when using it. Regex isn’t a simple concept and its easy to mess up. In this case, it could wreck your entire vault

:warning: Make sure to backup your vault before continuing :warning:

After specifying the text you want to find and replace, you need to run “Linter: Lint all files in the vault”

Remember to remove the custom rule after running it (if this is a one time search and replace)

Find and Replace (findandreplace.io) (Windows 10/11)

:warning: Make sure to backup your vault before continuing :warning:

In addition, be cautious when using this application

Visual Studio Code

You can use Visual Studio Code by opening your vault in VSC and using Ctrl + Shift + H

Open in VSCode plugin

obsidian://show-plugin?id=open-vscode

Using this plugin allows you to open your vault in Visual Studio Code in seconds

In addition, “You can use VSCode for various purposes with your vault, such as for git version control, markdown formatting with Prettier, linting with markdownlint, mass formatting files and more.” - NomarCub

Honorable Mentions

Tag Wrangler Plugin

obsidian://show-plugin?id=tag-wrangler

grepWin (Windows10/11)

MacOS Shell Script

Atom.io (:warning: Deprecated :warning:)

Best of luck! Have a great day

6 Likes

Another semi related tool is the PowerRename utility for Windows. It can be helpful when used in conjunction with a vault wide search and replace. The ability to use regex to rename a bunch of files programmatically is very helpful. And then you can use VSCode or similar to properly update all the links to those notes. Here’s a relevant feature request: Bulk rename notes updating links

Thanks!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.