calmtea232 downloadsPrevent Android gallery apps from indexing images stored inside your Obsidian vault using .nomedia files.
Keep media in your Obsidian vault out of Android gallery apps.
Gallery Excluder creates Android .nomedia files in selected vault folders. Your images remain ordinary files, so they still appear in Obsidian, work in embeds, and can be synchronized normally.
[!NOTE] You can configure the plugin on any platform, but it creates and removes
.nomediafiles only in Obsidian for Android.
.nomedia file that already exists at a target location untouched.Android media scanners recognize a file named .nomedia as a request not to index media in that folder or its subfolders. Gallery Excluder places an empty .nomedia file at each location covered by the selected protection mode.
This affects compatible Android gallery and media apps only. It does not delete, move, encrypt, or hide files inside Obsidian.
main.js, manifest.json, and styles.css from the latest release.YourVault/.obsidian/plugins/gallery-excluder/.Building from source generates main.js. The other two required plugin files, manifest.json and styles.css, are already included in the repository.
Install Node.js, which includes npm.
Clone the repository and open its folder:
git clone https://github.com/Calmtea5209/Gallery-Excluder.git
cd Gallery-Excluder
Install the exact dependencies recorded in package-lock.json, then create a production build:
npm ci
npm run build
After the build finishes, find the generated main.js in the project root.
Create YourVault/.obsidian/plugins/gallery-excluder/.
Copy main.js, manifest.json, and styles.css into that folder.
Restart Obsidian or reload the app.
Open Settings → Community plugins and enable Gallery Excluder.
The .obsidian folder and .nomedia files are hidden by many file managers. Enable hidden-file display if you need to inspect them.
Protection is enabled by default for the entire vault. On Android, Gallery Excluder applies the selected mode after the vault is ready. You can change its behavior under Settings → Gallery Excluder.
| Setting | What it does |
|---|---|
| Automatic protection | Creates and maintains .nomedia files when enabled. Turning it off removes files created by Gallery Excluder. |
| Protection mode | Chooses the folders that Gallery Excluder protects. |
| Apply protection now | Immediately applies the current configuration on Android when protection is enabled. |
| Mode | Protected location |
|---|---|
| Entire vault | The vault root, covering media throughout the vault. |
| Attachment folder only | The attachment folder configured under Obsidian's Files and links settings. |
| Custom folders | One or more vault-relative folders, such as attachments, assets, or images/screenshots. A configured folder can be created later. |
If Obsidian stores attachments relative to the current note, such as ./ or ./assets, there is no single vault-wide attachment folder. In Attachment folder only mode, Gallery Excluder asks for a fixed vault-relative fallback folder.
Creating .nomedia stops compatible media scanners from indexing the protected folders, but a gallery app may keep images that it indexed earlier. On Android:
Menu names may vary between devices and gallery apps. These instructions are also available in a collapsible help card at the bottom of the plugin settings page on Android.
.nomedia already exists when Gallery Excluder checks a target, the plugin does not overwrite or track it..nomedia files at paths recorded as plugin-created. If a different .nomedia file later replaces one at the same path, Gallery Excluder cannot distinguish it and will remove it too..nomedia..nomedia file may sync to other devices. Windows, macOS, and iOS do not use it for Android media scanning, so it normally has no effect there..nomedia from Obsidian Sync... are rejected. Missing or unwritable folders are reported without modifying other locations.