{
  "schema_version": 2,
  "id": "commands/unlink",
  "title": "UNLINK",
  "url": "https://redis.io/docs/latest/commands/unlink/",
  "summary": "Asynchronously deletes one or more keys.",
  "since": "4.0.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:48:32+01:00",
  "page_type": "content",
  "content_hash": "68340a90b9533f8772ff83a1fa1c2732e3a62fea887026814a389b15b7c277ff",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "> [!NOTE]\n> This command's behavior varies in clustered Redis environments. See the [multi-key operations](https://redis.io/docs/latest/develop/using-commands/multi-key-operations) page for more information.\n\n\nThis command is very similar to [`DEL`](https://redis.io/docs/latest/commands/del): it removes the specified keys.\nJust like [`DEL`](https://redis.io/docs/latest/commands/del) a key is ignored if it does not exist. However the command\nperforms the actual memory reclaiming in a different thread, so it is not\nblocking, while [`DEL`](https://redis.io/docs/latest/commands/del) is. This is where the command name comes from: the\ncommand just unlinks the keys from the keyspace. The actual removal\nwill happen later asynchronously."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key [key ...]</code></summary>\n\nOne or more keys to delete asynchronously.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> SET key1 \"Hello\"\nOK\nredis> SET key2 \"World\"\nOK\nredis> UNLINK key1 key2 key3\n(integer) 2"
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> | <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Supported\"><nobr>&#x2705; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\n[Integer reply](../../develop/reference/protocol-spec#integers): the number of keys that were unlinked.\n\n**RESP3:**\n\n[Integer reply](../../develop/reference/protocol-spec#integers): the number of keys that were unlinked."
    }
  ],
  "examples": []
}
