A lightweight plugin that implements GDPR-compliant cookie consent functionality for WordPress websites using the vanilla-cookieconsent library.
- 🚀 Lightweight and fast
- 🌐 Multi-language support
- 🎨 Customizable appearance
- 🔒 GDPR-compliant cookie management
- 📱 Fully responsive design
- 🧩 Easy integration with WordPress
- 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
- 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
- Clone this repository
- Install dependencies:
npm install
- Build the plugin:
npx webpack
- Upload the plugin folder to your WordPress plugins directory
You can also install the plugin using Composer:
composer require imagewize/simple-cookie-consent
After activation, the cookie consent banner will automatically appear on your website. Configure the settings from the WordPress admin panel at Settings > Cookie Consent.
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!)
The plugin now 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.
The default configuration includes:
- Necessary cookies: Always enabled, required for basic website functionality
- Analytics cookies: Optional tracking and analytics cookies
Add your Google Analytics script with the data-cookiecategory
attribute:
<script type="text/plain" data-cookiecategory="analytics">
// Your Google Analytics code here
</script>
The script won't execute until the visitor accepts analytics 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.
- CookieConsent v3 - Core cookie consent functionality
- webpack - For bundling assets
- style-loader - For loading CSS
- css-loader - For processing CSS
To set up the development environment:
# Install dependencies
npm install
# Build for production
npx webpack
# Watch for changes
npx webpack --watch
This project is licensed under the MIT License - see the LICENSE file for details.