<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEVPNManager/removeFromPreferences(completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "c:objc(cs)NEVPNManager(im)removeFromPreferencesWithCompletionHandler:"
  },
  "title" : "removeFromPreferences(completionHandler:)"
}
-->

# removeFromPreferences(completionHandler:)

Remove the VPN configuration from the Network Extension preferences.

```
func removeFromPreferences(completionHandler: (@Sendable ((any Error)?) -> Void)? = nil)
```

## Parameters

`completionHandler`

An optional block that takes an <doc://com.apple.documentation/documentation/Foundation/NSError> object. If specified, this block will be executed on the caller’s main thread after the removal operation is complete. If the configuration does not exist or an error occurs while removing it, the error parameter will be set to an `NSError` object containing details about the error. See `NEVPN Errors` for a list of possible errors. If the configuration is removed successfully then the error parameter will be set to nil.

## Discussion

After the configuration is removed from the preferences the `NEVPNManager` object will still contain the configuration parameters. Calling [`loadFromPreferences(completionHandler:)`](/documentation/NetworkExtension/NEVPNManager/loadFromPreferences(completionHandler:)): will clear out the configuration parameters from the `NEVPNManager` object.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)