Resource Link Refactor

unlisted

by Todestrieb

Updates references to images, documents and videos when they are renamed or moved, including renames outside Obsidian, paths in properties and HTML attributes.

★ 1 starsUpdated 5d agoGPL-3.0
View on GitHub

Resource Link Refactor

English · Español · 日本語

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

CaseExampleBuilt-in optionThis plugin
Files renamed or moved outside Obsidian (File Explorer, Finder, sync tools)photo.jpg → beach.jpg in Explorer✗✓
Embeds inside propertiesbanner: "![[photo.jpg]]"✗✓
Plain-text paths in propertiescover: photo.jpg✗✓
HTML attributes<img src="…">, <video src="…">, <a href="…">, poster, data✗✓
Markdown links with encoded or relative paths![](../media/my%20photo.jpg)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

  1. Download main.js and manifest.json from the latest release.
  2. Copy them to <your vault>/.obsidian/plugins/resource-link-refactor/.
  3. Reload Obsidian and enable Resource Link Refactor under Settings → Community plugins.

With BRAT

  1. Install the BRAT plugin.
  2. In BRAT, choose Add beta plugin and enter this repository's URL.

Settings

SectionSettingDefaultDescription
LanguageLanguageAutomaticInterface language: Automatic (follows Obsidian), Español, English or 日本語.
DetectionDetect renames outside ObsidianOnPairs deleted and created files to detect external renames.
Detection window (seconds)5Maximum time between the delete and the create. Raise it for slow sync tools.
Complete renames inside ObsidianOnFixes what Obsidian's own update misses.
Delay after internal renames (ms)1500How long to wait for Obsidian before checking.
What gets updatedExtensions(all)Comma-separated file types to track. Empty = everything that is not a note.
Include notes (.md)OffAlso track note renames, including [[Note]] links without extension.
Plain-text paths in propertiesOnUpdate paths written without brackets in properties.
Properties to check(all)Comma-separated property names. Applies to every reference inside properties.
HTML attributesOnUpdate src, href, poster and data.
Leave code blocks untouchedOnIgnore fenced code blocks and inline code.
Excluded folders(none)Notes in these folders are never modified. One folder per line.
AttachmentsMove attachments with the noteOffWhen a note is moved or renamed, moves its attachments to the attachment folder. Attachments shared with other notes stay where they are.
Attachment folderMedia/${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.
FormatStyle of new pathsKeepKeep each link's style, or force short name, full path or relative path.
Safety and logConfirm before changingOnly external renamesShow the list of changes and ask before writing: never, only external renames, or always.
Test modeOffShow what would change without modifying anything.
Keep a logOffRecord every change in a note.
Log noteResource Link Refactor log.mdWhere the log is kept. This note is never modified by renames.
Show noticeOnShow 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.