Search...Search plugins and themes...
⌘K
Sign in
  • Get started
  • Download
  • Pricing
  • Enterprise
  • Account
  • Obsidian
  • Overview
  • Sync
  • Publish
  • Canvas
  • Mobile
  • Web Clipper
  • CLI
  • Learn
  • Help
  • Developers
  • Changelog
  • About
  • Roadmap
  • Blog
  • Resources
  • System status
  • License overview
  • Terms of service
  • Privacy policy
  • Security
  • Community
  • Plugins
  • Themes
  • Discord
  • Forum / 中文论坛
  • Merch store
  • Brand guidelines
Follow us
DiscordTwitterBlueskyThreadsMastodonYouTubeGitHub
© 2026 Obsidian

Attachment Sweeper

Atlas CreativeAtlas Creative2 downloads

Find attachments that no note or canvas uses, see how much space they take, and move the ones you pick to trash or an archive folder. Also merges duplicate files, with undo.

Add to Obsidian
  • Overview
  • Scorecard
  • Updates1

Vaults collect images, PDFs and recordings that no note uses any more: a screenshot you replaced, a PDF from a note you deleted, a pasted image you never kept. They also collect the same image saved twice under different names. This plugin finds both, shows you every file and its size, and only changes what you pick, after you confirm.

Features

  • Counts every kind of link: wikilinks and embeds ([[file.pdf]], ![[image.png|300]]), markdown links and images (![](images/photo%20one.jpg), [doc](<my file.pdf>), relative paths like ../img/a.png), HTML tags (<img src="...">, <embed>, <a href="...">), links in frontmatter and plain paths there such as a cover or banner property, and canvas file cards, group backgrounds and links in text cards. Note text is read directly too, so links inside code blocks and in Excalidraw drawings' embedded files count.
  • Covers links built by plugins: Dataview, Templater and similar plugins can build a link from a file name when the note renders. With Keep files named in a note on (the default), any file whose name appears anywhere in a note counts as used. The review list and the report say how many files were kept this way.
  • Review list: every unused attachment with its path and size, largest first, and the total. Nothing is selected until you select it.
  • Trash or archive: after you confirm, picked files either go to trash through Obsidian, so your Deleted files option in Settings → Files and links decides where they go, or into an archive folder in your vault, keeping their folder structure, so you can move them back. Links are checked again just before anything moves, and a file that got a link since the scan is kept.
  • Duplicate finder: finds files with identical content, whatever their names, and shows each set with how many notes link to each copy. Pick the copy to keep, and the plugin points every link at it, in notes, frontmatter, HTML tags and canvases, then moves the other copies to the archive folder. Undo last duplicate merge puts the links and the files back. A copy that something still refers to after the merge, such as a plugin that builds its link from the name, stays where it is.
  • Dry-run report: writes a note listing every unused attachment and its size without moving anything. Paths are written as code, not links, so the report never makes a file count as used.
  • Excluded folders: attachments in these folders are never listed, moved or merged.

Notes (.md), canvases (.canvas), bases (.base) and Excalidraw drawings are never listed as attachments. The archive folder is never scanned.

Usage

  1. Run Attachment Sweeper: Find unused attachments from the command palette, or click the paperclip icon in the ribbon.
  2. Select the files you want to remove, or press Select all.
  3. Press Move to trash (or Move to archive) and confirm.

To see the list without changing anything, run Attachment Sweeper: Write unused attachments report (dry run).

To merge duplicates, run Attachment Sweeper: Find duplicate attachments, turn on the sets you want to merge, pick the copy to keep, then press Merge and confirm. Run Attachment Sweeper: Undo last duplicate merge to put everything back. Undo leaves alone any note you edited after the merge.

Settings

  • Excluded folders: comma-separated. Attachments in these folders are never listed or moved. Links from notes inside them still count.
  • Keep files named in a note: count a file as used when its name appears anywhere in a note. Safer, but it may keep a few unused files.
  • Unused files go to: trash, or the archive folder.
  • Archive folder: where archived files and merged duplicates go. Default Archive/Unused attachments.
  • Report note: where the dry-run report is written. The note is replaced each time you run the report.

Privacy

Everything runs locally. The plugin makes no network requests.

Installation

Manual

Copy main.js, manifest.json and styles.css into <your vault>/.obsidian/plugins/attachment-sweeper/, then enable the plugin in Settings → Community plugins.

Development

npm install
npm test        # unit tests for link detection, the scan, the report, trash and archive, and duplicate merges with undo
npm run lint    # ESLint with eslint-plugin-obsidianmd
npm run build   # type-check and build main.js

Releases

Publishing a GitHub release tagged with the version in manifest.json (for example 1.0.0) runs the Release workflow. It lints, tests and builds the plugin, attests build provenance for main.js, and attaches main.js, manifest.json and styles.css to the release.

Support

If this plugin saves you time, you can sponsor me on GitHub.

License

0BSD

HealthExcellent
ReviewSatisfactory
About
Scan and review unused attachments and duplicate files across your vault, listing each file with path and size so you decide what to remove. Move selected files to Obsidian Trash or to an archive that preserves folder structure, recheck links before moving, and merge duplicates by retargeting links in notes, frontmatter, HTML and canvases.
AttachmentsFilesLinks
Details
Current version
1.0.0
Last updated
17 hours ago
Created
17 hours ago
Updates
1 release
Downloads
2
Compatible with
Obsidian 1.6.6+
Platforms
Desktop, Mobile
License
0BSD
Report bugRequest featureReport plugin
Sponsor
GitHub Sponsors
Buy Me a Coffee
Support
Author
Atlas CreativeAtlas Creativeatlas-creative
atlascreative0.gumroad.com/
GitHubbzucker4
  1. Community
  2. Plugins
  3. Attachments
  4. Attachment Sweeper

Related plugins

Custom Attachment Location

Customize attachment location with variables($filename, $data, etc) like Typora.

Advanced URI

Control everything with URI.

Find orphaned files and broken links

Find files that are not linked anywhere and would otherwise be lost in your vault. In other words: files with no backlinks.

Consistent Attachments and Links

Move note attachments and update links automatically.

Pixel Perfect Image

Pixel perfect 100% image resizing, copy to clipboard, show image in Finder/Explorer, and much more.

Advanced Exclude

Enhances the Excluded files setting bringing gitignore syntax.

Note Refactor

Extract note content into new notes and split notes.

Notebook Navigator

A better file browser and calendar inspired by Apple Notes, Bear, Evernote and Day One.

Excalidraw

Visual PKM powerhouse. Create and edit Excalidraw drawings.

ExcaliBrain

An interactive, structured mind-map of your Obsidian vault.