---
title: "removeFromPreferences(completionHandler:)"
framework: networkextension
role: symbol
role_heading: Instance Method
path: "networkextension/nevpnmanager/removefrompreferences(completionhandler:)"
---

# removeFromPreferences(completionHandler:)

Remove the VPN configuration from the Network Extension preferences.

## Declaration

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

```swift
func removeFromPreferences() async throws
```

## 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

Discussion After the configuration is removed from the preferences the NEVPNManager object will still contain the configuration parameters. Calling loadFromPreferences(completionHandler:): will clear out the configuration parameters from the NEVPNManager object.

## See Also

### Managing VPN configurations

- [shared()](networkextension/nevpnmanager/shared().md)
- [loadFromPreferences(completionHandler:)](networkextension/nevpnmanager/loadfrompreferences(completionhandler:).md)
- [saveToPreferences(completionHandler:)](networkextension/nevpnmanager/savetopreferences(completionhandler:).md)
- [setAuthorization(_:)](networkextension/nevpnmanager/setauthorization(_:).md)
