Windows Search skips files you know exist, especially code files like .php, .java, .aspx, and .html, because the indexer either doesn’t include the right folders or isn’t set to index file contents. Here’s how to fix that in Windows 11 and Windows 10.
How to Access Indexing Options in Windows 11
In Windows 11, indexing settings live in Settings, not the Control Panel. Here’s how to get there and check what’s currently being indexed.
- Press
Windows + Ito open Settings. - Go to Privacy & security > Searching Windows.
- At the top, you’ll see the Indexed count and the Size on disk for the index database (Windows.db).

In Windows 10, the path is Settings > Search > Searching Windows instead.
Fix #1: Add or Remove Indexed Locations
By default, Windows indexes your user folders and libraries. If you’re a developer with code on a separate drive or network share, those folders won’t be indexed unless you add them manually.
- Go to Settings > Privacy & security > Searching Windows (Windows 11) or Settings > Search > Searching Windows (Windows 10).
- Scroll down and click Advanced indexing options. The classic Indexing Options dialog will open.
- Click Modify.
- In the folder tree, check any drive or folder you want to include, including network drives and external hard drives.
- Click OK.


Depending on how many files are in the new location, it may take several minutes or longer for the indexer to catch up. You can check progress back in Settings > Privacy & security > Searching Windows.
Fix #2: Index File Contents for Code and Text Files
Adding a folder to the index only indexes file names and properties by default. If you want to search inside files – essential for code files like .php, .java, or .html – you need to enable content indexing for those file types.
- Go to Settings > Privacy & security > Searching Windows > Advanced indexing options.
- Click Advanced, then select the File Types tab.
- Scroll through the list to find your file extension (e.g.,
.php,.java,.aspx). If it’s not there, type the extension in the field at the bottom and click Add. - Select the extension in the list, then choose Index Properties and File Contents in the radio buttons below.
- Click OK.

After saving, Windows will re-index the affected file types. Searches inside those files should start returning results once indexing finishes.
Fix #3: Exclude Folders to Reduce Index Bloat
A bloated index, one that’s grown beyond roughly 10% of your total content size, can slow searches down or cause missed results. Excluding folders you don’t need to search is the fastest way to trim it.
- Go to Settings > Privacy & security > Searching Windows.
- Click Add an excluded folder.
- Browse to the folder you want to exclude (e.g., a
node_modulesor build output directory) and click Select Folder.

Repeat for any other folders you don’t need indexed. This is especially useful for developers with large dependency folders that inflate the index without adding useful search results.
Fix #4: Adjust Index Settings (Encrypted Files, Diacritics, Index Location)
The Index Settings tab gives you a few additional controls worth knowing about.
- Go to Advanced indexing options > Advanced > Index Settings tab.
- Check Index encrypted files if you need to search inside BitLocker-encrypted content.
- Check Treat similar words with diacritics as different words if you work with multilingual content and need precise matching.
- To move the index database to a faster drive, click Select new under Index location, choose the target drive, and click OK. Windows will rebuild the index in the new location.

Moving the index to a faster SSD can noticeably speed up search on systems where the OS drive is slower than a secondary drive.
Fix #5: Rebuild the Index (When Search Results Are Wrong or Missing)
If Windows Search is returning stale results, missing files you know exist, or behaving erratically after an upgrade, rebuilding the index clears the database and starts fresh.
- Go to Advanced indexing options > Advanced > Index Settings tab.
- Click Rebuild under Troubleshooting.
- Click OK on the confirmation prompt. Windows will delete and recreate the index.

Rebuilding can take anywhere from a few minutes to over an hour depending on how many files you have. Search results may be incomplete until the rebuild finishes, you can track progress in Settings > Privacy & security > Searching Windows.
Fix #6: Make Sure the Windows Search Service Is Running
Some antivirus tools and PC optimizer apps disable the Windows Search service (wsearch), which stops indexing entirely.
- Press
Windows + R, typeservices.msc, and press Enter. - Scroll down to Windows Search.
- Check that the Status column shows Running and Startup Type shows Automatic (Delayed Start).
- If it’s stopped, right-click Windows Search and select Start.
- If the startup type is wrong, right-click > Properties, set Startup type to Automatic (Delayed Start), click Apply, then Start the service.

Alternative: Use Everything for Instant File Search
If Windows Search continues to frustrate you, especially on large codebases, Everything by voidtools is worth trying. It uses the NTFS change journal to index file names almost instantly with no noticeable overhead, and it supports regex and file type filters. It doesn’t index file contents by default, but for finding files by name or extension it’s dramatically faster than the Windows indexer.
For content searches inside code files, Select-String in PowerShell is another solid option that bypasses indexing entirely:
Get-ChildItem -Recurse -Filter "*.php" | Select-String "your_keyword"
This searches inside every .php file in the current directory tree and returns matching lines — no index required.
Conclusion
For most people, Fix #2, enabling Index Properties and File Contents for the right file types is what makes Windows Search actually useful for code and text files. If search results are stale or broken after a Windows update, Fix #5 (Rebuild) usually clears it up. If indexing keeps stopping on its own, check the Windows Search service in Fix #6 first as an optimizer or antivirus is likely the culprit.