NB Cookie Consent

Beschreibung

NB Cookie Consent stops trackers before they fire – not after. Most cookie banners are cosmetic: they pop up while Google Analytics, the Meta Pixel and your marketing tags have already loaded and set cookies. This one keeps WordPress-enqueued tracking scripts inert until your visitor makes a choice, then activates only the cookies they allowed – instantly, with no page reload.

Real consent, signalled everywhere it matters. Every cookie type – Essential, Analytics, Marketing – is wired to both Google Consent Mode v2 and the WP Consent API, per category, for free. Google Ads, Analytics (GA4) and Tag Manager respect the visitor’s choice (even for tags hardcoded in your theme), and consent-aware plugins – including WooCommerce Order Attribution – read the signal too. Most free plugins gate one or both of these, or don’t offer per-category signalling at all.

A preference center visitors actually understand. Accept All, Reject Non-Essential, or Customize – with equal-weight buttons (reject is as easy as accept, no dark patterns). Prefer something simpler? Switch to a plain Accept only or Accept & Decline banner in one click.

Built for a global audience. The banner appears in your site’s colours and language, with full RTL support and complete Hebrew and Russian translations out of the box – a strong fit for GDPR, CCPA and Israel’s Amendment 13. Cache-plugin friendly and WooCommerce-aware.

NB Cookie Consent is a technical tool that helps you collect, signal and honor consent. It is not a substitute for legal advice.

Features:
* Accept & Decline cookie buttons (GDPR-friendly)
* WordPress script blocking until consent
* One-click Cookie Policy page generator
* Full RTL support (Arabic, Hebrew, Persian & more)
* Banner customization (colors, positioning, button text)
* Custom button text – translate to any language
* Admin testing tools to verify blocking
* Debug mode for developers
* Cookie consent revocation shortcode [nb_cookie_revocation]
* Optional floating „Cookie settings“ icon – a small, unobtrusive round cookie icon that reopens the banner so visitors can change or withdraw consent anytime; shown only after they’ve accepted/declined (off by default; choose bottom-left/right)
* Cookie categories (Essential / Analytics / Marketing) with an in-banner preference center – Accept All, Reject Non-Essential, Customize & Save Preferences, each driving per-category Google Consent Mode v2 + WP Consent API signals (enabled by default on new installs; existing installs keep their current banner unless you switch it on)
* Accessibility-friendly (toward WCAG 2.1 AA) – ARIA roles and a screen-reader title on the banner/modal, keyboard-operable buttons, and focus management for the blocking modal (focus moves in, is trapped, Escape exits safely, focus returns); the non-blocking bottom banner is not trapped
* Cache Plugin Compatible – Works with WP Rocket, LiteSpeed, W3 Total Cache & more
* WP Consent API compatible – shares consent state with other consent-aware plugins
* WooCommerce-aware – with the free WP Consent API plugin, WooCommerce Order Attribution (sourcebuster) cookies also wait for consent (the plugin prompts you to set it up)
* No page reload – consent takes effect instantly without reloading the page
* Google Consent Mode v2 – signals consent to Google tags (GA4, Google Ads, Tag Manager): storage denied by default, granted on Accept – works even for Google snippets hardcoded in your theme
* Translation ready – fully translatable into any language (standard gettext); ships with complete Hebrew and Russian translations, and WordPress.org community translations load automatically

Blocked Scripts (those loaded through WordPress / enqueued; tracking snippets hardcoded directly into your theme — such as a pasted Meta Pixel or chat widget — require the Pro version):
* Google: Analytics (GA4, UA), Tag Manager, Site Kit
* Meta: Facebook Pixel, Facebook Events
* Analytics: MonsterInsights, ExactMetrics, Yoast GA
* Behavior: Hotjar, FullStory, LogRocket, Heap
* Marketing: Mixpanel, Segment, Amplitude
* Chat Widgets: Intercom, Zendesk, Tawk.to, Crisp, Drift
* + Many more automatically detected via WordPress handles

Pro Version Available:
Upgrade to NB Cookie Consent Pro for additional features:
* Consent Logging & CSV Export – a timestamped, per-visitor record of every choice: documented proof of consent for GDPR Article 7 and Israel’s Amendment 13, exportable for audits
* Smart Script Blocking – blocks even hardcoded/inline scripts and iframe embeds (YouTube, Maps, etc.)
* WPML / Polylang Integration – Per-visitor banner language on multilingual sites + 6 built-in languages (the free version is fully translatable via gettext)
* Automatic Scanner & Cookie Categorization
* Consent Dashboard (Analytics)
* Premium Designs – 6 layouts
* Priority support

Use Cases:
* WordPress sites needing cookie consent
* RTL language websites (Arabic, Hebrew, Persian)
* Basic privacy compliance requirements

Design:
LTR & RTL support ready out of the box.

Technical Details

Script Blocking Method:
Uses WordPress’s script_loader_tag filter to block tracking scripts at the server level until user consent.

Supported Scripts:
* google-analytics
* googleanalytics
* gtag
* gtm
* google-tag-manager
* facebook-pixel
* fbpixel

Browser Compatibility:
* Chrome 70+
* Firefox 65+
* Safari 12+
* Edge 79+

Performance:
* Minimal impact on page load speed
* Efficient consent checking
* Clean, lightweight code

Privacy Policy

This plugin stores user consent in a cookie named nb_cookie_consent for 365 days. No personal data is transmitted to external servers. The plugin only enables/disables tracking scripts based on user consent.

Support

For support, please use the WordPress.org support forums.
For priority support and advanced features, consider upgrading to NB Cookie Consent Pro.

Legal Notice

This plugin provides a technical tool for implementing cookie consent.
The author does not provide legal advice and bears no responsibility for any damage, fine, or claim arising from the use of this plugin.
It is strongly recommended to consult with a qualified legal expert to ensure compliance with applicable privacy and cookie regulations.

Screenshots

Installation

  1. Upload the plugin files to /wp-content/plugins/nb-cookie-consent/
  2. Activate the plugin through the ‚Plugins‘ screen in WordPress
  3. Go to Settings Cookie Consent to configure the banner
  4. Test the blocking functionality using the admin testing tools

FAQ

Does this plugin actually block tracking scripts?

Yes! Unlike cosmetic consent banners, this plugin uses WordPress’s script_loader_tag filter to block tracking scripts until user consent is obtained.

What’s the difference between standard and Pro versions?

The standard version includes Accept & Decline buttons, granular cookie categories (Essential / Analytics / Marketing) with an in-banner preference center and per-category Google Consent Mode v2 + WP Consent API signals, blocks WordPress-enqueued tracking scripts, and is fully translatable (gettext; ships Hebrew + Russian). The Pro version adds smart script blocking (hardcoded/inline scripts), WPML/Polylang per-visitor language with 6 built-in translations, a cookie scanner, and a consent analytics dashboard.

Does this help with privacy regulations?

This plugin blocks WordPress-enqueued tracking scripts until user consent. For specific legal compliance questions, consult with a qualified legal professional.

Can I customize the banner appearance?

Yes, you can customize colors, positioning, and display type (banner/modal) in the admin settings.

Does it work with caching plugins?

Yes. Consent is applied in the browser and the page HTML is identical for every visitor (tracking scripts are always rendered inert server-side), so blocking works correctly even with full-page caching such as WP Rocket, LiteSpeed, and W3 Total Cache.

How can users revoke their cookie consent?

Place the shortcode [nb_cookie_revocation] on your Privacy Policy page or any other page. When users click it, their consent is reset and the cookie banner will reappear.

Shortcode attributes:
* text – Custom button text (default: „Reset Cookie Consent“)
* style – „button“ or „link“ (default: „button“)
* class – Custom CSS class (default: „nb-cookie-revoke-btn“)

Example: [nb_cookie_revocation text=“Withdraw My Consent“ style=“link“]

Rezensionen

Zu diesem Plugin liegen noch keine Rezensionen vor.

Mitwirkende und Entwickler

„NB Cookie Consent“ ist Open-Source-Software. Folgende Menschen haben an diesem Plugin mitgewirkt:

Mitwirkende

„NB Cookie Consent“ wurde in 2 Sprachen übersetzt. Danke an die Übersetzer für ihre Mitwirkung.

Übersetze „NB Cookie Consent“ in deine Sprache.

Interessiert an der Entwicklung?

Durchstöbere den Code, sieh dir das SVN-Repository an oder abonniere das Entwicklungsprotokoll per RSS.

Änderungsprotokoll

1.4.0

  • Added: Granular cookie categories (Essential / Analytics / Marketing) with an in-banner preference center – Accept All, Reject Non-Essential, Customize and Save Preferences. Enabled by default on new installs; existing installs are unchanged (opt-in). Per-category label and description text is editable.
  • Added: Per-category Google Consent Mode v2 + WP Consent API signalling – Analytics drives analytics_storage / statistics; Marketing drives ad_storage/ad_user_data/ad_personalization / marketing. Trackers are mapped to a category and only the granted categories are activated (no page reload; a category reduction reloads to re-block).
  • Added: W3 Total Cache compatibility – the consent script is now excluded from W3TC’s JS minify/defer (joining WP Rocket, LiteSpeed, SG Optimizer and Autoptimize).
  • Added: Redesigned admin settings page – the options are grouped into clear cards with switch toggles, a branded header and a single „what you get in Pro“ list, so the free plugin no longer looks crippled. Every existing setting is preserved.
  • Added: Refreshed, more compact consent banner – the category preference-center now uses switch toggles, the buttons stay on one row, and the card is about a third shorter. Accent, switches and links follow your Accept colour.
  • Added: Full Hebrew and Russian translations for all of the new admin and banner text.
  • Added: The Cookie Categories settings appear only when you pick the Categories banner mode (less clutter), and a clearer one-click „Create Policy Page Automatically“ button.
  • Changed: Hebrew interface is now gender-neutral throughout (admin and banner) – it addresses everyone, not only men.
  • Added: Accessibility improvements toward WCAG 2.1 AA (Israeli IS 5568) – keyboard focus management for the blocking modal (focus moves in, is trapped, Escape exits safely, focus returns), plus contrast fixes to the preferences label and category toggles. The non-blocking bottom banner is not trapped. (Publishing an accessibility statement remains the site owner’s responsibility.)
  • Changed: Shorter, clearer default banner text (explicit opt-in wording; leaving the field empty keeps using the built-in default). The Accept, Decline and Privacy-link text fields work the same way now – empty keeps the context-aware default. Any custom or previously-saved text is unchanged.
  • Security: The consent cookie is now set with the Secure flag on HTTPS sites (in addition to SameSite=Lax), so it is never transmitted over plain HTTP.
  • Note: Existing sites keep the simple Accept/Decline banner unchanged unless you enable categories in Settings.

1.3.0

  • Added: Google Consent Mode v2 (basic) – signals consent to Google tags (GA4, Google Ads, Tag Manager) so they respect the visitor’s choice (storage denied by default, granted on Accept), even for Google snippets hardcoded in the theme. Enabled by default on new installs.
  • Added: Optional floating „Cookie settings“ icon – a small round cookie-icon button (icon-only, like CookieYes/Cookiebot/OneTrust) that reopens the banner to change/withdraw consent (GDPR withdrawal symmetry). Shown only after the visitor has made a choice (hidden while the banner is still asking). Off by default; bottom-left or bottom-right.
  • Added: Full translation support (i18n) – the plugin is now fully translatable into any language via standard gettext (.pot included), and ships with complete Hebrew and Russian translations. WordPress.org community translations are delivered automatically.
  • Added: WP Consent API support – consent choices are now shared with other consent-aware plugins (wp_set_consent / wp_has_consent)
  • Added: No page reload on consent – accepting now activates previously blocked scripts instantly, without reloading the page
  • Added: Developer filter nb_cookie_consent_blocked_handles to customize which script handles are treated as trackers
  • Added: WooCommerce compatibility – Order Attribution (sourcebuster / sbjs_ cookies) respects cookie consent via the WP Consent API (recommended for WooCommerce stores): no tracking cookies before consent, recorded after, checkout never breaks, and no „sbjs is undefined“ error
  • Added: Cache/optimization compatibility – the consent script is excluded from JS delay/defer/minify/combine in WP Rocket, LiteSpeed, SG Optimizer and Autoptimize (prevents the banner silently breaking)
  • Changed: Default banner text now uses explicit opt-in wording (click Accept/Decline) instead of implied consent
  • Changed: Clarified that the free version is fully translatable (Hebrew + Russian bundled, English fallback) – the Pro multi-language feature is specifically WPML/Polylang per-visitor language + built-in professional translations
  • Changed: Tested up to WordPress 7.0

1.2.1

  • Fixed: Cache plugin compatibility – banner now works correctly with WP Rocket, LiteSpeed, etc.
  • Fixed: Escape key behavior respects overlay mode setting
  • Improved: Accessibility – added ARIA attributes for screen readers
  • Improved: Scanner messaging – clearer feedback for hardcoded scripts detection

1.2.0

  • Added: One-click Cookie Policy page generator with auto-fill URL
  • Improved: Better LTR & RTL support

1.1.9

  • Fixed: Banner fallback now uses wp_footer for valid HTML compliance
  • Added: „Restore Defaults“ button for colors and font size settings
  • Changed: Decline button enabled by default for GDPR compliance
  • Improved: Cleaner description text (removed mixed language in English version)

1.1.8

  • Added: Decline Cookies button – users can now accept OR decline (GDPR-friendly)
  • Added: Custom „Decline Button Text“ setting – translate to any language
  • Added: Decline button color customization
  • Updated: Premium features list

1.1.7

  • Initial WordPress.org release
  • Accept & Decline cookie buttons
  • WordPress script blocking (35+ tracking services)
  • Full RTL support (Arabic, Hebrew, Persian & more)
  • Custom button text settings
  • [nb_cookie_revocation] shortcode for consent withdrawal
  • Admin testing tools