Those “bad links” are most likely shared links or entries in the Shared view that still point to items that have been deleted or moved. Remove them by removing sharing or deleting the underlying items from OneDrive.
Use these steps:
- Go to OneDrive on the web and open the Shared view.
- Locate the items whose links no longer work.
- If they appear under Shared by you:
- Select the item.
- Select Manage Access.
- If the item was shared via a link, select Anyone with this link... and then Remove link.
- If the item was shared directly with people, under each person select Can Edit or Can View, then choose Remove direct access.
This removes the sharing links so they no longer appear as active shared items.
- If the items were deleted, also check the Recycle bin in OneDrive:
- Select Recycle bin in the left navigation.
- If the deleted items are still there and no longer needed, select them and choose Delete to permanently remove them.
If a link points to content that was renamed, moved, or deleted in SharePoint/OneDrive and shows an error like “Item does not exist,” that is expected behavior when the underlying item is gone. Removing sharing (steps above) and permanently deleting the item (if still in the recycle bin) clears out those obsolete references.
If a file still cannot be deleted, possible causes include lack of permissions, retention labels, or storage limits. In that case, a site collection administrator can investigate and, if necessary, force deletion using SharePoint admin tools.
References: