No Thanks

A cookie consent banner that weighs 3 KB

No Thanks is a free, open source consent banner: about 3.3 KB gzipped with its CSS, no dependency, and no cookie of its own. Do Not Track and Global Privacy Control count as a refusal. « No thanks » and « OK » weigh the same. For any site, or as a WordPress plugin.

Try it on this page

The banner in the corner is the real one, themed with this site's colors. This page tracks nothing: its three purposes run harmless code that only updates the list below.

Blocked code sits in <template data-no-thanks="videos">. It stays inert until its purpose is allowed, then runs in place.

Once the banner is closed, the round button in the corner shows the state and reopens it. Any link to #no-thanks does too. Taking a purpose back clears its cookies and reloads the page.

With Do Not Track or Global Privacy Control on, you got a short notice instead, and nothing ran.

Blocked code on this page

  • Audience measurementdata-no-thanks="audience"Blocked
  • Videosdata-no-thanks="videos"Blocked
  • Advertisingdata-no-thanks="ads"Blocked

What a visitor downloads

For the banner on a first visit, compressed. One request: the WordPress plugin inlines the CSS.

BannerWeightKBRequests
No Thanks3.31
No Thanks, with purposes4.11
CookieYes329
tarteaucitron.js844
Usercentrics1375
Cookiebot1634
OneTrust20913
Didomi2103
Axeptio2909

No Thanks: the dist/ files, JS + CSS, gzipped. The others as their vendors run them on their own site, measured on 24 November 2026 from France: every request to the CMP's own domains, in the compressed bytes a browser gets. A site's own setup moves these figures. Self-hosted libraries for reference: CookieConsent v3 ≈ 16 KB, Complianz (WordPress) ≈ 15 KB, Klaro ≈ 67 KB.

How it behaves

Built on a native <dialog>, shown non-modal: no cookie wall, the page stays usable.

Design

A corner button to change your mind

Once the banner is closed, a small round button stays in the corner. A green check when everything is allowed, an amber dash when only some purposes are, crossed out otherwise. Its text slides out on hover or focus, and a click reopens the banner.

PrivacyAutomatic

Do Not Track and Global Privacy Control

When the browser sends either signal, it is an answer: nothing runs and no banner asks. On the first visit only, a short notice says so for 6 seconds, then fades out (paused while hovered or focused).

An explicit choice still wins: reopened, the banner offers « Allow anyway ».

Privacy

Consent by purpose

Audience, videos, ads: choices are by purpose, never by cookie. That is what the CNIL asks, and a list of cookies only weighs the page and tires the visitor.

  • One click on « OK » or « No thanks » still decides everything. « Choose » shows one switch per purpose, all off.
  • With a single purpose, the usual case, a smaller build leaves the purpose code out.
  • Allowing one more purpose runs its code at once.
Privacy

No cookie, and a clean refusal

The choice is kept in localStorage for 6 months, and asked again when the trackers change. Scripts that already ran cannot be unloaded, so refusing after agreeing deletes the trackers' cookies and reloads the page.

Install

The same banner, as a WordPress plugin or as two files for any site.

WordPress

WordPress plugin

  1. Install with Composer, from the author's Composer repository.

    composer config repositories.cgsoft composer https://corentingautier.dev/composer-repo
    composer require cgsoft/no-thanks
  2. Activate No Thanks in the Plugins screen.

  3. Fill Settings › No Thanks: one block per purpose with the trackers' code as the service gives it, and every text of the banner. Each text has a default in the site language. While the code is empty, nothing is loaded.

  • <template data-no-thanks="<purpose id>"> anywhere in the site holds code back for a purpose, an embedded video say.
  • no_thanks_link() prints the footer link. In a block footer, link to #no-thanks.
  • Settings › Privacy › Policy Guide gets a suggested text listing the purposes and the services found in their code.
  • The no_thanks_config filter changes anything passed to the script.
JavaScript

Any site

npm install no-thanks.js, or from a CDN: https://cdn.jsdelivr.net/npm/no-thanks.js/dist/no-thanks.js and .css. With several purposes, use no-thanks-purposes.js and .css.

<link rel="stylesheet" href="dist/no-thanks.css">
<script>
  window.noThanksConfig = {
    revision: '1',
    purposes: [
      { id: 'audience', label: 'Audience measurement', description: 'Google Analytics' },
      { id: 'videos', label: 'Videos' },
    ],
    texts: { message: 'This site would like to measure its audience. Is that OK?' },
  };
</script>
<script src="dist/no-thanks.js" defer></script>

<template data-no-thanks="audience">
  <!-- the tracker's code, as given; no value: needs every purpose -->
</template>
<a href="#no-thanks">Cookies</a>
revision
Change it to ask every visitor again.
maxAge
Days the choice is kept, 182 by default.
cookies
Cookie name prefixes deleted on refusal.
privacyUrl
Adds a « Learn more » link after the message.
purposes
[{ id, label, description }], optional.
texts
Every text of the banner: message and dnt are HTML, {date} is replaced in the reminders.
buttonClass
An extra class on the banner's buttons.
JavaScript

API

noThanks.open();                       // reopens the banner
noThanks.consent;                      // true when everything is allowed
noThanks.allows('videos');             // one purpose
noThanks.set({ videos: true });        // or true / false for everything

document.addEventListener('no-thanks:change', (e) => {
  console.log(e.detail.consent, e.detail.purposes);
});

Theming: --no-thanks-bg, -color, -accent, -accent-color, -radius, -shadow, -offset, -ok and -some.