How to Exclude Attachment Content from Microsoft 365 eDiscovery Searches
Question details
The user needs to configure an eDiscovery search to find specific keywords strictly within email subjects or bodies, while intentionally ignoring those same keywords if they appear inside file attachments.

- Product
- Microsoft 365 eDiscovery
- Device & OS
- not provided
- Scenario
- Performing targeted legal or compliance content searches across an organization's email communications without triggering false positives from attached documents.
- Observed behavior
- Unlike standard Outlook body searches, the default Microsoft 365 eDiscovery query broadly matches keywords found within file attachments, leading to unwanted search results.
Ensure you have the appropriate eDiscovery Manager or Administrator permissions assigned in the Microsoft Purview compliance portal before configuring and running content searches.
Use Property Restrictions in Keyword Query Language (KQL)
Refine your eDiscovery search query by explicitly targeting the 'subject' and 'body' email properties to prevent the search from indexing and matching words inside file attachments.
Microsoft 365 eDiscovery relies on Keyword Query Language (KQL) to evaluate search parameters. By default, a simple keyword search evaluates all searchable properties, including attachment text. To isolate your results, you must restrict the query specifically to message-level properties.
Log in to the Microsoft Purview compliance portal using an account equipped with appropriate eDiscovery permissions.
Select 'eDiscovery' or 'Content Search' from the left-hand navigation pane, and either open an existing case or create a new search.
In the search query box, instead of typing the standalone keyword, format it using property restrictions. For example, to search for the word 'fire', enter: subject:"fire" OR body:"fire"
Test your new query against a set of controlled emails—some containing the keyword in the body, and others with the keyword only in the attachment—to verify that attachments are successfully excluded.

Looking for a Lightweight and Compatible Alternative to Microsoft Office?
While enterprise compliance features like eDiscovery require Microsoft 365 administrative portals, your daily document creation doesn't require a heavy, expensive subscription. WPS Office provides a powerful, free alternative to Microsoft Office that meets all your word processing, spreadsheet, and presentation needs.
- 1. Download the Installer: Visit the official WPS Office website and download the free installer for your operating system.
- 2. Install WPS Office: Run the downloaded file and follow the on-screen prompts to easily install the suite.
- 3. Start Creating: Open WPS Office and instantly begin editing your existing Word, Excel, and PowerPoint files without formatting loss.

Frequently Asked Questions
Why does my default eDiscovery search find words in attachments?
By default, eDiscovery performs a broad content search that indexes and searches all available properties, including the contents of common file attachments, unless you restrict the search parameters using Keyword Query Language (KQL).
What is KQL and how does it help in Microsoft 365 searches?
Keyword Query Language (KQL) allows you to build complex search queries in Microsoft Purview by specifying exact parameters like 'subject', 'body', or 'author', which helps eliminate false positives from unwanted areas like attachments.
Do Outlook desktop searches and eDiscovery searches work exactly the same way?
No. eDiscovery is designed for enterprise compliance and indexes content much more extensively than the standard Outlook desktop search cache. You should always verify compliance queries with controlled test messages to confirm your syntax behaves as expected.




