How to Remove Deleted SharePoint Documents from PnP Search Results
Question details
The user needs to stop deleted SharePoint documents from showing up as stale entries in PnP Search v3 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 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.
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.
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.
Locate the Query template box. Add the following condition to your existing query: `Title <> "Deleted*"`.
Save your changes and republish the page. Perform a search to confirm that the stale deleted documents no longer appear.

Adjust the Search Scope Settings
Modifying the search scope can bypass the caching bug that frequently occurs when PnP Search v3 is scoped strictly to a document library.
Force Cache Clearance and Re-add Web Part
Attempt to clear local caches and refresh the web part to force it to pull updated indexing data.
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. Download the Software: Visit the official WPS Office website and download the free installation package for your operating system.
- 2. Install and Launch: Run the installer and follow the quick on-screen instructions to set up the software.
- 3. Open Your Documents: Launch WPS Office and open your existing .docx, .xlsx, or .pptx files seamlessly.

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.




