Consistent Attachments and Links

approved

by dy-sh

Move note attachments and update links automatically.

389 stars146,571 downloadsUpdated 18d agoMIT

Consistent Attachments and Links

Buy Me a Coffee GitHub release GitHub downloads Coverage: 100%

Obsidian resolves links with a clever search that only Obsidian has, so a vault can be perfectly navigable inside it and full of dead links the moment you open a note anywhere else — in another editor, published to GitHub, or exported as a folder.

This plugin makes that visible: it audits the whole vault and reports every link whose written path does not itself lead to its target, repairs names and paths that a platform you sync to would reject, and collects scattered attachments into place.

[!IMPORTANT]

Since 4.0.0 this plugin no longer handles renames and deletions. Install Advanced Rename and Delete Handler to keep attachments traveling with their note and links rewritten when you move, rename or delete one — it owns that for the whole vault now, so several plugins can no longer fight over it. This plugin requires it: it loads nothing until that plugin is installed, explains why, and installs it in one click — which changes nothing on its own, since its defaults do nothing until you turn renames or deletions on. It then offers to hand your old settings across.

[!IMPORTANT]

This plugin no longer converts wikilinks to Markdown links. It was built to force a vault's migration to Markdown links; that is no longer its job, so the four Replace all wiki… commands are gone and the consistency report no longer treats a wikilink as a defect. Better Markdown Links owns the conversion now, over a wider surface — one file, one folder or the whole vault, plus converting as you type.

[!IMPORTANT]

This plugin no longer rewrites a link's path either, so the four Convert all … paths to relative commands are gone with it. Rewriting a link into a style is not what this plugin is for — it reports every link whose written path does not lead to its target, and leaves how you write your links to you. Better Markdown Links owns link paths as well as link style. The report is unchanged: a path that does not resolve is still listed, whether or not anything offers to convert it.

[!WARNING]

As the plugin might change your vault layout, it is crucial that you backup your vault before making any massive changes with this plugin!

A name your other devices reject

More screenshots
Repaired, with the original name kept Attachments collected beside their own note A report of every bad link, changing nothing A name your other devices reject Repaired, with the original name kept Attachments collected beside their own note A report of every bad link, changing nothing

Demo vault

The documentation is a demo vault. Every feature has a note that explains what it does and why you would want it, with example notes to run it against.

Start reading here — it is plain markdown, so it works on GitHub with nothing installed.

A copy of the vault ships with every release. You can access it via any of the following:

  1. Running the Consistent Attachments and Links: Open demo vault command.
  2. Downloading consistent-attachments-and-links-demo-vault.zip from the Releases. It unzips into a single consistent-attachments-and-links-demo-vault-<version> folder.
  3. Browsing its source in demo-vault/ in this repository.

What it does

  • Collect attachments into the note's own folder, on command or as you edit — safely, never stealing a file another note still references. 01 Collect attachments into the note's folder
  • Audit the whole vault and get a report of bad links, bad embed paths and bad frontmatter links, changing nothing. 03 Check vault consistency
  • Keep paths valid on every platform you sync to — find and bulk-repair the names and paths that Windows, Android, Linux, macOS or iOS would reject, without breaking a single link. 08 Keep paths valid on every platform
  • Tidy an existing vault — attachments collected into place, empty folders swept, names repaired — in one command or step by step. 04 Reorganize and convert links · 07 Commands
  • Settings, including which of the destructive operations are unlocked. 05 Settings
  • Obsidian's own settings matter too — link format, attachment location — and the vault explains which ones to change and why. 06 Recommended Obsidian settings

Attachment Subfolder setting

Moved to 06 Recommended Obsidian settings.

Since v3.0.0 this setting is no longer managed by the plugin; it follows Obsidian's built-in Default location for new attachments. This heading stays so links already pointing at it keep resolving.

Installation

The plugin is available in the official Community Plugins repository.

Beta versions

To install the latest beta release of this plugin (regardless if it is available in the official Community Plugins repository or not), follow these steps:

  1. Ensure you have the BRAT plugin installed and enabled.
  2. Click Install via BRAT.
  3. An Obsidian pop-up window should appear. In the window, click the Add plugin button once and wait a few seconds for the plugin to install.

Debugging

By default, debug messages for this plugin are hidden.

To show them, run the following command in the DevTools Console:

window.DEBUG.enable('consistent-attachments-and-links');

For more details, refer to the documentation.

Changelog

All notable changes to this project will be documented in the CHANGELOG.

Contributing

Contributions are welcome — see CONTRIBUTING to get set up.

Support

Buy Me A Coffee

My other Obsidian resources

See my other Obsidian resources.

License

© dy-sh

Maintainer: Michael Naumov

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.