<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKWebsiteDataStore/remove(forIdentifier:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKWebsiteDataStore(cm)removeDataStoreForIdentifier:completionHandler:"
  },
  "title" : "remove(forIdentifier:completionHandler:)"
}
-->

# remove(forIdentifier:completionHandler:)

Removes the data store that matches the identifier you provide.

```
class func remove(forIdentifier identifier: UUID, completionHandler: @escaping @MainActor @Sendable ((any Error)?) -> Void)
```

## Parameters

`identifier`

An identifier that uniquely identifies a data store.

`completionHandler`

A block the system invokes after it removes the data store. This block has no return value, and takes the following parameter:

- error: An error, if the system could not remove the data store.

## Discussion

Call this method to remove the data store for the unique identifier. Release any [`WKWebView`](/documentation/WebKit/WKWebView) instances using the data store before you call this method. If the system cannot complete removal of the data store, this throws an error.

---

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)