When you search for policy documents in SharePoint, draft files that are still being edited can appear in the search results. This happens even when the draft files are stored in a library with versioning enabled and draft security set to restrict access. The root cause is a mismatch between the SharePoint search crawl permissions and the draft item security settings in the document library. This article explains why draft files become visible in search and provides the exact steps to block them from appearing.
Key Takeaways: Block Draft Policy Files from SharePoint Search Results
- Document Library Settings > Versioning Settings > Draft Item Security: Set to “Only users who can edit items” to restrict search indexing of draft files.
- SharePoint admin center > Search > Crawl Rules: Create a rule to exclude the specific library path from being crawled by search.
- Site Collection Search Schema > Managed Properties: Map the crawled property “IsDraft” to a managed property and use query rules to filter drafts out of results.
Why Draft Files Appear in SharePoint Search Results
SharePoint search crawls all content that the crawl account has at least read access to. By default, the search crawl account is a system account that bypasses many security restrictions. When a document library has versioning enabled and draft item security set to “Only users who can edit items” or “Only users who can approve items,” the crawl account still sees the draft files because it has elevated privileges. The search index then stores those files and serves them in results to any user who has read access to the library, even if that user cannot open the draft file directly.
This behavior is by design but often surprises administrators. The draft file itself is not accessible to the end user — clicking the link will show an access denied error. However, the file title, metadata, and snippet are visible in the search result. For policy documents, this exposure can violate internal compliance rules. The fix requires adjusting draft item security, search crawl rules, or both.
Steps to Prevent Draft Files from Appearing in Search
Use the following methods to block draft policy files from SharePoint search results. Apply these steps to each document library that stores draft policies.
Method 1: Change Draft Item Security in the Document Library
- Open the Document Library Settings
Navigate to the document library that contains the draft policy files. Click the gear icon in the top right and select Library settings. - Open Versioning Settings
Under the General Settings section, click Versioning settings. - Set Draft Item Security
Locate the Draft Item Security section. Select the option “Only users who can edit items” or “Only users who can approve items.” The first option is stricter and prevents anyone who cannot edit the library from seeing drafts. Click OK to save. - Request a Full Search Reindex
Go back to the library settings. Under the Permissions and Management section, click Advanced settings. Scroll to the Reindex Document Library section and click Reindex. This forces SharePoint to recrawl the library with the new security settings.
Method 2: Create a Crawl Rule to Exclude the Library Path
- Open the SharePoint Admin Center
Sign in to the Microsoft 365 admin center as a global admin or SharePoint admin. Select SharePoint from the left navigation. In the admin center, expand Search and choose Crawl Rules. - Add a New Crawl Rule
Click Add crawl rule. In the Path field, enter the exact URL of the document library that contains draft policy files. For example:https://yourtenant.sharepoint.com/sites/policy/Shared%20Documents. Use the full path including the library name. Select the option Exclude all items in this path from being crawled. Click OK. - Wait for the Next Crawl or Start a Full Crawl
Crawl rules take effect during the next full crawl. To speed up the process, go to Search > Crawl Log and click Start full crawl. This removes all existing indexed items from the library and prevents future drafts from being indexed.
Method 3: Use Managed Properties and Query Rules to Filter Drafts
- Check the IsDraft Crawled Property
In the SharePoint admin center, go to Search > Managed Properties. Search for a property named “IsDraft” in the crawled properties list. If it does not exist, you need to map a site column. Create a Yes/No site column named “IsDraft” in the library, set it to Yes for draft items, and then run a full crawl. - Map the Crawled Property to a Managed Property
After the crawl, locate the crawled property named IsDraft (ows_IsDraft). Click Add Mapping and map it to a new managed property. Name the managed property IsDraft, set its type to Yes/No, and check the options Queryable and Searchable. Click OK. - Create a Query Rule to Exclude Drafts
Go to Search > Query Rules. Click Add Query Rule. Give the rule a name like “Exclude Draft Policy Files.” Under Query Conditions, select Remove Query Condition to apply the rule to all queries. Under Actions, click Add Action and choose Change ranking by adding a result block. Click Add result block, then click Advanced. In the Query Template box, enter:IsDraft=0. Set the block to show only when the query matches. Click OK twice. - Test the Query Rule
Perform a search for a policy file that exists as a draft. The draft should no longer appear in the results. If it still appears, verify that the managed property is populated and reindex the library.
If Draft Files Still Appear After Applying the Fixes
Even after changing draft item security and creating crawl rules, some draft files may remain visible in search results. This usually happens because the search index has not been fully updated.
Site collection search results still show drafts from other subsites
Crawl rules apply only to the exact path you specify. If draft files are stored in multiple libraries across different subsites, you must create a separate crawl rule for each library path. Alternatively, use a wildcard pattern in the crawl rule path by replacing the library name with an asterisk. For example: https://yourtenant.sharepoint.com/sites/policy/. This excludes all libraries under the policy site from being crawled. Be aware that this also prevents all other documents in those libraries from being indexed.
Draft files appear in search results for users who have edit permissions
If a user has edit permissions on the library, they can see draft files in search results even after you apply draft item security. This is expected behavior. To prevent this, remove edit permissions from users who should not see drafts, or move draft files to a separate library with restricted access.
Search results show old drafts that were previously indexed
The search index retains items until the next full crawl. After applying any fix, run a full crawl from the SharePoint admin center. Go to Search > Crawl Log and click Start full crawl. This removes all stale indexed items, including old drafts that were indexed before the security changes.
| Item | Draft Item Security | Crawl Rule |
|---|---|---|
| Scope | Single document library | Path-based, can cover multiple libraries |
| Effect on search | Hides drafts from non-editors but still indexed | Completely removes library from index |
| User access to drafts | Blocked for non-editors | Unchanged — users with access can still open drafts directly |
| Management overhead | Low — set once per library | Medium — requires crawl rule per path and full recrawl |
| Best for | Libraries with mixed user permissions | Libraries with sensitive drafts that must never appear in search |
After applying the correct combination of draft item security and crawl rules, draft policy files will no longer appear in SharePoint search results. Verify the fix by searching for a known draft file from a user account that has read-only access to the library. If the fix does not work immediately, run a full crawl and wait up to 24 hours for the search index to refresh. For libraries that contain highly sensitive drafts, consider moving them to a separate site collection with its own search scope to further isolate the content.