{
  "schema_version": 2,
  "id": "commands/bless-clear",
  "title": "BLESS CLEAR",
  "url": "https://redis.io/docs/latest/commands/bless-clear/",
  "summary": "Removes protection flags from a key.",
  "since": "8.12.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-11-23T06:19:08-08:00",
  "page_type": "content",
  "content_hash": "50e591a5cd9b3d70d552db810b0228462984c69d81b36ba525f093e6944fba44",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "`BLESS CLEAR` removes a protection flag from a key, making it eligible again for eviction. The key must already exist."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary>\n\nThe name of the key to unprotect. The key must already exist, or the command returns an error.\n\n</details>\n\n<details open><summary><code>NO-EVICT</code></summary>\n\nThe protection flag to remove. `NO-EVICT` is currently the only supported flag.\n\n</details>"
    },
    {
      "id": "details",
      "title": "Details",
      "role": "content",
      "text": ""
    },
    {
      "id": "behavior",
      "title": "Behavior",
      "role": "content",
      "text": "- `BLESS CLEAR` is idempotent: it returns `1` the first time the flag is removed from a key, and `0` on later calls if the key didn't carry that flag.\n- Unlike [`BLESS SET`](https://redis.io/docs/latest/commands/bless-set), `BLESS CLEAR` isn't blocked when the server is out of memory, so protection can always be removed to free up eviction candidates.\n- `BLESS CLEAR` generates an `unbless` [keyspace notification](https://redis.io/docs/latest/develop/pubsub/keyspace-notifications) event.\n- Clearing the flag persists across restarts and replicates like any other write."
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> BLESS SET session:42 NO-EVICT\n(integer) 1\nredis> BLESS CLEAR session:42 NO-EVICT\n(integer) 1\nredis> BLESS CLEAR session:42 NO-EVICT\n(integer) 0\nredis> BLESS CLEAR missing-key NO-EVICT\n(error) ERR no such key"
    },
    {
      "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=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> | <span title=\"Not supported\">&#x274c; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nOne of the following:\n* [Integer reply](https://redis.io/docs/latest/develop/reference/protocol-spec#integers): `1` if the flag was removed, `0` if the key didn't have it.\n* [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) if the key doesn't exist.\n\n**RESP3:**\n\nOne of the following:\n* [Integer reply](https://redis.io/docs/latest/develop/reference/protocol-spec#integers): `1` if the flag was removed, `0` if the key didn't have it.\n* [Simple error reply](https://redis.io/docs/latest/develop/reference/protocol-spec#simple-errors) if the key doesn't exist."
    },
    {
      "id": "see-also",
      "title": "See also",
      "role": "related",
      "text": "[`BLESS SET`](https://redis.io/docs/latest/commands/bless-set) | [`BLESS GET`](https://redis.io/docs/latest/commands/bless-get) | [`BLESS SCAN`](https://redis.io/docs/latest/commands/bless-scan)"
    },
    {
      "id": "related-topics",
      "title": "Related topics",
      "role": "related",
      "text": "- [Key eviction](https://redis.io/docs/latest/develop/reference/eviction)"
    }
  ],
  "examples": []
}
