logo
search
SharePoint Document Issues

How to Remove Deleted SharePoint Documents from PnP Search Results

Tauseeq MagsiTauseeq Magsi Oct 10, 2026 869 views

Question details

The user needs to stop deleted SharePoint documents from showing up as stale entries in PnP Search v3 results.

How to Remove Deleted SharePoint Documents from PnP Search Results
Product
SharePoint PnP Search
Device & OS
not provided
Scenario
Searching for documents using the PnP Search v3 Web Part after files have already been removed from a document library and recycle bins.
Observed behavior
Deleted documents continue to appear in search results because reindexing and cache clearance do not immediately remove the stale search entries.
Before you start

Before attempting to fix stale search results, verify that the files have been completely and permanently deleted from both the first-stage and second-stage SharePoint recycle bins.

Solution 1Recommended

Use a Query Exclusion Workaround

Filter out stale search entries by modifying the search query to actively exclude items labeled as deleted.

In many SharePoint environments, deleted items that linger in the search index are temporarily appended with a 'Deleted:' prefix. You can adjust your PnP Search Web Part query to hide these items until the index catches up.

1
Edit the Web Part

Navigate to your SharePoint page, click 'Edit' in the top right corner, and select the PnP Search Results Web Part to open the property pane.

2
Modify the Search Query

Locate the Query template box. Add the following condition to your existing query: `Title <> "Deleted*"`.

3
Publish and Verify

Save your changes and republish the page. Perform a search to confirm that the stale deleted documents no longer appear.

Use a Query Exclusion Workaround
Prefix Requirement: This workaround is highly effective as long as the deleted files in your specific SharePoint environment inherit the 'Deleted:' prefix in their title.
Free Microsoft Office alternative

Experience Seamless Document Management with WPS Office

If managing complex SharePoint libraries and troubleshooting search index delays is slowing down your workflow, consider WPS Office. It provides a lightweight, fast, and highly compatible suite for all your document needs without the hassle of delayed syncs or complex web parts.

  1. 1. Download the Software: Visit the official WPS Office website and download the free installation package for your operating system.
  2. 2. Install and Launch: Run the installer and follow the quick on-screen instructions to set up the software.
  3. 3. Open Your Documents: Launch WPS Office and open your existing .docx, .xlsx, or .pptx files seamlessly.
100% compatible with Microsoft Word, Excel, and PowerPoint formats.Lightweight software with fast loading times and no complex indexing bugs.Built-in cloud storage for simple, reliable document sharing and collaboration.Familiar, user-friendly interface that requires no learning curve to master.
microsoft office alternative - wps office

Frequently Asked Questions

Why do deleted files still appear in SharePoint search results?

SharePoint search relies on an index that updates on a specific crawl schedule. It can take time for the server's index crawler to recognize deletions, resulting in stale files appearing temporarily.

Does manually reindexing a document library fix stale search results immediately?

No. Requesting a reindex simply queues the document library for the next available crawl. Depending on server load and your organization's settings, it may still take up to 24 hours to update.

Why does PnP Search v3 show deleted items when v4 does not?

Different versions of the PnP Search Web Part handle querying and caching differently. V3, particularly when scoped strictly to specific document libraries, is known to experience a caching bug that delays the removal of deleted items compared to v4.