imagewize / warder-cookie-consent
GDPR-compliant cookie consent banner with category management and floating preferences toggle.
Package info
github.com/imagewize/warder-cookie-consent
Type:wordpress-plugin
pkg:composer/imagewize/warder-cookie-consent
Requires
- php: >=8.0
- composer/installers: ^2.0
Requires (Dev)
- phpcsstandards/phpcsutils: ^1.2
- squizlabs/php_codesniffer: ^3.13
- wp-coding-standards/wpcs: ^3.3
- dev-main
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.0
- v1.0.0-beta.2
- v1.0.0-beta.1
- dev-refactor/inc-structure
- dev-feature/ajax-save-ux
- dev-cookie-field-below-add-cookie-to-cat-btn
- dev-feature/matomo-cookie-defaults
- dev-fix/wp-review-sanitization
- dev-feature/add-phpcs-workflow
- dev-fix/restore-category-cookie-handlers
- dev-wp-review-v1-updates
- dev-fix/keep-composer-json-in-dist
- dev-wporg-standards
This package is auto-updated.
Last update: 2026-05-28 06:52:24 UTC
README
A lightweight plugin that implements GDPR-compliant cookie consent functionality for WordPress websites using the vanilla-cookieconsent library.
Features
- 🚀 Lightweight and fast
- 🌐 Multi-language support
- 🎨 Customizable appearance
- 🔒 GDPR-compliant cookie management
- 🔁 Floating preferences toggle button — lets users revisit consent choices at any time
- 📱 Fully responsive design
- 🧩 Easy integration with WordPress
Installation
Method 1: Using WordPress Admin
- Download the plugin ZIP file from the releases page
- Go to your WordPress admin panel
- Navigate to Plugins > Add New > Upload Plugin
- Choose the downloaded ZIP file and click "Install Now"
- Activate the plugin
Method 2: Manual Installation
- Download the plugin ZIP file
- Extract the ZIP file
- Upload the extracted folder to your
/wp-content/plugins/directory - Activate the plugin through the WordPress admin panel
Method 3: Build from Source
- Clone this repository
- Install dependencies:
npm install
- Build the plugin:
npx webpack
- Upload the plugin folder to your WordPress plugins directory
Method 4: Using Composer
You can also install the plugin using Composer:
composer require imagewize/warder-cookie-consent
Usage
After activation, the cookie consent banner will automatically appear on your website. Configure the settings from the WordPress admin panel at Settings > Cookie Consent.
Configuration
You can customize the plugin through the admin interface:
- Navigate to Settings > Cookie Consent in your WordPress dashboard
- Configure the following settings:
- Language and general behavior
- Banner title and description
- Button text and actions
- Privacy policy link
- Cookie categories and patterns (NEW!)
Preferences Toggle Button
A floating cookie icon button is rendered in the page footer, giving visitors a persistent way to reopen the preferences modal and change their consent choices at any time.
- Enable/disable the button via the "Preferences Toggle Button" checkbox in General Settings
- Position it in any corner: Bottom Right (default), Bottom Left, Top Right, Top Left
- The button only appears when the plugin is enabled and the toggle option is active
Cookie Categories Management
The plugin allows you to manage cookie categories and patterns directly through the admin interface:
- Add new cookie categories like Marketing or Preferences
- Define specific cookies to block within each category
- Use regular expressions to match multiple cookies with similar names
- Automatically clear cookies when consent is withdrawn
This means you can easily configure which cookies to block and when to allow them, all without editing any code.
Cookie Categories
The default configuration includes:
- Necessary cookies: Always enabled, required for basic website functionality
- Analytics cookies: Optional tracking and analytics cookies, pre-populated with patterns for Google Analytics (
/^_ga/,_gid,_gat) and Matomo (/^_pk_/,/^mtm_/)
Plausible Analytics is cookieless by design, so it needs no patterns here — there are no cookies to clear.
Usage Examples
Blocking Google Analytics Until Consent
Add your Google Analytics script with the data-category attribute:
<script type="text/plain" data-category="analytics"> // Your Google Analytics code here </script>
The script won't execute until the visitor accepts analytics cookies.
Blocking Matomo Until Consent
Gate the Matomo tracking snippet the same way:
<script type="text/plain" data-category="analytics"> var _paq = window._paq = window._paq || []; // Your Matomo tracking code here </script>
The matching /^_pk_/ and /^mtm_/ patterns in the analytics category clear Matomo's cookies if consent is later withdrawn.
Managing Third-party Cookies
The plugin automatically handles third-party cookies by:
- Preventing scripts from loading until consent is given
- Clearing cookies if consent is withdrawn
For detailed implementation guides, see the dev.md documentation file.
Dependencies
- CookieConsent v3 - Core cookie consent functionality
- webpack - For bundling assets
- style-loader - For loading CSS
- css-loader - For processing CSS
Development
To set up the development environment:
# Install dependencies npm install # Build for production npx webpack # Watch for changes npx webpack --watch
License
This project is licensed under GPLv2 or later - see the LICENSE file for details.