<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.9.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/URLCredentialStorage/remove(_:for:options:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSURLCredentialStorage(im)removeCredential:forProtectionSpace:options:"
  },
  "title" : "remove(_:for:options:)"
}
-->

# remove(_:for:options:)

Removes the specified credential from the credential storage for the specified protection space using the given options.

```
func remove(_ credential: URLCredential, for space: URLProtectionSpace, options: [String : Any]? = nil)
```

## Parameters

`credential`

The credential to remove.

`space`

The protection space from which to remove the credential.

`options`

A dictionary containing options to consider when removing the credential.

    For possible keys, see [Dictionary key for credential removal options](/documentation/Foundation/dictionary-key-for-credential-removal-options)    . You should use this when trying to delete a credential that has the [`URLCredential.Persistence.synchronizable`](/documentation/Foundation/URLCredential/Persistence-swift.enum/synchronizable)     policy.
  
  > Note:
  > When credential objects that have a ``doc://com.apple.foundation/documentation/Foundation/URLCredential/Persistence-swift.enum/synchronizable`` policy are removed, the credential will be removed on all devices that contain this credential.

## Discussion

The credential is removed from both persistent and temporary storage.

If you override this method, also override [`remove(_:for:options:task:)`](/documentation/Foundation/URLCredentialStorage/remove(_:for:options:task:)).

---

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)