Modern smartphones based on Android automatically scan internal memory and SD cards in search of images, videos and audio recordings. This process is necessary to create a library in the gallery, but often leads to completely unnecessary files appearing in the general flow: avatars from instant messengers, advertising banners from applications and screenshots of interfaces.

To bring order to the visual chaos, the system offers a special system marker - .nomedia. This is an empty file without an extension, the presence of which in a folder instructs the system to ignore the contents of this directory when scanning. The gallery and music players simply โ€œwill not seeโ€ media files where this marker is located.

You can create such an object in several ways, using both the built-in functions of the file manager, and third-party utilities or a computer. In this article we will analyze all available methods, from the simplest to the most advanced, so that you can effectively manage the visibility of your data.

Why do you need the .nomedia file and how does it work

The principle of operation of this system file is based on the operation of a media content scanner MediaScanner. When you plug your phone into a charger or reboot the device, this background process runs through all available storage. If it encounters a folder with a marker .nomedia, it skips its contents without adding links to the files in the gallery database.

This is especially true for social media cache folders where thousands of temporary images are stored. Without this file, your gallery would turn into an endless feed of memes and logos. However, sometimes the opposite situation arises: you created a folder for personal photos, but the system stubbornly hides it from view, or vice versa - technical files creep into a visible place.

The .nomedia file affects only multimedia formats (jpg, png, mp4, mp3), leaving documents and archives visible to file managers. This is an important nuance, since your PDF files or ZIP archives will remain accessible through Explorer, even if the folder has a media blocker.

Understanding this logic allows you to flexibly configure privacy. You can leave one folder open for quick access, and make another containing work documents or personal photos invisible to standard viewing applications.

Preparation: choosing a file manager

Before you start creating system files, you need to make sure that your tool allows you to see hidden objects. By default, many explorers hide files starting with a dot so that the user does not accidentally delete important system data.

Standard file manager Google Files or MI File Manager often have limited functionality for working with hidden attributes. For such tasks, advanced managers are better suited, such as Solid Explorer, FX File Explorer or Total Commander.

In the settings of the selected application, you need to find the section responsible for display and activate the โ€œShow hidden filesโ€ item. It's usually found in the Settings menu or in the View section. Without this step, you simply will not be able to check the result of your work or rename an existing file.

๐Ÿ“Š Which file manager do you use most often?
Google Files
Solid Explorer
Total Commander
CX Explorer
Other
  • ๐Ÿ“ Make sure that the display of hidden files and folders in Explorer settings.
  • ๐Ÿ”’ Check permissions: system folders may require advanced permissions.
  • ๐Ÿ’พ Free up some space if you plan to create files in crowded directories.

Method 1: Creating via computer (PC/Mac)

The most reliable and easiest way to create a file with an exact name is to use a computer. Connect your smartphone to your PC via a USB cable and select file transfer mode MTP. On your computer, open the smartphone disk that appears.

Go to the desired directory where you want to hide the media. Create a new text file. In Windows, this is done through the right-click context menu: Create โ†’ Text document. Rename the file to .nomedia (required with a period at the beginning).

Windows may warn you that changing the extension may make the file inaccessible. Agree with this. If you don't see the extension .txt, turn on the display of extensions in Windows Explorer through the "View" tab. After renaming, the file will become hidden and disappear from view, which is normal behavior.

๐Ÿ’ก

If Windows refuses to rename the file, calling it simply ".nomedia.", try entering the name with a space at the end ".nomedia", and after saving, rename the file on the phone itself, removing the space.

Operating system Creation method Naming nuances
Windows 10/11 Right mouse button โ†’ Create Requires enabling display of extensions
macOS Terminal or TextEdit Hide the file automatically upon creation
Linux Touch command Standard behavior for hidden files

Method 2: Using the terminal on Android

For users who prefer command line control, the ideal solution would be a terminal application, for example Termux or Terminal Emulator. This method does not require a connection to a PC and works quickly.

After installing the application, launch it. You will need to navigate to the directory where the marker should appear. Use the command cd (change directory). For example, to go to the Download folder, enter:

cd /sdcard/Download

Next, create an empty file with the desired name using the command touch. Enter:

touch .nomedia

If everything went well, the terminal will simply go to a new line without error messages. Check the presence of the file through the file manager - it should appear in the specified folder.

โ˜‘๏ธ Algorithm of actions in the terminal

Done: 0 / 4

โš ๏ธ Attention: When working in the terminal, be extremely careful about the case of letters. Commands Touch and touch are different things for the system. Also, an error in the path can lead to the creation of a file in the system folder, which is undesirable.

Method 3: Renaming an existing file

If you do not have a computer at hand or the desire to tinker with commands, you can use the renaming trick. Create any file in the desired folder, for example, a text note or even a new folder, and name it nomedia.txt.

Then select this file, click "Rename" and change the name to .nomedia. Remove the extension .txt completely. The system will ask for confirmation to change the extension - confirm the action.

This method is good because the visual interface of the file manager will immediately show the result. If the file disappears from view after renaming and turning on the hidden file mode, it means you did everything correctly, and the period at the beginning of the name activated the hiding attribute.

What to do if the file is not hidden?

Make sure that there are no extra spaces in the name. Often, users accidentally leave a space after a period (for example, ". nomedia"). The file must be called strictly ".nomedia" without any additional characters.

  • โœ๏ธ Create a temporary file with any name.
  • ๐Ÿ”„ Select the "Rename" option in the file menu.
  • ๐Ÿ—‘๏ธ Remove the old name and extension, leaving only .nomedia.

Sometimes after creating a marker, images still remain in the gallery. This occurs because the media database is cached and is not updated immediately. The system Android does not scan memory every second.

The easiest way to force an index update is to reboot the device. After turning on, the phone will conduct a full scan of the storage and take into account the new rules specified by the file .nomedia.

If the reboot does not help, you can clear the cache of the Media Storage service. Go to Settings โ†’ Applications โ†’ Show system processes โ†’ Media storage. Select Clear Cache or Clear Data. This will force the system to rescan all folders from scratch.

๐Ÿ’ก

After creating the .nomedia file, you must reboot the device or clear the cache of the Media Storage service to apply the changes.

โš ๏ธ Attention: The application settings interface may differ on different shells (One UI, MIUI, ColorOS). If you don't find "Media storage" in the list, try using the settings search or a third-party task management application.

Common problems and solutions

Users often encounter a situation where the file .nomedia created, but the gallery application still displays the contents of the folder. This could be due to aggressive caching of a specific application or a bug in the path.

Check if your folder is inside another folder that already has such a marker. Nesting logic may work unpredictably in some versions Android. Also make sure that the file is actually empty and has the correct extension.

In rare cases, antivirus apps or memory optimizers may delete "useless" empty files, considering them garbage. Add an exception for system files in the settings of your cleaner.

Is it possible to delete the .nomedia file to get the pictures back?

Yes, of course. The file .nomedia does not encrypt or hide data forever. It only gives the command to ignore the folder. Deleting this file (via the display hidden files mode) will return the images to the gallery after the next scan or reboot.

Does this file affect the operation of instant messengers?

No, creating a token does not affect the functionality of applications. WhatsApp or Telegram will continue to download and save pictures to their folders. The only thing that will change is that these pictures will no longer appear in the general gallery feed of your smartphone.

Why is the file called .nomedia?

This is a standard convention in operating systems based on Linux, the successor of which is Android. A period at the beginning of a file name on Unix-like systems traditionally means that the file is hidden, and the name "nomedia" indicates to the scanner that there is no media content to index.

Will the method work on Android 14 and newer?

Yes, the mechanism of the media scanner remains unchanged throughout many versions of Android. However, in new versions of the system (Android 13-15), the isolation of applications has increased, so access to some system folders may be limited without special permissions.