README file from
GithubClear Unused Images Plus
Clear Unused Images Plus is a fork of oz-clear-unused-images.
The current fork is maintained by Aleksei B. The original plugin author is Ozan.
See the CHANGELOG for release-by-release updates.
This plugin helps keep your vault clean by deleting images that are no longer referenced in your markdown notes.
The plugin collects image links from markdown documents and compares them against image files in your vault.
If any image files are not referenced in any document, they can be deleted automatically.
Settings
Deleted Image Destination
Please make sure that you select the destination for deleted images under the "Clear Unused Images Plus Settings" tab. You have 3 options:

-
Move to Obsidian Trash - Files are going to be moved to the
.trashunder the Obsidian Vault. -
Move to System Trash - Files are going to be moved to the Operating System trash.
-
Permanently Delete - Files are destroyed permanently. You will not be able to revert them.
Clean Images On Vault Load
You can enable automatic cleanup during vault startup with the Clean Images On Vault Load setting.

- The cleanup runs once after the vault layout is ready.
- It only runs the image cleanup flow, not the
Clear Unused Attachmentscommand. - If you enable the toggle while Obsidian is already open, the change takes effect on the next vault load.
- If
Permanently Deleteis selected, the existing confirmation dialog still appears before deletion starts.
Clean Images Every X Minutes

You can also enable recurring automatic cleanup with the Clean Images Every X Minutes setting.
- The periodic timer only runs image cleanup while Obsidian stays open.
- The timer starts after the vault layout is ready and waits the full configured interval before the first periodic run.
- If both automatic modes are enabled, the vault-load cleanup runs once on startup and the periodic cleanup starts later on its normal interval.
- Periodic cleanup is disabled when
Permanently Deleteis selected. - Changing the toggle, interval, or delete destination in settings updates the periodic scheduler for the current session.
Excluded Folders
You can exclude folders from which you do not want images to be removed during the scan. If there are multiple folders to exclude, separate them with commas. Please provide the full path inside the vault:

You can now exclude all subfolders under the folder paths provided above:

How to use
-
Activate the plugin from Community Plugins.
-
You can either:
- Activate the ribbon icon from plugin settings and click the icon in the left ribbon to run the cleanup:

- Or use the ribbon icon or open the Command Palette with
Ctrl/Cmd + Pand runClear Unused Images Plus.

-
If you have turned on the "Delete Logs" option in plugin settings, you will see a modal with information about which images were deleted from your vault:

If all images are used, you will see the following message:

Scanned Image Formats : jpg, jpeg, png, gif, svg, bmp, webp
Support
This repository is distributed under the MIT License.