Compliance Problems

How to Exclude Attachment Content from Microsoft 365 eDiscovery Searches

Nimra MalikNimra Malik Nov 2, 2026 871 views

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.

How to Exclude Attachment Content in Microsoft 365 eDiscovery Searches
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.
Before you start

Ensure you have the appropriate eDiscovery Manager or Administrator permissions assigned in the Microsoft Purview compliance portal before configuring and running content searches.

Solution 1Recommended

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.

1
Access Microsoft Purview

Log in to the Microsoft Purview compliance portal using an account equipped with appropriate eDiscovery permissions.

2
Navigate to eDiscovery or Content Search

Select 'eDiscovery' or 'Content Search' from the left-hand navigation pane, and either open an existing case or create a new search.

3
Format the KQL Query

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"

4
Run Controlled Tests

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.

Use Property Restrictions in Keyword Query Language (KQL)
Verify Search Behavior Differences: eDiscovery search behavior and indexing can differ from a basic Outlook client search. Always verify the results with controlled test messages to ensure compliance accuracy.
Free Microsoft Office alternative

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. 1. Download the Installer: Visit the official WPS Office website and download the free installer for your operating system.
  2. 2. Install WPS Office: Run the downloaded file and follow the on-screen prompts to easily install the suite.
  3. 3. Start Creating: Open WPS Office and instantly begin editing your existing Word, Excel, and PowerPoint files without formatting loss.
Fully compatible with Microsoft Office file formats (.docx, .xlsx, .pptx).Free and lightweight suite perfect for PC, Mac, and mobile devices.Familiar user interface ensuring a seamless migration with zero learning curve.Built-in PDF toolkit to securely view, edit, and manage your important documents.
microsoft office alternative - wps office

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.