One-Click Unsubscribe: Headers, Rules and a Builder

One-click unsubscribe lets someone leave your list from the inbox's own Unsubscribe button, with no login or form. You add two headers from RFC 8058: List-Unsubscribe with an HTTPS link, and List-Unsubscribe-Post set to List-Unsubscribe=One-Click. Gmail and Yahoo require it on marketing mail from bulk senders.

Who asks for what (official pages, as of October 2026)
SourceUnsubscribe rule
GmailOne-click unsubscribe on marketing mail for senders of 5,000+ a day; visible link in the body; handle requests within 48 hours (recommended)
YahooFunctioning list-unsubscribe header with one-click (RFC 8058); honor unsubscribes within 2 days
CAN-SPAM (US)Clear way to opt out; honor it within 10 business days; mechanism works for at least 30 days after sending
Transactional mailGmail: one-click not required for transactional messages

Updated

Most email services add these headers for you once you turn on list management, so check there first. If you send from your own app or server, the builder below writes the two header lines, and the examples show the small endpoint that has to answer the inbox's request.

Header builder

Headers to add

List-Unsubscribe: <https://example.com/unsub/8f3a2c91d0>, <mailto:[email protected]?subject=unsubscribe>
List-Unsubscribe-Post: List-Unsubscribe=One-Click

Ready to paste. Remember to include both headers in your DKIM signature.

The endpoint that answers the click

A minimal handler in standard JavaScript (the Request and Response objects used by most modern hosts). It removes on POST and asks for confirmation on GET.

Unsubscribe handler

Replace removeSubscriber with your own database call. The token is the hard-to-guess part of the address.

export async function handle(request, removeSubscriber) {
  const token = new URL(request.url).pathname.split("/").pop();
  if (request.method === "POST") {
    const form = await request.formData();
    if (form.get("List-Unsubscribe") === "One-Click") {
      await removeSubscriber(token);
      return new Response("Unsubscribed", { status: 200 });
    }
    return new Response("Bad request", { status: 400 });
  }
  // GET: a person or a link scanner. Show a button that POSTs.
  return new Response(
    '<form method="post"><input type="hidden" name="List-Unsubscribe" value="One-Click">' +
      '<button>Confirm unsubscribe</button></form>',
    { headers: { "content-type": "text/html" } }
  );
}

What happens when someone clicks

The mail app reads your List-Unsubscribe header and sends an HTTPS POST to that address. The request body is the value of List-Unsubscribe-Post, encoded as a form, so your endpoint receives List-Unsubscribe=One-Click.

Your server finds the subscriber from the token in the address and removes them. Nothing else is sent: no cookies, no login, no extra page.

CAN-SPAM in five lines

The FTC's compliance guide lists the core duties for commercial email: truthful From, To and routing details, a subject line that matches the content, a clear note that the message is an ad, a valid physical postal address, and an easy opt-out.

Each email that breaks the rules can cost up to $53,088 according to the FTC guide as of October 2026, so a working unsubscribe is cheap insurance.

How it works

  1. Create a unique HTTPS unsubscribe address per recipient, with a hard-to-guess token in it.
  2. Put that address in List-Unsubscribe inside angle brackets, optionally followed by a mailto address.
  3. Add List-Unsubscribe-Post: List-Unsubscribe=One-Click.
  4. Sign the message with DKIM and include both headers in the signature, as RFC 8058 requires.
  5. When the inbox sends a POST to your address, remove the subscriber and reply with a success status, not a redirect.

Tips

Frequently asked questions

Do I need one-click unsubscribe if I send only a little email?

Gmail's requirement applies to senders of about 5,000 or more messages a day to Gmail accounts. Smaller senders still need a working opt-out under laws like CAN-SPAM, and adding the headers is good practice anyway.

Do order confirmations need an unsubscribe header?

Gmail says one-click unsubscribe is required only for marketing and promotional messages, and transactional messages are excluded. The FTC's guide also treats purely transactional email as mostly exempt from CAN-SPAM.

Can List-Unsubscribe use only a mailto address?

Not for one-click. RFC 8058 needs at least one HTTPS address in the header. A mailto address can sit next to it as a fallback for older mail apps.

How fast must I process an unsubscribe?

As of October 2026, Gmail recommends within 48 hours and Yahoo asks for within 2 days. The US CAN-SPAM Act sets a legal maximum of 10 business days.

Does CAN-SPAM require people to opt in first?

No. The FTC guide says the Act does not require prior consent, but it does require honest headers and subject lines, identifying the message as an ad, your physical postal address, and an opt-out you honor.

Related: Double opt-in, Google Postmaster Tools, SPF, DKIM and DMARC, How to create an email newsletter, Email marketing best practices.

Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.

More in Guides

We.Inc is an AI-powered website builder you can resell under your own brand. Launch a branded client dashboard, bill on Stripe Connect, and deliver AI-generated websites in minutes. White-label plans start at $99 a month for 25 client sites, with a 7-day free trial and no per-site fees.

Product

Who It's For

Features

Resources

Company

View Sitemap