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

# removeFromPreferences(completionHandler:)

Remove the filter configuration from the Network Extension preferences.

## Declaration

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

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

## Parameters

- `completionHandler`: A block that takes an doc://com.apple.documentation/documentation/Foundation/NSError object. This block will be executed on the caller’s main thread after the removal operation is complete. If the configuration does not exist in the Network Extension preferences or an error occurs while removing it, the error parameter will be set to an NSError object containing details about the error. See NEFilterManagerError for a list of possible errors. If the configuration is removed successfully the error parameter will be set to nil.

## Discussion

Discussion After the configuration is removed from the preferences the NEFilterManager object will still contain the configuration parameters. Calling loadFromPreferencesWithCompletionHandler: will clear out the configuration parameters from the NEFilterManager object.

## See Also

### Managing the filter configuration

- [shared()](networkextension/nefiltermanager/shared().md)
- [loadFromPreferences(completionHandler:)](networkextension/nefiltermanager/loadfrompreferences(completionhandler:).md)
- [saveToPreferences(completionHandler:)](networkextension/nefiltermanager/savetopreferences(completionhandler:).md)
