How to Automatically Clear Clipboard History on Windows
Windows has no setting that clears clipboard history (Win+V) on a timer. The only automatic clear is a restart, which removes everything except pinned items. To clear it on a schedule, have Task Scheduler run a short PowerShell script that calls Windows' own ClearHistory function, for example every evening or every hour. If you'd rather not script anything, use a clipboard manager with an auto-delete timer instead of Win+V.
What Windows clears on its own
| Event | What's removed | What stays |
|---|---|---|
| The PC restarts | All unpinned items | Pinned items |
| You copy past the 25-item limit | The oldest unpinned item | Pinned items and the newest entries |
| You select Clear all in Win+V | Unpinned items | Pinned items |
| Settings > System > Clipboard > Clear clipboard data > Clear | Everything on the device and in the cloud | Pinned items |
None of these run on a clock. Sleep isn't a restart, so a laptop that only sleeps can keep the same history for days. How to clear clipboard history on Windows 11 covers the manual options in detail.
Option 1: Clear history on a schedule with Task Scheduler
Windows exposes clipboard history to programs through the Windows.ApplicationModel.DataTransfer.Clipboard class. Its ClearHistory() method clears the history, returns True on success, and, like Clear all, leaves pinned items alone. Microsoft lists it as available from Windows 10 version 1809. Windows PowerShell 5.1, which comes with Windows, can call it directly.
Step 1: Save the script
- In File Explorer, create a folder named
Scriptsin your user folder (C:\Users\<you>\Scripts). - Open Notepad and paste this:
# Clear-ClipboardHistory.ps1
# Run with Windows PowerShell 5.1 (powershell.exe), not PowerShell 7 (pwsh.exe)
$null = [Windows.ApplicationModel.DataTransfer.Clipboard, Windows.ApplicationModel.DataTransfer, ContentType=WindowsRuntime]
# Clear Win+V history. Pinned items are kept. Returns True on success.
$cleared = [Windows.ApplicationModel.DataTransfer.Clipboard]::ClearHistory()
# Also empty the current clipboard, so Ctrl+V has nothing to paste
[Windows.ApplicationModel.DataTransfer.Clipboard]::Clear()
# Log each run so you can check the schedule is working
"$(Get-Date -Format s) ClearHistory returned $cleared" |
Add-Content -Path "$env:LOCALAPPDATA\clear-clipboard.log"
- Save it as
Clear-ClipboardHistory.ps1in theScriptsfolder. In the Save as type box, choose All files so Notepad doesn't add.txt.
The first line loads the Windows Runtime clipboard class, the same way Microsoft's Raymond Chen loads it to read clipboard history from PowerShell. Clear() removes the current clipboard contents. The log file lands in %LOCALAPPDATA%.
Step 2: Test it by hand
- Copy two or three short bits of text so Win+V has something in it.
- Open Windows PowerShell from Start and run (replace
<you>with your user folder name):
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\Users\<you>\Scripts\Clear-ClipboardHistory.ps1"
- Press Win+V. Only pinned items should be left.
- Open
%LOCALAPPDATA%\clear-clipboard.login Notepad. The last line should end inTrue.
-ExecutionPolicy Bypass applies only to that one PowerShell process; it doesn't change your system's execution policy.
Step 3: Create the scheduled task
- Open Start, type Task Scheduler and open it.
- In the Actions pane, select Create Basic Task.
- Name it, for example
Clear clipboard history, and select Next. - Choose Daily, set a time (the end of your working day works well), and select Next.
- Choose Start a program and select Next.
- In Program/script, enter
powershell.exe. - In Add arguments (optional), enter:
-NoProfile -NonInteractive -ExecutionPolicy Bypass -WindowStyle Hidden -File "C:\Users\<you>\Scripts\Clear-ClipboardHistory.ps1"
- Select Next, then Finish.
-File must come last, because PowerShell treats everything after it as the script path and its arguments. -NonInteractive stops the task from ever waiting for input. Even with -WindowStyle Hidden, a PowerShell window may flash briefly when the task runs.
Keep the task running as your own account while you're signed in, which is what the basic wizard sets up. Clipboard history belongs to your Windows account, so don't switch the task to the SYSTEM account.
Run it every hour instead
- In Task Scheduler Library, right-click your task and select Properties.
- On the Triggers tab, select the trigger and choose Edit.
- Under Advanced settings, tick Repeat task every, choose 1 hour, and set for a duration of to Indefinitely.
- Select OK twice.
To test the task straight away, right-click it and select Run, then check the log. To stop it later, right-click the task and select Disable or Delete.
Limits of this approach
- Pinned items are never cleared. That matches Microsoft's documentation for
ClearHistory. Unpin anything sensitive, or remove pins by hand. - It runs only while you're signed in, and a daily task set for a time the PC is asleep or off won't fire at that moment.
- Synced copies: Microsoft doesn't say whether
ClearHistoryalso removes clips already synced to your other devices. If you use Clipboard history across your devices, use Clear clipboard data in Settings for that, or turn sync off. How to disable Windows clipboard cloud sync has the steps. - PowerShell 7 won't run it. Current PowerShell 7 releases run on modern .NET, which dropped built-in Windows Runtime support, so the type line fails in
pwsh.exe. Usepowershell.exe.
Option 2: Let your password manager clear the live clipboard
If passwords are the reason you want an automatic clear, turn on your password manager's clipboard timer: Clear clipboard in Bitwarden, the 90-second removal setting in 1Password, or the auto-clear option in KeePass. These clear the current clipboard (what Ctrl+V pastes), not entries Win+V has already saved. Many password managers also mark their copies so Win+V skips them. How to auto-clear the clipboard after pasting a password has the settings for each one.
Option 3: Use a clipboard manager with an auto-delete timer
Third-party clipboard managers can expire history on a real timer, with no script:
- Ditto (free, open source): Options > General has Paste Entries Expire after a number of days and Maximum Number of Saved Copies. Clips marked Never Auto Delete, clips in a group, clips with a hotkey and sticky clips are kept. Ditto deletes expired clips in the background once the PC has been idle for a while, not at the exact minute they expire.
- Edge Drop (free, open source): Settings > Behaviour > Storage & Retention > Auto-delete timer removes unpinned items after 1h, 6h, 24h or 7d (the default is Never). It checks every 60 seconds while running, when it starts and whenever you copy something. Clear unpinned on restart empties unpinned history each time Edge Drop starts. How to set auto-delete timers in Edge Drop walks through both.
If you switch to a clipboard manager for its timer, consider turning Win+V history off so your copies aren't kept in two places. Can Windows auto-delete clipboard history? compares the timer options across more apps.
Which option to choose
| You want | Best option |
|---|---|
| Win+V emptied every evening or every hour | Scheduled ClearHistory task |
| Passwords gone from Ctrl+V seconds after you paste | Password manager clipboard timer |
| History that expires item by item after hours or days | Clipboard manager with auto-delete |
| No history kept at all | Turn clipboard history off |
FAQ
Can Windows clear clipboard history automatically without a script?
Only on restart. Windows 10 and 11 have no timer setting for Win+V history, and the Allow Clipboard History policy can only turn the feature on or off.
Does the script delete pinned items?
No. ClearHistory leaves pinned items in place, the same as Clear all. Delete pins one by one in Win+V with See more (...) > Delete.
Is it safe to run this script?
It only calls documented Windows clipboard functions and writes one line to a log file in your own profile. Read any script before you run it, including this one.
Related reading
- Can Windows Auto-Delete Clipboard History? (Timer Options)
- How to Auto-Clear the Clipboard After Pasting a Password
- Is Windows Clipboard History Safe?
- End-of-Day Clipboard Cleanup: Clear Win+V and Pins
Sources
- Using the clipboard (Microsoft Support) — 25-item limit, restart behaviour, Clear all, Clear clipboard data, sync.
- Clipboard.ClearHistory method (Microsoft Learn) — clears history, Boolean result, pinned items kept, Windows 10 version 1809.
- Clipboard class (Microsoft Learn) —
Clear()removes all data from the clipboard. - Enumerating Windows clipboard history in PowerShell (The Old New Thing, Microsoft) — loading the WinRT Clipboard class in Windows PowerShell.
- about_PowerShell_exe (Microsoft Learn) —
-Filemust be last,-ExecutionPolicy,-NonInteractive,-WindowStyle. - Use the Windows Task Scheduler to run a Windows PowerShell script (Microsoft Scripting Blog) — Create Basic Task, Start a program, Program/script.
- Built-in support for WinRT is removed from .NET (Microsoft Learn) — why PowerShell 7 can't load the type this way.
- Experience Policy CSP: AllowClipboardHistory (Microsoft Learn) — the policy only allows or blocks clipboard history.
- Auto Delete (Ditto wiki) — Ditto's expiry settings and exceptions.
Mohit Sehrawat helps test Edge Drop, trying features on Windows and reporting bugs. A B.Tech Computer Science Engineering student focused on software testing and product quality, Mohit writes the troubleshooting and privacy guides.
GitHub · LinkedInCopy. Stack. Drop.
Transform your clipboard into an interactive edge shelf. Stack, pin, and drag assets into any app with zero friction.
Download for Windows Get from Microsoft Store
How to Install Guide · First 10 Minutes Guide · Drag & Drop Guide · Edge Drop vs Win+V · Support
Free · Lightweight · Privacy First