Delete Files by Extension from a SharePoint Online Library
Question details
Find and remove files with a specific extension from a SharePoint Online document library without opening each folder.

- 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.
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.
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.
Open the SharePoint Online document library in your browser and select Sync. Allow the browser to open OneDrive, and sign in if prompted.
Wait for OneDrive to finish syncing the library, then open its folder in File Explorer on Windows or Finder on macOS.
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.
Check the matching filenames and folder locations, select only the files you want to remove, and choose Delete or Move to Trash.
Check the OneDrive sync status, then return to the SharePoint library in your browser and verify that the selected files have been removed.

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.

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.




