How to stop a folder's photos showing in your gallery

The old .nomedia trick, and when it isn't enough.

Short answer

Put an empty file called .nomedia in the folder. Android's media scanner skips folders that contain one, so gallery apps stop showing those photos. The files aren't locked or encrypted, so anyone with a file manager can still open them.

The .nomedia trick

Android keeps an index of photos, videos and music so gallery apps can find them quickly. When the system finds a file named .nomedia in a folder, it leaves that folder out of the index. Gallery apps that rely on the index stop showing what's inside.

To use it:

  1. Open a file manager app. Most phones come with one called Files or My Files.
  2. Go to the folder you want to hide, or make a new one.
  3. Create a new file and name it exactly .nomedia, starting with the dot.
  4. Restart your gallery app. It can take a little while for the photos to disappear.

On newer versions of Android, some file managers won't let you create a file that starts with a dot. If yours won't, try a different file manager from the Play Store.

What it doesn't do

The photos are still ordinary files in an ordinary folder.

  • Anyone who opens a file manager can browse to the folder and see them.
  • Plugging the phone into a computer shows them too.
  • Some apps scan storage directly and ignore .nomedia.
  • If the folder was backed up before you hid it, the backup still has the photos.

It's a tidy-up tool. It keeps screenshots of receipts out of your camera roll. It won't stop anyone who is actually looking.

If you need them locked

For anything private, move the photos into a space with its own lock instead. Our guide to hiding photos on Android compares Locked Folder, Secure Folder, Private space and vault apps. Dobr encrypts each file, so even someone with a file manager or a computer sees nothing but scrambled data.

Last checked 2026-11-01. Phone menus change between Android versions and brands, so labels on your phone may differ slightly.