Every time Microsoft Defender blocks or quarantines something, it logs it in Protection history in the Windows Security app. It is useful, but after reviewing a false alarm or cleaning a PC, that list of old warnings only gets in the way. The app has no button to empty it, so here are two ways on Windows 10 and Windows 11: have Defender purge it sooner, or delete it by hand.
Before you start
- You need an account with administrator rights.
- Clearing the history does not remove threats or restore files: it only removes records. First check nothing is pending under Windows Security > Virus & threat protection > Protection history.
- Quarantined items are separate. To restore or remove any, do it from the history itself before cleaning.
- This guide is for personal PCs. On a work PC the history may be useful to IT; do not delete it without permission.
- Windows 10 support ended on October 14, 2025. Defender still works and the steps are the same, but an unpatched system is more exposed.
Option 1: have Defender purge history sooner (recommended)
Defender already cleans history on its own. Per Microsoft’s documentation, ScanPurgeItemsAfterDelay sets how many days items stay in the scan history folder, 15 days by default. You can lower it.

- Open Terminal (Admin) or Windows PowerShell (Admin) by right-clicking Start.
- Check the current value:
Get-MpPreference | Select-Object ScanPurgeItemsAfterDelay
- Change it, for example, to 1 day:
Set-MpPreference -ScanPurgeItemsAfterDelay 1
From now on Defender removes entries older than one day. Do not use 0: with that value Defender never deletes items.
To have quarantine empty itself too, there is an equivalent parameter. With 0 or unset, items stay quarantined indefinitely:
Set-MpPreference -QuarantinePurgeItemsAfterDelay 30
To return to the history default:
Set-MpPreference -ScanPurgeItemsAfterDelay 15
Option 2: delete history by hand
If you want the list empty now, you can delete the files where Defender stores history:

C:\ProgramData\Microsoft\Windows Defender\Scans\History\Service
- Open File Explorer and paste the path in the address bar.
ProgramDatais hidden but opens if you type the full path. - If Windows says you lack permission, click Continue to access with your administrator account.
- Open the
DetectionHistoryfolder (if present) and delete its contents, not theServicefolder itself. - Restart the PC.
If Windows will not let you delete because the files are in use, the Defender service holds them. That service cannot normally be stopped, even as administrator, because Tamper Protection guards it. The cleanest way is from Safe Mode, where Defender does not load:
- Go to Settings > System > Recovery (Windows 11) or Settings > Update & Security > Recovery (Windows 10) and click Restart now under Advanced startup.
- Choose Troubleshoot > Advanced options > Startup Settings > Restart and press 4 for Safe Mode.
- Delete the folder contents and restart normally.
Do not disable Tamper Protection or real-time protection for this: it is unnecessary and leaving them off by mistake is a risk.
Check it works
Open Windows Security > Virus & threat protection > Protection history. After restarting, the list should be empty or show only later events. With option 1, cleanup is not instant; give it a day and look again.
You can also see the threats Defender knows right now with:
Get-MpThreatDetection
Common problems
Set-MpPreference returns an access error. The console is not elevated. Open it with Run as administrator.
The change does not apply or reverts. A policy may be setting it, typical on managed PCs or ones where an “optimization” tool wrote policies. See the guide about the message “Managed by your organization”.
The Service folder is empty but history still shows entries. The app is slow to refresh. Close it completely, restart and reopen.
“Access denied” even in Safe Mode. Make sure you signed in with an administrator account and are deleting contents, not the folder. A standard account lacks rights on ProgramData\Microsoft\Windows Defender.
You use another antivirus. With third-party antivirus active, Defender steps back and its history is irrelevant. Clean that antivirus’s log from its own app.
Frequently asked questions
Does clearing history speed up the PC? Not noticeably. The files are small; the reason is a clean list.
Are quarantined files deleted too? Not with the history option. Quarantine has its own parameter (QuarantinePurgeItemsAfterDelay) and is best managed from Protection history.
Is it safe? Yes, as long as no threat is pending review and you leave real-time protection alone.



