Resource Link Refactor
unlistedby Todestrieb
Updates references to images, documents and videos when they are renamed or moved, including renames outside Obsidian, paths in properties and HTML attributes.
Resource Link Refactor
An Obsidian plugin that keeps references to images, documents, videos and other attachments up to date when those files are renamed or moved — including the cases Obsidian's built-in Automatically update internal links option does not cover.
What it covers
| Case | Example | Built-in option | This plugin |
|---|---|---|---|
| Files renamed or moved outside Obsidian (File Explorer, Finder, sync tools) | photo.jpg → beach.jpg in Explorer | ✗ | ✓ |
| Embeds inside properties | banner: "![[photo.jpg]]" | ✗ | ✓ |
| Plain-text paths in properties | cover: photo.jpg | ✗ | ✓ |
| HTML attributes | <img src="…">, <video src="…">, <a href="…">, poster, data | ✗ | ✓ |
| Markdown links with encoded or relative paths |  | partial | ✓ |
Subpaths and query strings such as #page=2 are preserved, and the style of each link (short name, full path or relative path) is kept unless you choose otherwise.
How it works
- Renames inside Obsidian: the plugin waits for Obsidian to finish its own link update, then fixes what is left.
- Renames outside Obsidian: Obsidian sees these as a deleted file plus a new file. The plugin pairs them when both have the same extension, size and modification date within a short time window, and treats the pair as a rename.
- Renames while Obsidian was closed: run the command Update references to a file renamed while Obsidian was closed and enter the old and new paths.
- Move attachments with the note (optional): when enabled, moving or renaming a note inside Obsidian moves its attachments to its attachment folder (by default
Media/<note name>next to the note) and updates the links. Attachments that other notes also use are not moved.
Installation
Manual
- Download
main.jsandmanifest.jsonfrom the latest release. - Copy them to
<your vault>/.obsidian/plugins/resource-link-refactor/. - Reload Obsidian and enable Resource Link Refactor under Settings → Community plugins.
With BRAT
- Install the BRAT plugin.
- In BRAT, choose Add beta plugin and enter this repository's URL.
Settings
| Section | Setting | Default | Description |
|---|---|---|---|
| Language | Language | Automatic | Interface language: Automatic (follows Obsidian), Español, English or 日本語. |
| Detection | Detect renames outside Obsidian | On | Pairs deleted and created files to detect external renames. |
| Detection window (seconds) | 5 | Maximum time between the delete and the create. Raise it for slow sync tools. | |
| Complete renames inside Obsidian | On | Fixes what Obsidian's own update misses. | |
| Delay after internal renames (ms) | 1500 | How long to wait for Obsidian before checking. | |
| What gets updated | Extensions | (all) | Comma-separated file types to track. Empty = everything that is not a note. |
| Include notes (.md) | Off | Also track note renames, including [[Note]] links without extension. | |
| Plain-text paths in properties | On | Update paths written without brackets in properties. | |
| Properties to check | (all) | Comma-separated property names. Applies to every reference inside properties. | |
| HTML attributes | On | Update src, href, poster and data. | |
| Leave code blocks untouched | On | Ignore fenced code blocks and inline code. | |
| Excluded folders | (none) | Notes in these folders are never modified. One folder per line. | |
| Attachments | Move attachments with the note | Off | When a note is moved or renamed, moves its attachments to the attachment folder. Attachments shared with other notes stay where they are. |
| Attachment folder | Media/${notename} | Relative to the note's folder; ${notename} is the note's name. A leading / means from the vault root. Empty = the note's folder. | |
| Folders where it applies | (whole vault) | Only attachments of notes inside these folders are moved. One per line. | |
| Format | Style of new paths | Keep | Keep each link's style, or force short name, full path or relative path. |
| Safety and log | Confirm before changing | Only external renames | Show the list of changes and ask before writing: never, only external renames, or always. |
| Test mode | Off | Show what would change without modifying anything. | |
| Keep a log | Off | Record every change in a note. | |
| Log note | Resource Link Refactor log.md | Where the log is kept. This note is never modified by renames. | |
| Show notice | On | Show how many references were updated. |
Limitations
- External renames are only detected while Obsidian is running. For renames made while it was closed, use the command.
- Detection of external renames relies on size and modification date. If two different files with the same extension, size and date are deleted and created within the detection window, they could be paired by mistake. Keeping Confirm before changing enabled protects against this.
- When two files in different folders share the same name, short-name references (
![[photo.jpg]]) are left untouched because they are ambiguous. - Move attachments with the note only acts on notes moved inside Obsidian, not on notes moved in the file explorer. Paths that only appear in HTML attributes are not considered when deciding which attachments to move.
License
Copyright © 2026 Todestrieb
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 or (at your option) any later version. Any modified version you distribute must also be released under the same license, with its source code. See LICENSE for the full text.
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.