Johannes Kaindl25 downloadsRepairs file names that sync or links reject, keeps a log of every change, and offers writing plugins a name API.
🇬🇧 English · 🇩🇪 Deutsch
Repairs file names that Obsidian Sync or links reject, tells you briefly, keeps a log of every change and offers writing plugins a name API.
LLMs, scripts and other tools create files whose names contain characters that Obsidian Sync on a phone refuses (: ? * " < > | # ^ [ ]), or that break links. Filename Sanitizer renames such files by fixed, adjustable rules, lets links follow, logs every change with everything that helps you find the writer, and stays out of your way. It never overwrites and never deletes a file.
vault-crews: Status becomes vault-crews — Status, 12:30 becomes 12-30, ids[0] becomes ids(0)). Leading and trailing spaces and dots, control characters and names that would end up empty are handled as well. A replacement that is itself invalid is refused and named.a — b 2.md). A folder is never merged..jsonl file per device and month in a folder of your vault, with origin, effect, environment and chosen front matter fields; the start of the note text is optional and off by default. The view shows it newest first, filterable by device, folder and event.app.plugins.plugins["filename-sanitizer"].api offers sanitizeName and checkName (synchronous). Plugins that write files ask it first and fall back to the same default rules without it, through safeFileName in obsidian-kit.Once the plugin has passed the store review: Settings → Community plugins → Browse, search for Filename Sanitizer, Install, Enable.
Download main.js, manifest.json and styles.css from the latest release, copy them into the folder filename-sanitizer inside your vault's plugin folder (<vault>/.obsidian/plugins/) and enable the plugin under Settings → Community plugins.
Add johannes-kaindl/filename-sanitizer as a beta plugin in the BRAT plugin.
The first time you enable the plugin on a device nothing is renamed: names that already break the rules wait in the review list. From then on a new file with an invalid name is repaired after the quiet time and a notice says what happened.
Step by step: Getting started.
Settings → Filename Sanitizer. Help comes first, then the groups Repair and Exceptions and three collapsed groups.
.gitignore.Filename Sanitizer/Log), retention in months (default 12, 0 keeps everything) and which fields go into each line.![]()
The whole tab (click for full size)
The plugin watches for new and renamed files. A file is checked only after it has not changed for the quiet time, one rename at a time, folders before their contents. It renames with Obsidian's own file manager, so links to the file follow, and writes one line to the log. A name that exists is never overwritten: identical content leaves the file as a marked duplicate, different content gets a number. Nothing is ever deleted.
What the plugin must not do alone goes to the review list: names that existed before the first start on a device or became invalid through a change of the rules, names that keep coming back, and all names while Obsidian's Automatically update internal links is off.
\) is invisible to Obsidian (not in its index, no event); the plugin cannot repair it.Code: AGPL-3.0-or-later (LICENSE). Documentation: CC BY-SA 4.0 (LICENSE-DOCS). Dual-license option: LICENSING.md.