You add a file, folder, or process to the Microsoft Defender Antivirus exclusion list in Windows 11. You click OK, reopen the settings, and the entry is gone. This problem prevents critical applications, development tools, or network shares from running without interference from real-time scanning. The root cause is often a corrupted policy setting, a group policy override, or a permissions conflict with the Windows Security app. This article explains why exclusions fail to persist and provides three reliable methods to fix the issue.
Key Takeaways: Fixing Defender Exclusion Not Saving on Windows 11
- Windows Security > Virus & threat protection > Manage settings > Exclusions: The primary UI where exclusions are added and removed
- Group Policy Editor (gpedit.msc) > Computer Configuration > Administrative Templates > Windows Components > Microsoft Defender Antivirus > Exclusions: Overrides local exclusions if configured
- PowerShell (Set-MpPreference -ExclusionPath): Directly writes exclusions to the registry, bypassing UI corruption
Why Windows 11 Defender Exclusions Disappear After Saving
The Microsoft Defender Antivirus exclusion list is stored in the registry under HKLM\SOFTWARE\Microsoft\Windows Defender\Exclusions. When you use the Windows Security app, it writes to this location. However, the app can fail to commit changes due to a corrupted app database, a conflicting Group Policy setting, or insufficient permissions on the registry key. In enterprise environments, IT administrators often use Group Policy to enforce a standard exclusion list. If a local policy or a registry permission prevents write access, the app shows the exclusion as saved but reverts the change on next open. Another common cause is a third-party antivirus that hooks into the Windows Security interface and blocks modifications.
Methods to Fix Defender Exclusion Not Saving on Windows 11
Method 1: Clear the Windows Security App Cache and Reset the App
A corrupted app cache prevents the Windows Security app from writing exclusions. Resetting the app clears the cache and restores default behavior.
- Open Windows Settings
Press Win + I to open Settings. Go to Apps > Installed apps. - Find Windows Security
Scroll to Windows Security in the list. Click the three-dot menu next to it and select Advanced options. - Reset the App
Scroll down to the Reset section. Click Reset and confirm when prompted. Wait for the process to finish. - Restart and Add Exclusion Again
Restart your PC. Open Windows Security, go to Virus & threat protection > Manage settings > Exclusions, and add your exclusion.
Method 2: Add Exclusions Using PowerShell
PowerShell writes exclusions directly to the registry and bypasses the Windows Security app entirely. This method works when the app UI is corrupted or blocked.
- Open PowerShell as Administrator
Press Win + X and select Windows Terminal (Admin). If prompted by User Account Control, click Yes. - Add a File or Folder Exclusion
Run the following command, replacingC:\Path\To\Your\Folderwith your actual path:Add-MpPreference -ExclusionPath "C:\Path\To\Your\Folder"
Press Enter. Repeat for each path you need. - Add a Process Exclusion
To exclude a process by its executable name, run:Add-MpPreference -ExclusionProcess "notepad.exe"
Replacenotepad.exewith your process name. - Add an Extension Exclusion
To exclude all files with a specific extension, run:Add-MpPreference -ExclusionExtension ".tmp"
Replace.tmpwith your extension. - Verify the Exclusions Were Added
RunGet-MpPreferenceand check theExclusionPath,ExclusionProcess, andExclusionExtensionproperties. The paths you added should appear.
Method 3: Check and Remove Group Policy Overrides
If your PC is part of a domain or has local Group Policies configured, those policies can override manual exclusion settings. You must check the local Group Policy Editor for conflicting entries.
- Open Local Group Policy Editor
Press Win + R, typegpedit.msc, and press Enter. If you are on Windows 11 Home, you must enable gpedit first or use the Registry Editor method below. - Navigate to Defender Exclusions Policy
Go to Computer Configuration > Administrative Templates > Windows Components > Microsoft Defender Antivirus > Exclusions. - Check Each Exclusion Policy
Double-click Path Exclusions. If it is set to Enabled, any paths listed here override local exclusions. To remove the override, set it to Not Configured and click OK. Repeat for File Extension Exclusions and Process Exclusions. - Apply the Changes
Close the Group Policy Editor. Open a Command Prompt as administrator and rungpupdate /forceto apply the policy changes immediately. - Add Exclusion Again
Now use Windows Security or PowerShell to add your exclusion. It should persist.
Method 4: Use Registry Editor to Add Exclusions Directly
If Group Policy Editor is not available, you can write exclusions directly to the registry. This method bypasses both the app and group policy.
- Open Registry Editor
Press Win + R, typeregedit, and press Enter. Click Yes when prompted by User Account Control. - Navigate to the Exclusions Key
Go toHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Exclusions. - Add a Path Exclusion
Right-click the Exclusions key, select New > Key, and name it Paths if it does not already exist. Right-click the Paths key, select New > String Value, and name it with a descriptive label likeMyApp. Double-click the new value, set Value data to the full path (e.g.,C:\MyApp), and click OK. - Add an Extension Exclusion
Right-click the Exclusions key, select New > Key, and name it Extensions if it does not exist. Add a new String Value under Extensions with the name.tmpand leave the value data blank. Repeat for each extension. - Add a Process Exclusion
Right-click the Exclusions key, select New > Key, and name it Processes if it does not exist. Add a new String Value under Processes with the namenotepad.exeand leave the value data blank. - Restart Windows Security
Close Registry Editor. Open Task Manager (Ctrl + Shift + Esc), find Windows Security in the list, right-click it, and select End task. Windows Security restarts automatically. - Verify Exclusions
Open Windows Security and check the exclusions list. The entries you added via Registry Editor should now appear.
Common Issues When Defender Exclusions Do Not Save
Exclusions Disappear After Windows Update
A Windows Update can reset the Windows Security app database. After a major update, open Windows Security and check the exclusions list. If entries are missing, re-add them using PowerShell or Registry Editor, which are less likely to be affected by updates.
Third-Party Antivirus Blocks Exclusions
Some third-party antivirus programs disable Windows Defender and replace it with their own protection. In such cases, the Windows Security app may not save exclusions because Defender is inactive. Uninstall the third-party antivirus, restart, and then add exclusions through Windows Security. If you need the third-party software, configure exclusions within its own interface instead.
User Account Control Blocks Write Access
Even when you are an administrator, Windows Security may run with reduced privileges. Always open Windows Security by right-clicking the Start button and selecting Run as administrator. Alternatively, use PowerShell or Registry Editor, which require explicit administrator elevation.
Corrupted User Profile Prevents Saving
A corrupted user profile can cause the Windows Security app to fail when writing settings. Create a new local user account, sign in to that account, and try adding exclusions. If the exclusions save successfully, migrate your data to the new account and delete the old one.
Windows Security App vs PowerShell vs Registry Editor for Adding Exclusions
| Item | Windows Security App | PowerShell | Registry Editor |
|---|---|---|---|
| Ease of Use | Graphical, intuitive | Command-line, requires syntax knowledge | Manual navigation, risk of errors |
| Persistence of Changes | Can fail due to UI corruption | Writes directly to registry, highly reliable | Direct registry write, most reliable |
| Bypasses Group Policy | No, blocked by policy | Yes, unless policy is enforced | Yes, unless policy is enforced |
| Requires Admin Rights | Yes | Yes | Yes |
| Best For | Quick one-time exclusions | Bulk additions and scripting | When UI and PowerShell fail |
After applying one of the methods above, you can now add and save exclusions in Windows 11 Defender without them disappearing. Test the exclusion by running the file or process that was previously blocked. If you manage multiple PCs, consider deploying exclusions via Group Policy or PowerShell scripts to avoid manual entry errors. For advanced protection, review the Windows Defender event logs under Applications and Services Logs > Microsoft > Windows > Windows Defender > Operational to see why exclusions were removed in the past.