How to Fix a Locked File That Cannot Be Deleted in SharePoint Online
Question details
The user is unable to delete a file in SharePoint Online because it remains locked by a user or process, even after attempting basic troubleshooting steps.

- Product
- SharePoint Online
- Device & OS
- not provided
- Scenario
- Attempting to delete a file located in a SharePoint document library.
- Observed behavior
- The file deletion is blocked due to a persistent lock, despite clearing caches, changing browsers, checking it in, and verifying user permissions.
Ensure you have the necessary edit or delete permissions for the SharePoint document library. Wait at least 15-30 minutes, as temporary file locks from unexpected app closures often resolve themselves automatically.
Close Open Files and Stop Local Synchronization
A file cannot be deleted if it is actively open in a desktop application or continuously locked by the OneDrive sync client in the background.
Often, a file appears locked on the server because a user's desktop application hasn't fully closed the session, or a local sync client is holding the file open during an active sync cycle.
Ask the user who currently holds the lock on the file to close the document and completely exit the associated Microsoft Office application.
Verify if the SharePoint document library is synchronized to a local computer via the OneDrive sync client.
If the file is synced locally, pause the OneDrive synchronization or remove the local copy of the file if appropriate. This forces the server to release the lock.

Review Sharing Settings and Stop Sharing
Active sharing links or guest access might keep the file in a locked state, preventing its deletion.
Investigate Active Sessions and Admin Policies
If standard troubleshooting fails, backend retention policies, workflows, or stuck server sessions might be the root cause.
Try WPS Office for Seamless Document Management
While resolving locked files in SharePoint requires platform-specific administrative steps, WPS Office provides a free, lightweight, and highly compatible alternative for handling your daily documents. Enjoy robust cloud synchronization without complex server lock issues.

Frequently Asked Questions
How long does a temporary lock last in SharePoint Online?
A temporary lock, often caused by an unexpected application crash or network drop, typically clears on its own within 10 to 30 minutes. In rare cases, it can take up to a few hours for the server to recognize the session has ended.
Can I force unlock a file in SharePoint Online?
You cannot directly 'force unlock' a file with a single button. However, requiring check-out in the library settings, then manually checking the file out and discarding the check-out can sometimes clear a stubborn lock.
Why does the file say it is locked by me when I do not have it open?
This usually happens if your previous session did not close properly, leaving a 'ghost session' on the SharePoint server. It can also occur if your local OneDrive sync client is continuously trying to update or scan the file in the background.




