---
title: "removeData(ofTypes:for:completionHandler:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/wkwebsitedatastore/removedata(oftypes:for:completionhandler:)"
---

# removeData(ofTypes:for:completionHandler:)

Removes the specified types of website data from one or more data records.

## Declaration

```swift
func removeData(ofTypes dataTypes: Set<String>, for dataRecords: [WKWebsiteDataRecord], completionHandler: @escaping @MainActor @Sendable () -> Void)
```

```swift
func removeData(ofTypes dataTypes: Set<String>, for dataRecords: [WKWebsiteDataRecord]) async
```

## Parameters

- `dataTypes`: The website data types to remove from the records.
- `dataRecords`: The records that contain the data.
- `completionHandler`: The completion handler block to execute asynchronously after the web view removes the specified data. This block has no return value and takes no parameters.

## See Also

### Removing specific types of data

- [removeData(ofTypes:modifiedSince:completionHandler:)](webkit/wkwebsitedatastore/removedata(oftypes:modifiedsince:completionhandler:).md)
