← Back to Blog

Privacy & Security | Published Oct 13, 2026 | 6 min read

How to Automatically Clear Clipboard History on Windows

By Mohit Sehrawat

How to Automatically Clear Clipboard History on Windows — Edge Drop Guide

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

EventWhat's removedWhat stays
The PC restartsAll unpinned itemsPinned items
You copy past the 25-item limitThe oldest unpinned itemPinned items and the newest entries
You select Clear all in Win+VUnpinned itemsPinned items
Settings > System > Clipboard > Clear clipboard data > ClearEverything on the device and in the cloudPinned 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

  1. In File Explorer, create a folder named Scripts in your user folder (C:\Users\<you>\Scripts).
  2. 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"
  1. Save it as Clear-ClipboardHistory.ps1 in the Scripts folder. 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

  1. Copy two or three short bits of text so Win+V has something in it.
  2. 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"
  1. Press Win+V. Only pinned items should be left.
  2. Open %LOCALAPPDATA%\clear-clipboard.log in Notepad. The last line should end in True.

-ExecutionPolicy Bypass applies only to that one PowerShell process; it doesn't change your system's execution policy.

Step 3: Create the scheduled task

  1. Open Start, type Task Scheduler and open it.
  2. In the Actions pane, select Create Basic Task.
  3. Name it, for example Clear clipboard history, and select Next.
  4. Choose Daily, set a time (the end of your working day works well), and select Next.
  5. Choose Start a program and select Next.
  6. In Program/script, enter powershell.exe.
  7. In Add arguments (optional), enter:
-NoProfile -NonInteractive -ExecutionPolicy Bypass -WindowStyle Hidden -File "C:\Users\<you>\Scripts\Clear-ClipboardHistory.ps1"
  1. 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

  1. In Task Scheduler Library, right-click your task and select Properties.
  2. On the Triggers tab, select the trigger and choose Edit.
  3. Under Advanced settings, tick Repeat task every, choose 1 hour, and set for a duration of to Indefinitely.
  4. 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 ClearHistory also 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. Use powershell.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 wantBest option
Win+V emptied every evening or every hourScheduled ClearHistory task
Passwords gone from Ctrl+V seconds after you pastePassword manager clipboard timer
History that expires item by item after hours or daysClipboard manager with auto-delete
No history kept at allTurn 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

Sources

Mohit Sehrawat
Written by Mohit Sehrawat · Author & Testing Contributor

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 · LinkedIn

Copy. 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
Find us on CodeHype