The Protection History page in the Windows Security app is where you can go to view recommendations and actions that Microsoft Defender Antivirus has taken on your behalf, Potentially Unwanted Apps that have been removed, or key services (ex: SmartScreen) that are turned off.
Protection History only retains events for 15 days by default, after which they will automatically be cleared from history.
You can change the number of days to keep items in the scan history folder. After this time, Microsoft Defender removes the items. If you specify a value of zero, Microsoft Defender does not remove items.
This tutorial will show you how to change how many days to automatically clear Windows Security protection history in Windows 10 and Windows 11.
EXAMPLE: Windows Security Protection History
Open Windows Terminal, and select Windows PowerShell.
Copy and paste the command below into PowerShell, and press Enter. (see screenshot below)
Get-MpPreference | Select-Object -Property ScanPurgeItemsAfterDelay
You will now see how many days (ex: "15") is currently set for the ScanPurgeItemsAfterDelay.
You must be signed in as an administrator to use this option.
Open Windows Terminal (Admin), and select Windows PowerShell.
Type the command below into PowerShell, and press Enter. (see screenshot below)
Set-MpPreference -ScanPurgeItemsAfterDelay <days>
Substitute <days> in the command above with how many days you want to clear protection history after.
0 days = Protection history does not get automatically cleared.
15 days = Default.
Set-MpPreference -ScanPurgeItemsAfterDelay 15
You can now close Windows Terminal (Admin) if you like.