# Vault-wide find and replace?

**URL:** <https://forum.obsidian.md/t/vault-wide-find-and-replace/56287>\
**Category:** Help\
**Created:** [March 13, 2023, 7:43pm UTC](https://forum.obsidian.md/t/vault-wide-find-and-replace/56287 "2023-03-13T19:43:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![marc\_samida](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/m/d78d45/32.png) [@marc\_samida](https://forum.obsidian.md/u/marc_samida)\
**Post date:** [March 13, 2023, 7:43pm UTC](https://forum.obsidian.md/t/vault-wide-find-and-replace/56287/1 "2023-03-13T19:43:10Z")

</div>

### 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

---

<div class="post-metadata">

**Author:** ![anon63144152](https://forum.obsidian.md/letter_avatar_proxy/v4/letter/a/a698b9/32.png) [@anon63144152](https://forum.obsidian.md/u/anon63144152)\
**Post date:** [March 13, 2023, 8:16pm UTC](https://forum.obsidian.md/t/vault-wide-find-and-replace/56287/2 "2023-03-13T20:16:55Z")

</div>

Not in the core. [VS Code](https://code.visualstudio.com) is great at opening vaults and completing small or massive search-and-replace runs throughout a whole vault.

---

<div class="post-metadata">

**Author:** ![smiggles](https://forum.obsidian.md/user_avatar/forum.obsidian.md/smiggles/32/44230_2.png) [@smiggles](https://forum.obsidian.md/u/smiggles)\
**Post date:** [March 13, 2023, 8:38pm UTC](https://forum.obsidian.md/t/vault-wide-find-and-replace/56287/3 "2023-03-13T20:38:56Z")

</div>

There is currently no core Obsidian ways to search and replace

You can see the feature request here,

> [@Global (Mass / Vault-wise) search & replace](https://forum.obsidian.md/t/global-mass-vault-wise-search-replace/4395):
>
> I used to use [[documentation]] for all of my notes on content that I was reading/watching. Now, I realize that #documentation would be much more appropriate. I’d like to search and replace, but have 200+ notes with [[documentation]] and there seems to be no bulk search & replace, only on a per-file basis.

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

> **[GitHub - MahmoudFawzyKhalil/obsidian-global-search-and-replace: A plugin to do a global search and replace in all...](https://github.com/MahmoudFawzyKhalil/obsidian-global-search-and-replace/)**
>
> A plugin to do a global search and replace in all your Obsidian vault files.

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,

> **[Flags - Patterns and flags](https://javascript.info/regexp-introduction#flags)**
>
> Regular expressions are patterns that provide a powerful way to search and replace in text.

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** _

⚠ _ **Make sure to backup your vault before continuing** _ ⚠

 ![image](https://forum.obsidian.md/uploads/default/original/3X/d/a/da4613bb046d4f5ed70cd6099d21b26e32b360d0.png)

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

 ![image](https://forum.obsidian.md/uploads/default/original/3X/5/f/5fcfc473c20b681588a005847859840486380b58.png)

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

## Find and Replace ([findandreplace.io](http://findandreplace.io)) (Windows 10/11)

> **[Find & Replace Tool](http://findandreplace.io)**
>
> Find & Replace Tool.

⚠ _ **Make sure to backup your vault before continuing** _ ⚠

In addition, be cautious when using this application

## Visual Studio Code

> **[Visual Studio Code - The open source AI code editor | Your home for...](https://code.visualstudio.com)**
>
> Visual Studio Code is a free, open source AI code editor. Build with AI agents that plan, code, and debug for you. Manage multi-agent workflows across environments on Linux, macOS, and Windows.

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](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode), linting with [markdownlint](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint), [mass formatting files](https://marketplace.visualstudio.com/items?itemName=jbockle.jbockle-format-files) and more.”_ - _**[NomarCub](https://github.com/NomarCub/obsidian-open-vscode)**_

## Honorable Mentions

### Tag Wrangler Plugin

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

> **[GitHub - pjeby/tag-wrangler: Rename, merge, toggle, and search tags from the...](https://github.com/pjeby/tag-wrangler)**
>
> Rename, merge, toggle, and search tags from the Obsidian tag pane

### grepWin (Windows10/11)

> [@Global (Mass / Vault-wise) search & replace](https://forum.obsidian.md/t/global-mass-vault-wise-search-replace/4395/67):
>
> I use the tool “grepWin” in Windows (10) Explorer for such purposes. Right click on the note-folder, search and replace - done! I have backups of all my notes, so there’s no worry. Works also with YAML Metadata. [https://tools.stefankueng.com/grepWin.html](https://tools.stefankueng.com/grepWin.html)

### MacOS Shell Script

> [@Global (Mass / Vault-wise) search & replace](https://forum.obsidian.md/t/global-mass-vault-wise-search-replace/4395/55):
>
> I use a shell script for this bulk replacement on MacOS: #!/bin/sh ORIG='text\_to\_be\_replaced' REPL='new\_text' find . -name '\*.md' | xargs -r sed -i '' "s/$ORIG/$REPL/g"

> [@Global (Mass / Vault-wise) search & replace](https://forum.obsidian.md/t/global-mass-vault-wise-search-replace/4395/57):
>
> Based on my understanding, the . means current folder where the shell script is executed. And you can replace it with some other path. Second, find will go through all subdirectories recursively by default. And if you want don’t want find to go into the subdirectory, you can use -maxdepth to limit the maximum depth that find will go. find . -maxdepth 1 -name '\*.md' | xargs -r sed -i '' "s/$ORIG/$REPL/g"

## [Atom.io](http://Atom.io) (⚠ _ **Deprecated** _ ⚠)

> [@Find and replace links across all files in a vault](https://forum.obsidian.md/t/find-and-replace-links-across-all-files-in-a-vault/4218):
>
> After adjusting my graph-view [to only bubble up heavily backlinked nodes](https://forum.obsidian.md/t/how-i-tested-a-graph-view-idea-by-adjusting-my-local-install/4182), I’ve noticed that some nodes are large even though they’re not very important. Those are one-word notes (e.g. “deep work” or “job” or “ideas”) that I linked up because it was so easy[^1]. At this point, I care more about the quality of connections and decided to remove this type of noise from my vault. After testing a few ways to “Find and replace” recursively across files and folders, and failing hard[^2], here’s what’…

Best of luck! Have a great day

---

<div class="post-metadata">

**Author:** ![I-d-as](https://forum.obsidian.md/user_avatar/forum.obsidian.md/i-d-as/32/59965_2.png) [@I-d-as](https://forum.obsidian.md/u/I-d-as)\
**Post date:** [March 14, 2023, 2:56am UTC](https://forum.obsidian.md/t/vault-wide-find-and-replace/56287/4 "2023-03-14T02:56:40Z")

</div>

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](https://forum.obsidian.md/t/bulk-rename-notes-updating-links/8286)

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://forum.obsidian.md/uploads/default/original/3X/b/e/bec35fbd23ab28909bb6bfe62cb32eb82dd34019.png) [@system](https://forum.obsidian.md/u/system)\
**Post date:** [June 12, 2023, 2:57am UTC](https://forum.obsidian.md/t/vault-wide-find-and-replace/56287/5 "2023-06-12T02:57:20Z")

</div>

Closed on June 12, 2023, 2:57am UTC

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