What is the METADATA_NEVER_INDEX file format?
.metadata_never_index is associated with hidden marker files that are part of the macOS system environment. Files of this type are used to deny Spotlight indexing of selected folders, files, or volumes on the hard drive. Unlike ordinary files, a .metadata_never_index file carries no data - its filename alone is the payload, communicating to Spotlight not to index certain elements, hence the 'never index' in its name. The file is a Unix dotfile, making it invisible in Finder by default.
.metadata_never_index file location
.metadata_never_index files can be found on flash drives, iPods, and other types of volume. These files prevent automatic indexing of folder contents each time a device is connected to the computer. They are placed in the root folder of the volume - on macOS, the top-level directory the drive mounts to. Deleting a .metadata_never_index file allows Spotlight to resume indexing the folder or volume where the file was stored, after which the mds daemon builds a new .Spotlight-V100 database on that volume.
A closely related variant, .metadata_never_index_unless_rootfs, applies the same exclusion with a narrow exception for the root filesystem. On Android and Linux, the .nomedia file serves a similar purpose for media scanners. The format was introduced in Mac OS X 10.4 Tiger alongside Spotlight in 2005 and is still in active use on all current macOS releases.
Security & safety
RISK: LOWThe file itself is harmless - it's empty and contains no code. The only real risk is operational: if you delete it not realizing why a drive wasn't being indexed, Spotlight will start indexing that volume (extra disk/CPU activity, and a .Spotlight-V100 database appears). Conversely, an unexpected .metadata_never_index on a drive can be a benign tool leftover, not a sign of compromise. Don't paste random Terminal commands from forums; the supported, reversible way to exclude folders is System Settings > Spotlight > Privacy.
Format details
in a nutshellPrograms that open METADATA_NEVER_INDEX files
ls -la /Volumes/YourDrive; create with touch /Volumes/YourDrive/.metadata_never_index; remove with rm. Use mdutil -i on /Volumes/YourDrive to turn indexing back on. Technical details
deep spec| File type | Empty marker/flag file - its presence on a volume, not its contents, is the data |
| Developer | Apple Inc. |
| Associated operating system | macOS (all versions since Mac OS X 10.4 Tiger) |
| Typical file size | 0 bytes - the file is intentionally empty; occasionally a few bytes if written by a third-party tool |
| Exact file name | `.metadata_never_index` - case-sensitive; the dot-prefixed name is fixed and must match exactly |
| Visibility | Hidden Unix dotfile - the leading dot conceals it from Finder and standard directory listings by default |
| Required location | Root directory of a target volume (e.g., `/Volumes/MyDrive/.metadata_never_index`) |
| Internal structure | None - no header, no payload, no magic bytes; the file is empty by design |
| MIME type | `application/octet-stream`; reported as `inode/x-empty` on some Unix systems |
| Effect on Spotlight | Prevents the `mds` and `mdworker` daemons from building a `.Spotlight-V100` index on the volume |
| Creation method | Terminal: `touch /Volumes/<name>/.metadata_never_index`; also placed automatically by macOS on system partitions |
| Removal effect | Deleting the file re-enables Spotlight indexing of that volume on the next mount or connection |
| Sibling flag file | `.metadata_never_index_unless_rootfs` - identical behavior with a narrow exception for the root filesystem |
| Encoding | None - no character encoding applies; the file has no readable content |
| Cross-platform analogue | Android/Linux `.nomedia` suppresses media scanner indexing via the same name-presence mechanism |
| Released | Mac OS X 10.4 Tiger, 2005 (with the introduction of Spotlight) |
| Latest version | N/A (the file is just a name-based flag; no internal version) |
| Specification | developer.apple.com |
Community Q&A
asked by usersNo questions yet - be the first to ask about METADATA_NEVER_INDEX files.
Frequently asked questions
What is a .metadata_never_index file?
Can I delete the .metadata_never_index file?
mdutil -i on /Volumes/YourDrive (or just wait) to rebuild the index.Why isn't Spotlight finding files on my external drive?
How do I stop Spotlight from indexing a drive?
touch /Volumes/YourDrive/.metadata_never_index. Or use the supported route: System Settings > Spotlight > Privacy and add the folder/drive.Is the file safe / is it a virus?
Why can't I see the file in Finder?
ls -la.