SharePoint Document Issues

Delete Files by Extension from a SharePoint Online Library

Natalie TaylorNatalie Taylor Nov 20, 2026 869 views

Question details

Find and remove files with a specific extension from a SharePoint Online document library without opening each folder.

Delete Files by Extension from a SharePoint Online Library
Product
SharePoint Online and OneDrive sync client
Device & OS
not provided
Scenario
A document library contains many folders and subfolders, and the user wants to delete all matching files.
Observed behavior
Files with the selected extension are identified across the library and removed from SharePoint through synchronization.
Before you start

Confirm that you have permission to delete the target files and that the OneDrive sync client is installed and signed in. Identify the exact extension you want to remove, such as .pdf, and check whether the library contains any matching files you need to keep.

Solution 1Recommended

Sync the SharePoint library and delete matching files

Use the OneDrive sync client and your computer's file search to find matching files across the library's folders.

1
Sync the library

Open the SharePoint Online document library in your browser and select Sync. Allow the browser to open OneDrive, and sign in if prompted.

2
Open the synced folder

Wait for OneDrive to finish syncing the library, then open its folder in File Explorer on Windows or Finder on macOS.

3
Search for the extension

Search within the synced library folder. In File Explorer, enter a pattern such as *.pdf in the search box. In Finder, search for files whose Name ends with .pdf and scope the search to the library folder.

4
Review and delete the results

Check the matching filenames and folder locations, select only the files you want to remove, and choose Delete or Move to Trash.

5
Confirm synchronization

Check the OneDrive sync status, then return to the SharePoint library in your browser and verify that the selected files have been removed.

Sync the SharePoint library and delete matching files
Deletion affects SharePoint: Deleting files from a synced library removes them from SharePoint after synchronization. If you delete a file by mistake, check the SharePoint site Recycle Bin.
Free Microsoft Office alternative

Review Office Documents with WPS Office

WPS Office is a free, lightweight alternative for opening and editing Office documents with a familiar interface. It supports a smooth move between compatible file formats, though it does not perform the SharePoint bulk deletion described above.

Review compatible documents in a locally synced SharePoint library before deleting files.Open and edit Microsoft Office formats, including DOCX, XLSX, and PPTX.Use a familiar interface for everyday document, spreadsheet, and presentation work.Work with a free, lightweight Office alternative.
microsoft office alternative - wps office

Frequently Asked Questions

Will deleting synced files also delete them from SharePoint?

Yes. Deletions in a synced library folder are sent back to SharePoint when OneDrive synchronizes. Check the OneDrive sync status and the library in your browser to confirm.

How can I search subfolders for a particular extension?

Open the synced library folder and search within it. In Windows File Explorer, enter a pattern such as *.pdf. On macOS, use a Finder search for Name ending in .pdf and select the library folder as the search scope.

Can I restore a file deleted by mistake?

Open the SharePoint site Recycle Bin, find the deleted file, and select Restore if it is still available and you have the necessary access.

What if the Sync button does not work?

Check that the OneDrive sync client is installed and signed in, then select Sync again in the SharePoint library. Also confirm that you have access to the library.