跳到内容

Koci Cookie

v1.3.0

kocimedia · 2026年11月25日 上架

GDPR cookie consent banner with prior script blocking, Google Consent Mode v2, a consent log and an automatic cookie scan.

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

贡献者

截图

The banner on the site, with equal "Reject all" and "Accept all" buttons.
The banner on the site, with equal "Reject all" and "Accept all" buttons.
The detailed settings with the categories and the cookie list.
The detailed settings with the categories and the cookie list.
The design settings with the live preview.
The design settings with the live preview.
The automatic cookie scan with the classified cookies.
The automatic cookie scan with the classified cookies.
The consent log with the statistics of the last 30 days.
The consent log with the statistics of the last 30 days.

Koci Cookie shows a cookie banner and makes sure that tracking codes and embeds only run after the visitor agreed – whichever plugin or theme adds them.

Features

  • Prior blocking – recognised tracking codes (Google Analytics / Ads / Tag Manager, Meta Pixel, Microsoft Clarity, Hotjar, TikTok, LinkedIn, Pinterest, X, Matomo, Yandex …) and embeds (YouTube, Vimeo, Google Maps, Spotify …) are deactivated in the served HTML until consent. Blocked embeds get a placeholder with an “Allow and load” button. The output does not depend on the visitor, so it works with page caching.
  • Two layers – “Accept all” and “Reject all” with equal weight on the first layer, a settings panel with a switch per category and the list of cookies on the second. No optional category is pre-ticked.
  • Google Consent Mode v2 (basic or advanced), Microsoft UET Consent Mode and WP Consent API support.
  • Consent log – random consent ID, time, decision, settings revision and page; the IP address is stored anonymised (IPv4 last byte zeroed) or not at all, the browser only if you turn it on. CSV export and automatic retention period (3 years by default). Visitors see their own consent ID.
  • Withdraw at any time – floating button, [koci_cookie_settings] shortcode or a #koci-cookie-settings link. When consent is withdrawn, the cookies of the category are deleted.
  • Design – box, bar, popup or sidebar, 6 positions, colours and colour schemes, fonts, radius, animation and logo, with a live preview in the admin.
  • Every text can be edited, and translated with Polylang or WPML. The default texts and the admin screens are translatable on translate.wordpress.org.
  • Automatic cookie scan – the main pages of the site are loaded in the admin as if all cookies were accepted, and the cookies found are classified with a built-in database of about 100 cookies (provider, category, purpose, expiry). Third-party cookies that the browser does not let us read are added from the detected services.
  • Integrations by ID – Google Analytics 4, Google Ads, Google Tag Manager, Meta Pixel, Microsoft Clarity and Hotjar are loaded by the plugin after consent, and their cookies are added to the cookie list automatically.
  • Consent validity, asking everyone again (revision), Global Privacy Control signal, robots, excluded pages, import / export of the settings.
  • Compliance check in the admin, based on the EDPB guidelines.

The plugin is a technical tool. The site owner is responsible for the content of the privacy policy and for the accuracy of the cookie list.

Privacy

  • The consent cookie koci_cookie_consent stores the decision (random consent ID, accepted categories, settings revision and time) for the configured period (180 days by default).
  • The consent log is stored in your own database (table {prefix}koci_cookie_log) and sent to your own site (/wp-json/koci-cookie/v1/consent). It is deleted automatically after the retention period.
  • A suggested privacy policy text is added to Settings > Privacy > Policy guide.
  • The plugin itself does not send any data to third parties. See “External services” for the optional integrations.

External services

The plugin connects to the following services only when you enter their ID on the Integrations tab. Their scripts are loaded from the provider’s server in the visitor’s browser, only after the visitor allowed the category of the service (statistics or marketing). Exception: with the advanced Google Consent Mode the Google tags (Analytics, Ads, Tag Manager) load before consent and send cookieless pings without consent, as described by Google. The scripts send the provider data about the visit (page address, browser and device data, IP address, and the events of the service).

  • Google Analytics 4 and Google Ads (Google tag, https://www.googletagmanager.com/gtag/js) – visitor statistics and ad conversion measurement. Terms: https://policies.google.com/terms – Privacy: https://policies.google.com/privacy
  • Google Tag Manager (https://www.googletagmanager.com/gtm.js) – loads the tags set up in your Tag Manager container. Terms: https://policies.google.com/terms – Privacy: https://policies.google.com/privacy
  • Meta Pixel (https://connect.facebook.net/en_US/fbevents.js) – ad measurement and targeting on Meta platforms. Terms: https://www.facebook.com/legal/terms/businesstools – Privacy: https://www.facebook.com/privacy/policy/
  • Microsoft Clarity (https://www.clarity.ms/tag/) – session recordings and heatmaps. Terms: https://clarity.microsoft.com/terms – Privacy: https://privacy.microsoft.com/privacystatement
  • Hotjar (https://static.hotjar.com/c/hotjar-<site ID>.js) – visitor behaviour analytics. Terms: https://www.hotjar.com/legal/policies/terms-of-service/ – Privacy: https://www.hotjar.com/legal/policies/privacy/

The cookie scan only loads pages of your own site and sends nothing to an external server.

For developers

  • JS API: window.kociCookie.showPreferences(), show(), getConsent(), hasConsent( 'marketing' ), acceptAll(), rejectAll(), onConsent( fn ).
  • Event: koci_cookie_consent on document and in the dataLayer (GTM trigger) on every decision and page load.
  • Manual blocking in a theme: <script type="text/plain" data-kcc-category="statistics"> (data-kcc-src for an external file) and <iframe data-kcc-src="…" data-kcc-category="marketing">.
  • Shortcodes: [koci_cookie_settings] (a link that opens the settings) and [koci_cookie_list] (the cookie table for the cookie policy).
  • PHP: koci_cookie_has_consent( 'statistics' ) – use with care with full page caching.
  • Filters: koci_cookie_services (the service catalogue of the blocking), koci_cookie_cookie_db (the built-in cookie database), koci_cookie_block_script (keep a detected script unblocked), koci_cookie_blocker_enabled, koci_cookie_text, koci_cookie_config, koci_cookie_scan_urls. Action: koci_cookie_settings_saved.

Plums

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

导航

说明

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

© 2026 Plums