/

How to Enable or Disable Clear Browsing Data When Microsoft Edge Closes in Windows 11

by Francis Sevilleja, IT Technical Writer
How to Enable or Disable Clear Browsing Data When Microsoft Edge Closes in Windows 11 blog banner image
How to Enable or Disable Clear Browsing Data When Microsoft Edge Closes in Windows 11 blog banner image

Try our #1 rated endpoint management platform on G2

NinjaOne dashboard screenshot

Automate the Hardest Parts of IT

Key Points

  • Turn on or off the toggles under Choose what to clear every time you close the browser in Microsoft Edge settings to manage browsing data for your current profile.
  • Set the ClearBrowsingDataOnExit registry value to 1 or 0 to clear or keep browsing data for every user on the device, including Windows 11 Home.
  • Set the Clear browsing data when Microsoft Edge closes policy to Enabled or Disabled in the Local Group Policy Editor to enforce and lock the behavior on Windows 11 Pro, Enterprise, and Education.
  • Expect Edge to delete all browsing data at close when the policy is enabled, so do not combine it with the history or cache deletion policies.
  • Restart Edge after changing a policy, then open edge://policy to confirm Edge applies it.

Have you ever closed Microsoft Edge after finishing a task, expecting data persistence on your next session, only to find out that all your browsing history and cookies are gone? Although this setting can be seen as a nuisance for workflows that reuse login and session data, it’s essential for enforcing data hygiene on shared systems or public devices, such as library kiosks.

You can automatically clear browsing data when Microsoft Edge closes by setting which data to delete. This is one of the key privacy features of Microsoft Edge, alongside with others such as tracking prevention, private browsing, and DNS encryption.

This guide will walk you through several methods for automatically clearing browsing data when you close Microsoft Edge. We’ll also look into other considerations when implementing this as an enterprise-level change to help match end-user browsing session privacy with your organization’s compliance requirements.

For a visual version of this guide, watch How to Enable or Disable Clear Browsing Data When Microsoft Edge Closes in Windows 11

Methods to automatically clear browsing data when closing Edge

Before proceeding to configure which browser data to clear in Edge, ensure that you have the following prerequisites for a smooth and consistent implementation or deployment:

  1. Administrator privileges. End users can set which browsing data is cleared directly within Microsoft Edge without needing elevated permissions. However, you’ll need access to an administrator account when making device-level changes via Group Policy and Registry Editor.
  2. Microsoft Edge installation. Ensure you have the appropriate Microsoft Edge version installed on your system. To verify if you have the correct Chromium-based version installed, launch Microsoft Edge, click the three-dot menu in the upper-right corner, click Help and Feedback > About Microsoft Edge, and then check if your version is 79 or higher. For example, version 136.0.3240.92 is higher than 79, implying that this Edge version is Chromium-based.
  3. Group Policy. If you want to use Group Policy to implement your preferred browsing data behavior, you’ll need at least Windows 11 Pro, Enterprise, or Education editions.
  4. Edge ADMX templates. You’ll need the proper Edge ADMX policy files to configure this setting via Local Group Policy Editor.

If you don’t have the proper files, here’s how you get them:

    • Open the Microsoft Edge for Business download page.
    • Scroll down and input the correct channel/version, build, and platform that reflects your installed Microsoft Edge.
    • Press Get policy files, wait for the download to finish, and extract the files.
    • Copy msedge.admx to C:\Windows\PolicyDefinitions\ and the msedge.adml file to the C:\Windows\PolicyDefinitions\en-US.
    • Verify by opening the Local Group Policy Editor and going to Computer Configuration > Administrative Templates > Microsoft Edge.
    • If you can do this, you have successfully installed the proper admx files.

Method 1: Enable or disable via Microsoft Edge Settings

This method is best suited for managing personal browsing data, as it only affects your user profile. Since the changes using this method are stored in the user’s profile folder, the setting will only apply to your Edge profile and will not carry over to other users on the same system

  1. Click the Windows Search Bar, type Microsoft Edge, and press Enter.
  2. In the upper-right corner, press the three-dot menu and click Settings.
  3. Edge Browser Click three-dot menu and settingsOn the left pane, choose Privacy, search, and services, and then select Clear browsing data on the right.
  4. Click Choose what to clear every time you close the browser.
  5. Toggle on or off which browser data to clear each time you close Microsoft Edge.Toggle on or off which browser data to clear each time you close Microsoft Edge
  6. Once you’re done configuring, close Microsoft Edge.

Method 2: Set which Edge browsing data to clear on close via Registry Editor

This method is ideal for implementing system-wide changes that apply to all users. Additionally, it’s ideal to use the Registry Editor to configure Microsoft Edge’s browsing data in Windows 11 Home since this version doesn’t have access to the Local Group Policy Editor.

Caution: Making wrong changes to the Registry can break system functionality, so before proceeding, it’s recommended that you first back up your Windows Registry settings for easy rollback in case things go wrong.

  1. Press Win + R, type regedit in the dialog box, and press Ctrl + Shift + Enter.
  2. Navigate to the following path: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge
    If the key doesn’t exist, right-click Microsoft, select New > Key, and then name it Edge.
  3. Double-click the ClearBrowsingDataOnExit DWORD if it exists inside the Edge key.
    • If the DWORD doesn’t exist, right-click Edge and select New > DWORD (32-bit) value.
    • Name it ClearBrowsingDataOnExit.
  4. Set the DWORD’s value data according to the browsing data behavior you want:
    • Value = 1; Automatically clears browsing data upon closing Microsoft Edge.
    • Value = 0; Allows data to persist even after closing Microsoft Edge.
  5. Press OK to set the DWORD’s value,  then close all Microsoft Edge windows and reopen the browser

Method 3: Enforce browsing data clearing on close via Local Group Policy Editor

Thanks to its inclusion of Edge-specific Windows Administrative Template files (ADMX), it’s safer to modify which browsing data to clear upon closing Microsoft Edge via the Local Group Policy Editor. Additionally, it provides administrators with a way to enforce and lock the settings via Group Policy, preventing users from overriding them in Microsoft Edge.

  1. Press Win + R, type gpedit.msc, and simultaneously press Ctrl + Shift + Enter.
  2. Navigate the following path:
    Computer Configuration > Administrative Templates > Microsoft Edge
    Note: You’ll need the appropriate Microsoft Edge ADMX templates to access the policies outlined below.
  3. Inside Microsoft Edge, find the Clear browsing data when Microsoft Edge closes policy.
  4. Double-click Clear browsing data when Microsoft Edge closes and set it to match the behavior you want:
    • Set it to Enabled to delete all browsing data each time Microsoft Edge closes.
    • To undo this change, set the policy to Disabled or Not Configured
      Note: Do not configure Enable deleting browser and download history or Clear cached images and files when Microsoft Edge closes together with this policy. When combined, Edge deletes all browsing data on close, regardless of how those two policies are set.
  5. Once done, press Apply and then OK.
    • Alternatively, you can open an elevated PowerShell and run the following command: gpupdate /force
    • The command above expedites the policy application process, eliminating the need to wait for the GPE’s usual automatic refresh cycle.
  6. Restart Microsoft Edge to ensure the policy applies properly.

Quick tip: The steps above configure a single local machine. If your computers are joined to a domain, use the Group Policy Management Console (GPMC) to deploy the same setting as a Group Policy Object (GPO) linked to an Organizational Unit (OU). Copy the Edge ADMX files to the domain Central Store first, so the Edge policies appear in the GPO editor

Keep cookies or passwords when Edge clears data

When the clear-on-close policy is enabled, use these policies to exclude specific data from deletion.

PolicyWhat it doesLocationRequirements
Save cookies when Microsoft Edge closes (SaveCookiesOnExit)Keeps cookies for the sites you list, using URL patternsComputer Configuration > Administrative Templates > Microsoft EdgeEdge 86 or later. Effective when the clear-on-close policy is enabled, the cookies toggle is on in Edge settings, or Configure cookies is set to keep cookies for the session
Prevent passwords from being deleted if any Edge settings areis enabled to delete browsing data when Microsoft Edge closes (PasswordDeleteOnBrowserCloseEnabled)Keeps passwords saved in Edge Password ManagerComputer Configuration > Administrative Templates > Microsoft Edge > Password manager and protectionEdge 117 or later. Effective when the clear-on-close policy is enabled. Does not apply to profiles signed in with a Microsoft account

The “Clear browsing data when Microsoft Edge closes” policy deletes all browsing data when Microsoft Edge closes. To keep cookies or saved passwords, use the exclusion policies in the table above. If you need to clear only certain data types, leave the policy unconfigured and let users choose their own toggles in Edge settings, as described in Method 1.

Additional considerations for enterprise-level deployments

User-level control

When managing an environment that requires specific browsing data policies to maintain privacy and security, endpoints must handle browsing data consistently. When you enable the policy through Group Policy, the toggles in Edge settings are locked, preventing users from overriding the organization’s browsing data policy

Kiosk and shared devices

In environments like shared devices and kiosks, it’s a given that multiple users will use the same device, exposing their personal information if no data-clearing policy is enabled. To help protect user information, shared devices and public kiosks should have all browsing data removed after every session.

Use of roaming profiles

Some environments allow for the use of roaming profiles, allowing their end user’s preferred settings to persist on every session within domain-controlled devices. Instead of enforcing browser data purging on a system level, administrators can allow end users to manage their browsing data.

Improve data privacy by clearing browser data when closing Edge

By managing how Microsoft Edge handles browser data when it closes, administrators can help organizations balance data privacy and compliance within their environment. Additionally, this setting can be customized per user to match their workflow needs, providing greater flexibility when managing browsing data.

Configuring this setting in Edge settings applies to the current Edge profile only and does not carry over to other user accounts on the device. To apply your browser data management configurations at the device level, you can utilize the Registry Editor, especially when you want to deploy this method as a script for non-GPO environments.

The best method for enforcing and locking this setting for users is to leverage the Local Group Policy Editor, which can be deployed as a GPO for a domain-controlled environment. When applied as a GPO, it ensures these settings are applied consistently across all devices and user accounts within a domain.

Related topics:

 

FAQs

Edge can keep running in the background after you close the window, so try turning off Startup boost and “Continue running background extensions and apps when Microsoft Edge is closed” under Settings > System and performance. If you applied the setting through a policy, fully close and reopen Edge, because Microsoft says the policy takes effect only after a browser restart. 

Yes, deleting cookies and other site data each time Edge closes signs you out of most sites. To stay signed in, leave the Cookies and other site data toggle off, or keep cookies for specific sites with the SaveCookiesOnExit policy on managed devices.

Open Settings > Privacy, search, and services > Clear browsing data > Choose what to clear every time you close the browser, and turn on only Cached images and files. Administrators can use the ClearCachedImagesAndFilesOnExit policy for the same result, but should not enable it alongside the main clear-on-close policy, because Microsoft says that combination deletes all browsing data. 

No, because clearing download history deletes only the list of downloads, not the files themselves. Your files stay in their saved location until you delete them separately.

Microsoft supports the “Clear browsing data when Microsoft Edge closes” policy on Windows and macOS starting with Edge 78. It is not supported on Android or iOS so that, so it won’t apply to Edge on those devices.

Not completely, because it removes only the data Edge stores on your device, data kept in the cloud through sync or personalization is deleted separately on the Microsoft privacy dashboard, and websites, your network, or device administrators keep their own records.

You might also like

Ready to simplify the hardest parts of IT?