豌豆射手32 downloadsClear the images that you are not using anymore in your markdown notes to save space.
English | 简体中文
Find and remove attachments that are no longer referenced in your vault. The plugin scans Markdown notes, Canvas files, and supported frontmatter references, then lets you review and select unused files before deleting them.
Requires Obsidian 1.13.0 or later.
This project is a fork of ozntel/oz-clear-unused-images-obsidian. It is distributed under the MIT License; the original project is copyrighted by ozntel.
The interface follows your Obsidian language setting. English is used when the Obsidian language is not supported.
Supported languages:
Enable this option to add a cleanup icon to the ribbon.
![]()
Deleted files are removed with FileManager.trashFile(), so Obsidian's own Settings → Files and links → Deleted files preference decides whether files go to the Obsidian trash, the system trash, or are deleted permanently.
Add comma-separated vault-relative folder paths to exclude files in those folders from cleanup.

Enable the subfolder option to also exclude files in subfolders.

The cleanup dialog lists unused files with checkboxes. Select Ignore this file to add a file to the exclusion list so it is omitted from future scans. Ignored paths are saved in the plugin's data.json.
Enable the plugin in Community plugins.
Start a scan using either method:
Ctrl/Cmd + P and run Clear unused images or Clear unused attachments.
Review the unused files in the dialog, select the files to remove, and choose Delete selected. You can open a listed file by clicking its path.
If all files are in use or excluded, the plugin shows a notice and does not open the selection dialog.
Image formats scanned: jpg, jpeg, png, gif, svg, bmp, webp
# Install dependencies
npm install
# Development build with watch mode
npm run dev
# Production build
npm run build
Contributions for additional languages are welcome. See doc/i18n.md for instructions.
MIT License
Thanks to all contributors and the Obsidian community for their support!
本插件通过删除不再在 Markdown 笔记中引用的图片,帮助您保持 vault 的整洁。
插件会获取所有 Markdown 文档中的图片链接,并与 vault 中可用的所有图片文件进行比较。
如果任何图片文件没有在 vault 的任何文档中被引用,它们将被自动删除。
本项目基于 ozntel/oz-clear-unused-images-obsidian 修改,遵循 MIT 协议,原项目版权归 ozntel 所有。
本插件现在支持多种语言!界面将根据您的 Obsidian 语言设置自动切换。
支持的语言:
如果您希望显示清除图片的功能区图标,请打开此选项。
![]()
如果您不想在删除完成后查看删除日志弹窗,请关闭此选项。如果没有删除任何图片,则不会出现此弹窗。

删除文件时会调用 FileManager.trashFile(),因此删除位置由 Obsidian 自身的 设置 → 文件与链接 → 删除的文件 选项决定(Obsidian 回收站 / 系统回收站 / 永久删除)。
您可以排除某些文件夹,在扫描过程中不会移除这些文件夹中的图片。如果需要排除多个文件夹,可以用逗号分隔。请确保提供 vault 中的完整路径:

您现在可以排除上述提供的文件夹路径下的所有子文件夹:

运行清理时,您将看到一个模态框,显示所有未使用的文件及其复选框。对于每个文件,您可以点击 "忽略此文件" 按钮,永久性地将其排除在未来的扫描之外。被忽略的文件路径将保存在插件的 data.json 文件中,不会再出现在未使用文件列表中。
当您想保留某些未使用的图片在 vault 中,而不想在每次运行清理时都被标记出来,这个功能非常有用。
在社区插件中激活本插件
您可以选择以下任一方式:
![]()
- 或使用功能区图标或打开命令面板 (使用 `Ctrl/Cmd + P` 或从功能区),运行"清除未使用的图片"。


如果所有图片都在使用中,您将看到如下提示:

扫描的图片格式: jpg, jpeg, png, gif, svg, bmp, webp
# 安装依赖
npm install
# 开发模式 (监听)
npm run dev
# 生产环境构建
npm run build
我们欢迎贡献更多语言支持! 有关如何添加新翻译的详细说明,请参阅 i18n.md。
MIT License
特别感谢所有贡献者和 Obsidian 社区的支持!