Skip to main content

Overview

Disappearing messages automatically delete after a set period. You can enable this feature for entire chats or send individual messages that disappear.

Ephemeral Durations

Supported time periods for disappearing messages:
You need to pass in seconds, not milliseconds. The default is 7 days.

WA_DEFAULT_EPHEMERAL Constant

Baileys provides a constant for the default 7-day duration:
Defined in src/Defaults/index.ts:23:

Enable Disappearing Messages in a Chat

Turn on disappearing messages for all future messages in a chat:

Custom Duration

Disable Disappearing Messages

Turn off disappearing messages in a chat:
This only affects future messages. Previously sent disappearing messages will still delete at their scheduled time.

Send Individual Disappearing Messages

Send a single message that will disappear without enabling the feature for the entire chat:

Custom Expiration

Complete Example

Update Default Disappearing Mode

Set a default disappearing message duration for all new chats:
See Privacy Settings for more details on default disappearing mode.

Implementation Details

From src/Utils/messages.ts:465 and src/Utils/messages.ts:717:
  • Disappearing messages can still be saved by recipients through screenshots or forwarding before deletion
  • The timer starts when the message is read, not when it’s sent
  • Media files are deleted from WhatsApp servers when messages expire

Time Conversion Helper