Remove a SharePoint shortcut from OneDrive
Why SharePoint library shortcuts appear, removing them in bulk with Microsoft Graph, stopping policy-deployed ones from returning, and what it means for Teams and sync.
On this page
- What we'll cover
- Where SharePoint shortcuts come from
- Shortcut, sync, or Teams: which one is this
- Removing many shortcuts with Microsoft Graph
- Why some shortcuts come back
- Auditing what exists across a tenant
- Shortcut or sync: choosing per library
- Keeping shortcuts tidy over time
- Frequently asked questions
- Related reading
SharePoint shortcuts accumulate. Someone adds a library for a project, another for a committee, a third because a colleague sent a link, and eighteen months later a OneDrive holds thirty entries of which four are in use. Removing one is a single menu click, covered in how to remove a shortcut from OneDrive.
This page is about the harder version: why these shortcuts appear in the first place, how to clear them in bulk across accounts, why some of them come back, and how the whole thing interacts with Teams and with library sync.
What we'll cover
Where SharePoint shortcuts come from
Four routes create them, and knowing which one applies determines whether removal sticks.
Someone clicked Add shortcut to My files. The ordinary case, in a SharePoint library or a Teams channel's Files tab. The shortcut belongs to that person's OneDrive and they can remove it whenever they like.
A colleague shared a folder and it was added. Shared folders can be added to your own OneDrive as shortcuts, which is why entries appear that you have no memory of creating.
Administrative policy deployed it. Organizations can push shortcuts to specific libraries so that every member of a group has the library present. These are the ones that reappear after removal, and no amount of clicking will change that.
Migration from synced libraries. Microsoft has moved users from the older sync model toward shortcuts, and that transition converted synced libraries into shortcuts in many tenants. A OneDrive full of shortcuts nobody added is often the fingerprint of this.
The distinction that matters for cleanup is between the first two, which a person owns and can remove, and the third, which requires an administrator.
Shortcut, sync, or Teams: which one is this
Three mechanisms put SharePoint content in front of you, and they are removed in entirely different ways. Acting on the wrong assumption is what produces the "I removed it and it is still there" experience.
A shortcut sits inside your OneDrive with a link badge, stores nothing locally, and offers Remove shortcut on right-click.
A synced library appears as its own top-level entry under your organization's name in File Explorer, downloads content to your machine, and is removed through OneDrive settings under Account, using Stop sync. It has no remove-shortcut option because it is not a shortcut.
Teams access is membership, not a file-system object. It is not removed from OneDrive at all, and leaving the team is the only thing that changes it. Removing a shortcut to a Teams channel folder leaves your Teams access exactly as it was.
A quick way to inventory what you actually have: in OneDrive settings, the Account tab lists synced libraries explicitly. Anything appearing in your files but absent from that list is a shortcut.
Removing many shortcuts with Microsoft Graph
For one account with a handful of shortcuts, the web interface is faster than anything scripted. For dozens of shortcuts, or for the same cleanup across many accounts, Microsoft Graph is the right tool.
Shortcuts appear in the Graph API as driveItems carrying a remoteItem facet, which is what distinguishes them from ordinary folders.
Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes "Files.ReadWrite.All"
$drive = Get-MgUserDefaultDrive -UserId "user@contoso.com"
$items = Get-MgDriveItemChild -DriveId $drive.Id -DriveItemId "root"
$shortcuts = $items | Where-Object { $null -ne $_.RemoteItem }
$shortcuts | Select-Object Name, Id, @{n='Target';e={$_.RemoteItem.WebUrl}}
foreach ($item in $shortcuts) {
Remove-MgDriveItem -DriveId $drive.Id -DriveItemId $item.Id -Confirm:$false
}
Run the listing first and read it before running the removal. The Target column shows where each shortcut points, which is the only practical way to tell the four project libraries apart when they are all called something like "Documents".
Two cautions. Removing the driveItem for a shortcut removes the reference only, exactly as the interface does, so the source libraries are safe. And Files.ReadWrite.All is a broad permission granting access to every file in the tenant, so this should be run by someone entitled to hold it, and ideally revoked afterwards.
Where this needs to run regularly rather than once, it is worth building properly. On CodeWords you describe what should happen in plain language: which accounts to check, which shortcuts qualify for removal, what to leave alone, and where to send the report. Cody, the automation builder, builds it, connects it to Microsoft 365, and deploys it. Automations connect to more than 3,000 integrations. The free plan covers light use, with Pro at $39 per month and Business at $100 per month as usage grows; details are on the pricing page.
Why some shortcuts come back
A shortcut that returns after removal has one of three causes.
Policy is redeploying it. Administrators can configure specific libraries to appear in the OneDrive of everyone in a group. The setting reapplies, so users removing it are fighting a scheduled process they cannot see. Only an administrator changing the policy, or the user leaving the group, stops it.
Group membership triggers it. Joining a Microsoft 365 group or a team can bring associated library shortcuts with it. Removing the shortcut while remaining a member invites it back at the next evaluation.
Another device re-adds it. Shortcuts are account-level rather than device-level, so this is rarer than it appears, but a client in a stale state can resurrect entries. Signing out and back in on every device clears it.
Where the cause is policy, the useful conversation is with whoever administers the tenant rather than with the interface. It is worth having: a OneDrive containing thirty deployed shortcuts is noise for every person in the group, and administrators are frequently unaware of how the accumulated effect looks to users.
Auditing what exists across a tenant
Before removing anything at scale, it helps to know what is actually there. The picture is usually worse than expected and the shape of it determines the cleanup.
Three questions are worth answering with data rather than assumption.
How many shortcuts does a typical account hold? Enumerate a representative sample of accounts and count. Where the median is above about ten, the problem is systemic rather than a few untidy users, and the remedy is policy rather than cleanup.
Which libraries are most commonly pointed at? Group the shortcuts by target. A library appearing in almost every account is either genuinely essential, in which case it should be deployed deliberately rather than by accident, or it was linked in a company-wide message two years ago and copied outward from there.
Which targets no longer exist? Shortcuts to deleted or inaccessible libraries are pure noise, and they are the safest category to remove because nothing is lost. This is the right place to start any cleanup, since it needs no judgement about whether someone is using it.
The Graph listing above, run across a set of users and aggregated, answers all three. Keeping the output is worth doing: comparing a fresh audit against it in six months shows whether the tidying held or whether the accumulation simply resumed.
For the dead-target category specifically, a scheduled job that finds and reports broken shortcuts is a small, safe automation with an obvious payoff. It touches nothing that works, needs no judgement about usage, and stops the pile growing.
Shortcut or sync: choosing per library
Much of the clutter comes from treating this as a habit rather than a decision. The two mechanisms suit different work, and choosing deliberately per library keeps the list short.
A shortcut suits a library you browse rather than work in continuously, anything very large, anything you need from several devices, and anything accessed occasionally. It costs no local storage and needs a connection.
Sync suits a library you work in daily, one you need available on a flight or a poor connection, and content opened in desktop applications that behave better against local files. It costs disk space and takes time to establish.
Neither is right for a library consulted once a quarter. A bookmark in the browser does that job without appearing in your file system at all, and this is the option people forget exists.
The reason this matters for shortcut sprawl is that most accounts holding thirty shortcuts are holding twenty-five things that should have been bookmarks. Saying so when people ask about cleanup is more useful than helping them remove the entries one at a time, because otherwise the list rebuilds itself.
Keeping shortcuts tidy over time
Add them for current work, not for reference. A shortcut is for a library you are in weekly. For something consulted occasionally, a bookmark does the job without cluttering your files.
Review on a cadence. A quarterly look at what is present, removing anything belonging to finished projects, keeps the list usable. This takes about two minutes and nobody ever does it, which is why the list gets to thirty.
Name the source clearly. Shortcuts inherit the library's name, which is how you end up with four entries called "Documents". Renaming the source library to something meaningful helps everybody, and renaming your own shortcut helps you.
Decide deliberately between shortcut and sync. Shortcuts cost no storage and need a connection. Sync costs disk space and works offline. Choosing per library rather than habitually gives a better result than doing one or the other for everything.
For departing staff, clear centrally. Removing shortcuts is part of offboarding that is easy to forget, and the Graph approach above handles it as part of a leaver process.
Frequently asked questions
Does removing a SharePoint shortcut delete the library?
No. The library, its files, its version history, and everyone's access are untouched. You are removing a pointer from your own OneDrive, and the operation is invisible to everyone else.
Can I remove SharePoint shortcuts from the mobile app?
Yes. Find the item, open the three-dot menu, and choose Remove shortcut. The mobile app handles this the same way as the web.
Will it affect my Teams access?
No. Teams access is governed by team membership. The shortcut is only a convenience for reaching the same files through OneDrive, and removing it changes nothing in Teams.
How do I tell a shortcut from a synced library?
Check the Account tab in OneDrive settings, which lists synced libraries explicitly. Anything visible in your files but absent from that list is a shortcut. The right-click menu confirms it: shortcuts offer Remove shortcut, synced libraries do not.
Why is Remove shortcut greyed out?
Usually because the item is a synced library rather than a shortcut, or because policy prevents removal. It can also be a client in a stale state, which restarting OneDrive or using the web interface resolves.
Is there a limit on how many shortcuts I can have?
There are practical limits in the OneDrive client, and long before you reach them the list becomes unusable to navigate. Treating shortcuts as a working set of current libraries rather than an archive of everything you have touched is the approach that scales.
Can an administrator remove shortcuts on a user's behalf?
Yes, through the Graph API with appropriate permissions, which is the approach shown above. Administrators should tell people first, since a shortcut disappearing without explanation reads as something having gone wrong.
Does removing shortcuts improve OneDrive sync performance?
Sometimes, noticeably. Each shortcut is something the client checks, and an account carrying dozens of them, particularly pointing at large or busy libraries, gives the sync engine more to do at startup. Clearing dead and unused ones is a reasonable first step when someone reports OneDrive being slow to settle, and it is safe enough to try before investigating anything more involved, since nothing is lost by removing a shortcut.