跳到内容

NetCookies

v1.0.9

netchameleon · 2026年11月24日 上架

Free cookie consent for UK and EU sites. A fair banner that blocks tracking until visitors agree, with Google Consent Mode v2 and a consent record.

正在使用
10 以下
评分
暂无
累计下载
36
最近更新
2026年11月24日
需要 WordPress 6.3+已测试到 7.1.5PHP 7.4+

贡献者

截图

The banner as a bar, with Accept and Reject side by side.
The banner as a bar, with Accept and Reject side by side.
The settings panel with a switch for each category.
The settings panel with a switch for each category.
The Cookie list tab: scan your site and describe your own cookies.
The Cookie list tab: scan your site and describe your own cookies.
The consent record, with a summary of the last 30 days.
The consent record, with a summary of the last 30 days.

NetCookies asks your visitors before your site sets any optional cookies, and means it. Analytics and advertising tags stay switched off until someone says yes, and if they change their mind later, the cookies are deleted.

It is built for UK and EU sites, following the ICO’s guidance under PECR and UK GDPR: Reject is as easy as Accept, nothing is ticked in advance, and visitors can change their choice at any time.

Why NetCookies

  • Completely free. Every feature on this page, with no page-view limits, no account to create and no “upgrade to unlock blocking”.
  • Fair by design. Accept all and Reject all sit side by side and look identical. No pre-ticked boxes, no hidden reject link, no cookie wall.
  • Blocks for real. Scripts wait inside inert templates until a visitor agrees to their category, so nothing runs early. Turn a category off and its cookies are removed.
  • Google Consent Mode v2 built in. Paste your Google Analytics 4 or Tag Manager ID and NetCookies sends Google the consent signals it needs, in basic or advanced mode.
  • Works with the WP Consent API. If the free WP Consent API plugin is installed, NetCookies tells it about every choice, so plugins that follow it, such as WooCommerce Order Attribution, wait for your visitors to agree.
  • Works with page caching. The banner is drawn in the browser, so every visitor can be served the same cached page.
  • Finds your cookies. Scan your site to see the cookies it sets and any tracking that loads before consent, with advice on how to fix each one. Cookies made by JavaScript are picked up as you browse your own site while logged in.
  • A cookie list that writes itself. Put [netcookies_declaration] on a page for a tidy table of every cookie, grouped by category, with plain-English descriptions of nearly 40 common cookies.
  • Proof of consent. Every choice is recorded against a random ID that only the visitor holds, scrambled so it can’t be traced back to them. No IP addresses. Export to CSV whenever you need it.
  • Light. One small script and stylesheet, no jQuery. NetCookies itself makes no external requests from your visitors’ browsers; only the tracking services you add are loaded, after consent (see External services).
  • Accessible. Keyboard friendly, screen-reader labels, proper switches, focus kept inside the settings panel and 44px touch targets.
  • Respects Global Privacy Control. If a browser sends the “do not share” signal, marketing cookies stay off unless the visitor switches them on.

Part of the Netchameleon Suite

NetCookies is part of the Netchameleon Suite, a family of WordPress plugins by Netchameleon that work together. It knows the cookies that other Net plugins set, such as NetPolls and NetBookings, and lists them for you automatically. Every Net plugin shares one Netchameleon Suite menu in your dashboard.

External services

NetCookies does not connect to any outside service unless you set one up. These are the services it can use:

Google Analytics 4 and Google Tag Manager

Used only if you enter a Google Analytics measurement ID or a Tag Manager container ID on the Categories & scripts screen. NetCookies then adds Google’s tag (gtag.js from www.googletagmanager.com, or gtm.js for Tag Manager) to your pages. In basic Consent Mode (the default) the tag loads only after a visitor allows Analytics (or, for Tag Manager, Analytics or Marketing). In advanced Consent Mode the tag loads on every page and sends Google cookieless pings with the visitor’s consent state until they choose. Google receives the page address, browser details, the visitor’s IP address and, once consent is given, analytics cookie identifiers.

Google terms of service: https://policies.google.com/terms
Google Analytics terms: https://marketingplatform.google.com/about/analytics/terms/us/
Google privacy policy: https://policies.google.com/privacy

Meta (Facebook) Pixel

Used only if you enter a Meta Pixel ID. NetCookies adds Meta’s pixel script (from connect.facebook.net) after a visitor allows Marketing cookies. Meta receives the page address, browser details, the visitor’s IP address and its own cookie identifiers, and records a page view.

Meta Business Tools terms: https://www.facebook.com/legal/terms/businesstools
Meta privacy policy: https://www.facebook.com/privacy/policy/

Microsoft Clarity

Used only if you enter a Clarity project ID. NetCookies adds Clarity’s script (from www.clarity.ms) after a visitor allows Analytics cookies. Clarity receives the page address, browser details, the visitor’s IP address and recordings of how the page is used.

Microsoft Clarity terms: https://clarity.microsoft.com/terms
Microsoft privacy statement: https://privacy.microsoft.com/privacystatement

Site scan (your own site only)

The “Scan my site” button on the Cookie list tab loads up to four pages of your own site (from your server to your server) and looks for cookies and for the addresses of well-known services such as Google Analytics, YouTube or Stripe in the page code. It never contacts those services: their names and addresses are only a list of patterns to look for, so the scan can tell you what your site already loads. Nothing is sent outside your site.

Netchameleon plugin list (dashboard only)

Used only if you tick “Keep the list up to date” on the Banner tab. It is off by default; until then the “More from Netchameleon” box uses a list built into the plugin. When it is on, your site downloads a short list of Net plugins from https://netchameleon.co.uk/netchameleon-suite.json about once a week, to show in the sidebar of the NetCookies settings page. The request is made by your server, not by visitors. It sends no information about your site beyond what any web request includes (your server’s IP address and a “NetCookies” user agent).

Netchameleon privacy policy: https://netchameleon.co.uk/privacy-policy/

Developer notes

JavaScript:

  • NetCookies.hasConsent( 'analytics' ) – true or false
  • NetCookies.getConsent() – all categories, or null before a choice
  • NetCookies.open() – open the settings panel
  • NetCookies.set( { analytics: true } ), NetCookies.acceptAll(), NetCookies.rejectAll()
  • Events on document: netcookies:ready and netcookies:change (detail: consent, action, revoked)

PHP: netcookies_has_consent( 'analytics' ) (not reliable on cached pages; use the JavaScript API there).

Categories: necessary, functional, analytics, marketing.

Filters: netcookies_settings, netcookies_active, netcookies_config, netcookies_consent_mode, netcookies_category_snippets, netcookies_blocked_handles, netcookies_known_cookies, netcookies_declaration_rows, netcookies_scan_services, netcookies_scan_pages, netcookies_rate_limit, netcookies_showcase_url.

Actions: netcookies_loaded.

Settings page hooks, for add-ons: net_netcookies_settings_tabs (filter, add tabs), net_netcookies_settings_cards_{tab} (action, add cards to a tab), net_netcookies_save_settings (action, save them), net_netcookies_sidebar (filter, sidebar boxes) and net_netcookies_is_pro (filter).

Netchameleon plugins can declare their cookies with netcookies_known_cookies:

add_filter( 'netcookies_known_cookies', function ( $list ) { $list[] = array( 'name' => 'my_cookie', 'category' => 'functional', 'provider' => 'My plugin', 'purpose' => 'Remembers …', 'duration' => '1 year', 'type' => 'cookie' ); return $list; } );

Shortcodes: [netcookies_settings label="Cookie settings"] and [netcookies_declaration] (add status="no" to hide the “your current choice” line).

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums