Text messages Required
Stop at the first STOP
Treat STOP and the other standard opt-out words as an instant opt-out for that sender. Answer HELP with who you are and how to reach you.
How to do it
Accept at least STOP, QUIT, END, REVOKE, OPT OUT, CANCEL and UNSUBSCRIBE, in any case and with extra spaces. The FCC lists these as reasonable ways to revoke consent and requires you to honour them within 10 business days. Aim for seconds. Send at most one confirmation of the opt-out, within 5 minutes, with no marketing in it. Add the number to a suppression list your send code reads, because providers often block only their own copy. Accept START or UNSTOP to opt back in. The FCC rule that one STOP covers every message type from you is delayed until 31 January 2027, so check its status before then.
Example
const OPT_OUT_WORDS = new Set(['stop', 'quit', 'end', 'revoke', 'optout', 'cancel', 'unsubscribe', 'stopall']);
export const isOptOut = body => OPT_OUT_WORDS.has(body.trim().toLowerCase().replace(/[\s-]+/g, ''));
app.post('/sms/inbound', verifyProviderSignature, async (req, res) => {
if (isOptOut(req.body.Body)) await db.smsSuppressions.add(req.body.From, req.body.To);
res.sendStatus(204);
});
import re
OPT_OUT_WORDS = {"stop", "quit", "end", "revoke", "optout", "cancel", "unsubscribe", "stopall"}
def is_opt_out(body: str) -> bool:
return re.sub(r"[\s-]+", "", body.strip().lower()) in OPT_OUT_WORDS
@app.post("/sms/inbound")
def inbound_sms():
verify_provider_signature(request)
if is_opt_out(request.form["Body"]):
db.sms_suppressions.add(request.form["From"], request.form["To"])
return "", 204
How to check
Text "stop " and "Opt out" from a test phone. Each gets one confirmation within 5 minutes, and a send to that number is refused by your code. Text HELP and the answer names the brand and a support address.
For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers notifications playbook: https://agentwranglers.se/playbook/notifications/text-messages/sms-stop-keywords.