Not every folder on a computer needs to sync to OneDrive.
For developers and IT teams, folders such as node_modules, build outputs, application caches, PowerShell modules, and IDE configuration folders can contain thousands of local files that don’t need cloud storage.
Microsoft’s OneDrive folder exclusion capability helps admins prevent specific folder names from syncing to OneDrive or SharePoint.
How It Works
Admins can define complete folder names that should remain local.
For example, if node_modules is added to the exclusion policy, newly created folders with that exact name inside a OneDrive-synced location will stay on the device instead of being uploaded.
Important behavior:
- Folder matching is not case-sensitive.
- Complete folder names must be used.
- Wildcards aren’t supported.
- Files inside excluded folders remain local.
Restarting OneDrive may be required after policy changes.
What About Folders Already Synced?
This is an important limitation.
If a folder was already uploaded before the exclusion policy was applied, OneDrive will not automatically remove the existing cloud copy.
So folder exclusion is mainly useful for preventing future synchronization, not cleaning up content already stored in OneDrive.
Why Use Folder Exclusion?
It can help reduce unnecessary synchronization for folders containing:
- Package dependencies
- Temporary files
- Build artifacts
- Application caches
- Machine-specific configuration files
This can be especially useful on developer and technical workstations.
Use It Carefully
Before excluding a folder, make sure it doesn’t contain:
- Business-critical documents
- Compliance or retention data
- Files users expect OneDrive to protect
It’s also better to test exclusions with a small group before deploying them widely.
And remember: if a folder stays local, OneDrive is no longer providing cloud backup for that content.
Final Takeaway
OneDrive folder exclusion gives IT admins more control over what should stay local and what should sync to Microsoft 365.
Used carefully, it can reduce unnecessary sync activity and keep OneDrive focused on important business content.
Original article:
Microsoft OneDrive Exclude specific folders sync guide







