{"id":290906,"date":"2026-03-30T17:26:30","date_gmt":"2026-03-30T17:26:30","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/nivaj-cookie-consent\/"},"modified":"2026-03-30T17:26:21","modified_gmt":"2026-03-30T17:26:21","slug":"nivaj-cookie-consent","status":"publish","type":"plugin","link":"https:\/\/bg.wordpress.org\/plugins\/nivaj-cookie-consent\/","author":9702631,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.2","stable_tag":"1.0.2","tested":"6.9.4","requires":"5.8","requires_php":"7.4","requires_plugins":null,"header_name":"Nivaj Cookie Consent","header_author":"Ajay Rajbanshi","header_description":"GDPR-compliant cookie consent with category-based consent, script blocking, GTM, consent logging, and customizable banner.","assets_banners_color":"","last_updated":"2026-03-30 17:26:21","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/ajayrajbanshi","header_author_uri":"https:\/\/www.ajayrajbanshi.com.np","rating":5,"author_block_rating":0,"active_installs":0,"downloads":40,"num_ratings":1,"support_threads":1,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.2":{"tag":"1.0.2","author":"ajayrajbanshi","date":"2026-03-30 17:26:21"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":1},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3494835,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3494835,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.2"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3494835,"resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3494835,"resolution":"2","location":"assets","locale":""},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3494835,"resolution":"3","location":"assets","locale":""},"screenshot-4.png":{"filename":"screenshot-4.png","revision":3494835,"resolution":"4","location":"assets","locale":""}},"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[20272,20278,16626,131785,396],"plugin_category":[54],"plugin_contributors":[257088],"plugin_business_model":[],"class_list":["post-290906","plugin","type-plugin","status-publish","hentry","plugin_tags-cookie-banner","plugin_tags-cookie-compliance","plugin_tags-cookie-consent","plugin_tags-gdpr","plugin_tags-privacy","plugin_category-security-and-spam-protection","plugin_contributors-ajayrajbanshi","plugin_committers-ajayrajbanshi"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/nivaj-cookie-consent\/assets\/icon-128x128.png?rev=3494835","icon_2x":"https:\/\/ps.w.org\/nivaj-cookie-consent\/assets\/icon-256x256.png?rev=3494835","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/nivaj-cookie-consent\/assets\/screenshot-1.png?rev=3494835","caption":""},{"src":"https:\/\/ps.w.org\/nivaj-cookie-consent\/assets\/screenshot-2.png?rev=3494835","caption":""},{"src":"https:\/\/ps.w.org\/nivaj-cookie-consent\/assets\/screenshot-3.png?rev=3494835","caption":""},{"src":"https:\/\/ps.w.org\/nivaj-cookie-consent\/assets\/screenshot-4.png?rev=3494835","caption":""}],"raw_content":"<!--section=description-->\n<p>Nivaj Cookie Consent provides a complete cookie consent management solution for WordPress. It helps you comply with GDPR, CCPA, and other privacy regulations by giving visitors full control over cookie categories.<\/p>\n\n<h4>Features<\/h4>\n\n<ul>\n<li>Category-based consent: Necessary, Analytics, Marketing, and Functional categories (customizable)<\/li>\n<li>Auto script blocking: Blocks scripts and iframes until the user consents to the appropriate category<\/li>\n<li>Google Tag Manager: Built-in GTM container injection with consent integration<\/li>\n<li>Google Consent Mode v2: Sends consent signals (ad_storage, analytics_storage, etc.) via dataLayer<\/li>\n<li>DataLayer events: Custom events fired on consent changes for tag management<\/li>\n<li>Consent logging: GDPR-compliant records with SHA-256 hashed IP and user agent<\/li>\n<li>CSV export: Export consent log records for compliance audits<\/li>\n<li>Cookie scanner: Detects cookies on your site and auto-categorizes 50+ known cookies<\/li>\n<li>Analytics dashboard: Consent statistics with daily charts and category acceptance rates<\/li>\n<li>Customizable banner: Position, colors, typography, button styles, and layout options<\/li>\n<li>Shortcode: <code>[nivaj_cookie_preferences]<\/code> to place a cookie preferences button anywhere<\/li>\n<li>Privacy policy snippet: Auto-generates a cookie table for your privacy policy page<\/li>\n<li>Lightweight: Vanilla JavaScript with no jQuery dependency on the frontend<\/li>\n<li>Accessible: ARIA attributes, keyboard navigation, and focus management<\/li>\n<li>Multisite support: Independent settings and consent log per site<\/li>\n<\/ul>\n\n<h4>How It Works<\/h4>\n\n<ol>\n<li>Install and activate the plugin.<\/li>\n<li>Go to <strong>Cookie Consent &gt; Settings<\/strong> to configure banner text, categories, and integrations.<\/li>\n<li>Customize the banner appearance under <strong>Cookie Consent &gt; Appearance<\/strong>.<\/li>\n<li>Define script blocking patterns under <strong>Cookie Consent &gt; Scripts<\/strong>.<\/li>\n<li>Run the Cookie Scanner to detect cookies on your site.<\/li>\n<li>Monitor consent activity on the <strong>Cookie Consent &gt; Dashboard<\/strong>.<\/li>\n<\/ol>\n\n<h4>Shortcode<\/h4>\n\n<p>Use <code>[nivaj_cookie_preferences]<\/code> to add a \"Cookie Preferences\" button anywhere on your site.<\/p>\n\n<p>Attributes:<\/p>\n\n<ul>\n<li><code>text<\/code> \u2013 Button label (default: \"Cookie Preferences\")<\/li>\n<li><code>class<\/code> \u2013 Additional CSS class<\/li>\n<\/ul>\n\n<p>Example: <code>[nivaj_cookie_preferences text=\"Manage Cookies\" class=\"my-btn\"]<\/code><\/p>\n\n<h4>Privacy<\/h4>\n\n<p>This plugin stores consent preferences in a browser cookie on the visitor's device. When consent logging is active, IP addresses and user agents are stored as one-way SHA-256 hashes combined with the WordPress salt, making them non-reversible. No personal data is shared with external services by this plugin itself. See the \"External services\" section below for details on optional Google integrations.<\/p>\n\n<h3>External services<\/h3>\n\n<p>This plugin optionally connects to external services when the site administrator explicitly enables them. No external connections are made by default.<\/p>\n\n<h4>Google Tag Manager<\/h4>\n\n<p>When the administrator enables Google Tag Manager under Cookie Consent &gt; Settings and provides a GTM container ID, this plugin loads the Google Tag Manager script from Google's servers.<\/p>\n\n<p>What it does: Loads a tag management container that can manage analytics, marketing, and other scripts on the site.\nWhen it connects: On every frontend page load, only when GTM is enabled and a valid container ID (GTM-XXXXXXX) is configured.\nData sent: The GTM container ID is sent to Google's servers to retrieve the container script. No personal visitor data is sent by this plugin directly; however, the loaded GTM container may collect data based on its own configuration.<\/p>\n\n<ul>\n<li><a href=\"https:\/\/marketingplatform.google.com\/about\/analytics\/tag-manager\/use-policy\/\">Google Tag Manager Terms of Service<\/a><\/li>\n<li><a href=\"https:\/\/policies.google.com\/privacy\">Google Privacy Policy<\/a><\/li>\n<\/ul>\n\n<h4>Google Consent Mode v2<\/h4>\n\n<p>When the administrator enables Google Consent Mode under Cookie Consent &gt; Settings, this plugin sends consent signals to Google services via the browser's dataLayer.<\/p>\n\n<p>What it does: Communicates the visitor's consent status (granted or denied) for ad storage, analytics storage, and personalization to Google services already running on the site.\nWhen it connects: Consent default signals are set on page load. Consent update signals are sent when a visitor interacts with the cookie banner. This does not load any additional external scripts.\nData sent: Consent status values (granted\/denied) for: ad_storage, ad_user_data, ad_personalization, analytics_storage, functionality_storage, personalization_storage, security_storage.<\/p>\n\n<ul>\n<li><a href=\"https:\/\/developers.google.com\/tag-platform\/security\/guides\/consent\">Google Consent Mode documentation<\/a><\/li>\n<li><a href=\"https:\/\/policies.google.com\/privacy\">Google Privacy Policy<\/a><\/li>\n<\/ul>\n\n<h4>Cookie Scanner (local only)<\/h4>\n\n<p>The Cookie Scanner feature makes an HTTP request to your own site's homepage to detect cookies and scripts. It does not connect to any external service.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the <code>nivaj-cookie-consent<\/code> folder to the <code>\/wp-content\/plugins\/<\/code> directory.<\/li>\n<li>Activate the plugin through the <strong>Plugins<\/strong> menu in WordPress.<\/li>\n<li>Navigate to <strong>Cookie Consent &gt; Settings<\/strong> to configure the plugin.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"does%20this%20plugin%20block%20scripts%20automatically%3F\"><h3>Does this plugin block scripts automatically?<\/h3><\/dt>\n<dd><p>Yes. Define URL patterns under <strong>Cookie Consent &gt; Scripts<\/strong>, and the plugin will block matching <code>&lt;script&gt;<\/code> and <code>&lt;iframe&gt;<\/code> tags until the visitor consents to the relevant category.<\/p><\/dd>\n<dt id=\"is%20the%20consent%20banner%20customizable%3F\"><h3>Is the consent banner customizable?<\/h3><\/dt>\n<dd><p>Yes. You can customize the position (top bar, bottom bar, or center modal), layout, colors, font size, border radius, button styles, and add custom CSS.<\/p><\/dd>\n<dt id=\"does%20it%20work%20with%20google%20tag%20manager%3F\"><h3>Does it work with Google Tag Manager?<\/h3><\/dt>\n<dd><p>Yes. Enable GTM under <strong>Cookie Consent &gt; Settings &gt; Advanced<\/strong> and enter your container ID. The plugin also supports Google Consent Mode v2 for sending consent signals to Google services.<\/p><\/dd>\n<dt id=\"is%20it%20gdpr%20compliant%3F\"><h3>Is it GDPR compliant?<\/h3><\/dt>\n<dd><p>The plugin helps you achieve GDPR compliance by blocking non-essential cookies until consent is given, providing granular category-based choices, and logging consent for accountability. Full compliance depends on your overall site configuration and legal requirements.<\/p><\/dd>\n<dt id=\"does%20it%20support%20multisite%3F\"><h3>Does it support multisite?<\/h3><\/dt>\n<dd><p>Yes. Each site in a multisite network has its own settings and consent log. The uninstall process cleans up data across all sites.<\/p><\/dd>\n<dt id=\"where%20is%20consent%20data%20stored%3F\"><h3>Where is consent data stored?<\/h3><\/dt>\n<dd><p>Consent preferences are stored in a browser cookie. Consent log records are stored in a custom database table with hashed (non-reversible) IP addresses and user agents.<\/p><\/dd>\n<dt id=\"can%20i%20add%20a%20cookie%20preferences%20button%20to%20a%20page%3F\"><h3>Can I add a cookie preferences button to a page?<\/h3><\/dt>\n<dd><p>Yes. Use the <code>[nivaj_cookie_preferences]<\/code> shortcode or call <code>window.nivajCC.reopenBanner()<\/code> from JavaScript.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Remove custom CSS feature (arbitrary CSS insertion not permitted per wp.org guidelines).<\/li>\n<li>Sanitize and validate cookie JSON data with structure checking in get_consent_from_cookie().<\/li>\n<li>Sanitize $_SERVER['HTTP_USER_AGENT'] with sanitize_text_field() before hashing.<\/li>\n<li>Sanitize individual consent cookie fields (version, timestamp, categories) instead of returning raw decoded JSON.<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Use wp_add_inline_script() for GCM and GTM scripts instead of inline script tags.<\/li>\n<li>Add explicit output buffer closing for script blocker.<\/li>\n<li>Add External services section to readme for Google GTM and GCM documentation.<\/li>\n<li>Remove inline JavaScript event handlers for WordPress coding standards compliance.<\/li>\n<li>Fix shortcode parameter type handling to prevent fatal errors.<\/li>\n<li>Remove Domain Path header (unnecessary since WordPress 4.6).<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<li>Category-based cookie consent with customizable banner.<\/li>\n<li>Auto script and iframe blocking.<\/li>\n<li>Google Tag Manager integration.<\/li>\n<li>Google Consent Mode v2 support.<\/li>\n<li>DataLayer custom events for consent tracking.<\/li>\n<li>Consent logging with hashed PII and CSV export.<\/li>\n<li>Cookie scanner with 50+ known cookie database.<\/li>\n<li>Analytics dashboard with daily charts and category rates.<\/li>\n<li>Advanced appearance customization.<\/li>\n<li><code>[nivaj_cookie_preferences]<\/code> shortcode.<\/li>\n<li>Consent version warning in admin.<\/li>\n<li>REST API endpoints for consent management.<\/li>\n<li>Multisite support.<\/li>\n<\/ul>","raw_excerpt":"GDPR-compliant cookie consent with category-based consent, script blocking, GTM, consent logging, and customizable banner.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/bg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/290906","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/bg.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/bg.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=290906"}],"author":[{"embeddable":true,"href":"https:\/\/bg.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/ajayrajbanshi"}],"wp:attachment":[{"href":"https:\/\/bg.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=290906"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/bg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=290906"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/bg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=290906"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/bg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=290906"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/bg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=290906"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/bg.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=290906"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}