# PERSIST

> Remove a key's time to live so it no longer expires.

URL: https://docs.hotkv.com/commands/persist/

```
PERSIST key
```

- Group: Keys
- Complexity: O(1)
- HotKV Cloud: all plans
- On-Premise: no license needed

`PERSIST` removes the time to live from `key`, so it stays until it is
deleted or overwritten.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| The time to live was removed | Integer `1` | Integer `1` |
| The key does not exist or has no time to live | Integer `0` | Integer `0` |

## Examples

```
127.0.0.1:6379> SET draft "text" EX 600
OK
127.0.0.1:6379> PERSIST draft
(integer) 1
127.0.0.1:6379> TTL draft
(integer) -1
127.0.0.1:6379> PERSIST draft
(integer) 0
```

## Compatibility

Same as Redis 7 and Valkey 8.

## See also

[EXPIRE](https://docs.hotkv.com/commands/expire/index.md), [TTL](https://docs.hotkv.com/commands/ttl/index.md),
[GETEX](https://docs.hotkv.com/commands/getex/index.md)