User Agents

Web browsers and everyday web tech, explained

Windows 11 Search Index: Include or Exclude File Extensions

· 5 min read · Extensions

In this article
  1. How the Search Indexer Handles File Extensions
  2. Why You Might Want to Include or Exclude Extensions
  3. How to Exclude a File Extension via Registry
  4. How to Include a File Extension via Registry
  5. Using Group Policy to Control Extensions
  6. Common Problems and Misconceptions
  7. Alternatives to Registry Editing
  8. Frequently Asked Questions

To include or exclude specific file extensions in Windows 11 search, you must edit the registry or use Group Policy—there is no built-in checkbox for extensions in the Settings app. The search indexer treats extensions as part of the file name, so you can add a FileExtensions key to the registry to whitelist or blacklist extensions, or use the Search policy to control which file types are indexed.

How the Search Indexer Handles File Extensions

Windows Search builds an index of file names, contents, and metadata. By default, it indexes all file extensions that have a registered IFilter or property handler. For example, .txt, .docx, and .pdf are indexed for content, while unknown extensions like .xyz are indexed only by file name. The indexer does not have a simple toggle for "include .log" or "exclude .tmp"—you must manipulate the registry or Group Policy to control which extensions are indexed.

Why You Might Want to Include or Exclude Extensions

Excluding extensions can speed up indexing, reduce disk usage, and prevent sensitive or temporary files from appearing in search results. For instance, excluding .log files from a developer's machine can cut down on noise. Including a rare extension like .md ensures that Markdown files are searchable by content if you have a filter installed. Most users, however, never need to touch these settings—the default behavior works well for typical documents and media.

How to Exclude a File Extension via Registry

To exclude an extension, you create a FileExtensions key under the search indexer's registry path and add a DWORD value with the extension name (without the dot) set to 0. Follow these steps:

  1. Press Win+R, type regedit, and press Enter.
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search. If the Windows Search key does not exist, right-click on Windows and create a new key named Windows Search.
  3. Right-click on the Windows Search key, select New → Key, and name it FileExtensions.
  4. Inside FileExtensions, right-click, select New → DWORD (32-bit) Value, and name it exactly as the extension without the dot (e.g., log for .log).
  5. Double-click the new value, set it to 0, and click OK.
  6. Restart the Windows Search service (or reboot) for the change to take effect.

Setting the value to 0 excludes that extension. Setting it to 1 includes it. If you want to include an extension that is not indexed by default, you may also need to install a filter for that type, but for file-name-only indexing, the DWORD value is enough.

How to Include a File Extension via Registry

Including an extension follows the same registry path. For example, to include .md files in search results by name, create a DWORD named md and set it to 1. After restarting the search service, files with that extension will appear in search results even if they were previously ignored. Note that this does not enable content search for that extension unless a filter is installed; it only makes the file name and metadata searchable.

Using Group Policy to Control Extensions

If you manage multiple computers, Group Policy is a cleaner method. The policy is located at Computer Configuration → Administrative Templates → Windows Components → Search. Look for a setting named "Set allowed file extensions for search indexer" or similar. Enabling this policy lets you specify a list of extensions that are allowed; all others are excluded. This is the same registry key as above but managed through the Group Policy Editor, which is available only in Pro, Enterprise, or Education editions of Windows 11.

Common Problems and Misconceptions

A frequent misconception is that changing the extension list in the indexer options (Control Panel → Indexing Options) does the same thing. That dialog only lets you choose which folders are indexed, not which file extensions. Another issue is that after editing the registry, the indexer may not immediately reflect the change—you must restart the service or reboot. Also, if you set an extension to 0, files with that extension will still appear in search results if they are in a location that is indexed by name only? Actually, setting to 0 excludes them entirely from the index, so they won't appear in searches. Finally, be aware that the registry path is under Policies, so the change is a policy—if a Group Policy update overwrites it, your manual setting may be lost.

Alternatives to Registry Editing

If you are not comfortable editing the registry, you can use the built-in search filters in File Explorer to narrow results by type (e.g., type:.log), but that does not change what is indexed. Another alternative is to move unwanted file types to a folder that is excluded from indexing, such as a folder you uncheck in Indexing Options. For advanced users, PowerShell scripts can modify the registry, but the steps are the same. There is no official Microsoft tool specifically for managing extensions; the registry method is the documented way.

Frequently Asked Questions

Can I exclude multiple extensions at once?

Yes, you can create multiple DWORD values under the FileExtensions key, one for each extension you want to exclude. Each value name is the extension without the dot, and all values should be set to 0.

Will excluding an extension delete my files?

No, excluding an extension only removes those files from the search index. The files themselves remain untouched on your disk.

Do I need to rebuild the index after changing extensions?

It is recommended to restart the Windows Search service, which forces a partial reindex. You can also go to Indexing Options → Advanced → Rebuild to fully rebuild the index, but that may take time.

Why doesn't my .xyz file appear in search even after I set the DWORD to 1?

If the extension is not registered with a filter, the file will only be indexed by name. Ensure that the file's folder is included in the indexed locations. Also, check that the DWORD value is named correctly (no dot, no spaces) and that you restarted the service.

Is there a way to include an extension for content search?

Yes, but you need to install a filter (IFilter) for that extension. Microsoft provides filters for common formats, but for custom extensions you may need to install third-party filters or write your own. Without a filter, only file names and metadata are indexed.

Does this work in Windows 10 as well?

Yes, the same registry path and Group Policy settings exist in Windows 10. The steps are identical, so you can use this guide for both operating systems.