# TAG.REM

> Remove one or more tags from a key.

URL: https://docs.hotkv.com/commands/tag-rem/

```
TAG.REM key tag [tag ...]
```

- Group: Tags
- Complexity: O(n), n being the tags
- HotKV Cloud: all plans
- On-Premise: no license needed

`TAG.REM` detaches the given tags from `key`. Tags the key does not carry are
ignored. The key does not need to exist: the command answers `0` for a key
that has no tags. A key's tags are removed on their own when the key is
removed, so you only need `TAG.REM` to take a tag off a key that stays.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| Always | Integer: the number of tags removed | Integer |

## Examples

```
127.0.0.1:6379> SET article:1 "..."
OK
127.0.0.1:6379> TAG.SET article:1 news sports
(integer) 2
127.0.0.1:6379> TAG.REM article:1 sports weather
(integer) 1
127.0.0.1:6379> TAG.GET article:1
1) "news"
```

## Compatibility

HotKV-only command.

## See also

[TAG.SET](https://docs.hotkv.com/commands/tag-set/index.md), [TAG.GET](https://docs.hotkv.com/commands/tag-get/index.md), [TAG.COUNT](https://docs.hotkv.com/commands/tag-count/index.md)