WP Manifestindependent plugin directory
manifest / privacy / lw-cookie

LW Cookie #3 in Privacy & Compliance

GDPR-compliant cookie consent banner for WordPress — minimal footprint, full compliance

★ 9stars
239release downloads
≈20active sites
1.5kcomposer installs
v1.9.7latest · 1d ago

Install

Download lw-cookie-1.9.7.zip From the v1.9.7 release on GitHub, Oct 21, 2026

Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/lwplugins/lw-cookie/releases/download/v1.9.7/lw-cookie-1.9.7.zip

On Packagist as lwplugins/lw-cookie:

composer require lwplugins/lw-cookie
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

GDPR-compliant cookie consent banner for WordPress - minimal footprint, full compliance.

LW Cookie Settings

Features

GDPR Compliance

  • Opt-in by default - All optional categories are OFF until user consents
  • Granular category selection - Necessary, Functional, Analytics, Marketing
  • Consent logging - Timestamp and policy version for compliance proof
  • Policy version tracking - Automatic re-consent on policy changes
  • Anonymized IP logging - GDPR-compliant data storage

Cookie Banner

  • Customizable position (top, bottom, modal)
  • Customizable layout (full-width bar, floating box)
  • Customizable colors and border radius
  • Accept All / Reject All / Customize buttons
  • Floating button for easy access to preferences

Script Blocking

Automatic blocking of known tracking scripts until consent:

  • Google Analytics / Google Tag Manager
  • Facebook Pixel
  • Hotjar
  • LinkedIn Insight Tag
  • Twitter/X Pixel
  • TikTok Pixel
  • Microsoft Clarity
  • Pinterest Tag
  • Snapchat Pixel

Content Blocking

Block third-party embeds until consent is given:

  • YouTube videos
  • Vimeo videos
  • Google Maps
  • Other iframes

Cookie Scanner

Detect cookies on your website:

  • Server-side scanning (detects HttpOnly cookies)
  • Deep scan with remote headless browser
  • Cookie Database API integration (2000+ known cookies)
  • Automatic cookie enrichment with provider, purpose, duration

Google Consent Mode v2

  • Built-in support for Google Consent Mode v2
  • Loads at highest priority (before any tracking script)
  • EEA region-specific defaults
  • Required for Google Ads and Analytics in the EU
  • Automatic consent signal updates

Meta Pixel (Facebook) Support

  • Automatic fbq('consent', 'revoke/grant') API calls
  • Works with existing Facebook Pixel implementations

Third-Party Plugin Integration

  • dataLayer.push events for GTM triggers (lw_cookie_consent_update)
  • WordPress filters for querying consent state
  • Script blocking override filter for plugin compatibility

WP-CLI Support

Full command-line management:

wp lw-cookie settings list              # List all settings
wp lw-cookie settings set enabled true  # Change settings
wp lw-cookie stats                      # View consent statistics
wp lw-cookie export --format=csv        # Export consent logs
wp lw-cookie clear-logs --older-than=365 # Clean up old logs

Installation

Via Composer (Recommended)

composer require lwplugins/lw-cookie

Manual Installation

  1. Download the latest release
  2. Upload the lw-cookie folder to /wp-content/plugins/
  3. Activate the plugin through the 'Plugins' menu
  4. Go to LW Plugins → Cookie to configure

Configuration

Navigate to LW Plugins → Cookie in your WordPress admin to access settings:

Tab Description
General Enable/disable, privacy policy page, policy version
Appearance Position, layout, colors, border radius
Categories Customize category names and descriptions
Texts Banner title, message, and button labels
Advanced Consent duration, script blocking, Google Consent Mode
Category Required Description
Necessary Yes Essential cookies for website function
Functional No Enhanced functionality and personalization
Analytics No Visitor analytics and statistics
Marketing No Advertising and remarketing

JavaScript API

// Accept all cookies
LWCookie.acceptAll();

// Reject all optional cookies
LWCookie.rejectAll();

// Open preferences modal
LWCookie.openPreferences();

// Get current consent state
const consent = LWCookie.getConsent();
// { necessary: true, functional: false, analytics: false, marketing: false }

// Check if category is allowed
if (LWCookie.isAllowed('analytics')) {
    // Load analytics scripts
}

// Listen for consent changes
window.addEventListener('lwCookieConsent', function(e) {
    console.log('Categories:', e.detail.categories);
    console.log('Action:', e.detail.action);
});

// Delete all cookies (for "forget me" functionality)
LWCookie.deleteAllCookies();

WordPress Hooks (PHP)

For third-party plugin integration:

// Get all consent categories
$categories = apply_filters( 'lw_cookie_consent_categories', [] );
// ['necessary' => true, 'functional' => false, 'analytics' => true, 'marketing' => false]

// Check if user has given any consent
$has_consent = apply_filters( 'lw_cookie_has_consent', false );

// Check if specific category is allowed
$analytics_ok = apply_filters( 'lw_cookie_is_category_allowed', false, 'analytics' );

// Prevent blocking specific scripts (e.g., if your plugin handles consent)
add_filter( 'lw_cookie_should_block_script', function( $should_block, $handle, $src, $category ) {
    if ( $handle === 'my-plugin-pixel' ) {
        return false; // Don't block, I handle consent myself
    }
    return $should_block;
}, 10, 4 );

GTM Integration

The plugin pushes events to dataLayer for GTM triggers:

// Fired on every consent change
{
    event: 'lw_cookie_consent_update',
    lw_cookie_consent: {
        necessary: true,
        functional: true,
        analytics: true,
        marketing: false
    },
    lw_cookie_action: 'customize' // or 'accept_all', 'reject_all'
}

Requirements

  • PHP 8.2 or higher
  • WordPress 6.0 or higher

Documentation

Full documentation is available in the docs folder:

Part of LW Plugins

LW Cookie is part of the LW Plugins family - lightweight WordPress plugins with minimal footprint and maximum impact.

Plugin Description
LW SEO Essential SEO features without the bloat
LW Disable Disable WordPress features like comments
LW Site Manager Site maintenance via AI/REST
LW Memberships Lightweight membership system
LW LMS Courses, lessons, and progress tracking
LW Cookie GDPR-compliant cookie consent

License

GPL-2.0-or-later. See LICENSE for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Sponsor

Sinann

Supported by Sinann

Releases

Newest 25 of 53 recorded releases. Each count is every asset in that release; expand a row for the breakdown.

Tag
Published
Assets
Downloads
v1.9.7 latest
Oct 21, 2026 1d ago
lw-cookie-1.9.7.zip
2
Oct 21, 2026 1d ago
lw-cookie-1.9.6.zip
4
Oct 16, 2026 6d ago
lw-cookie-1.9.5.zip
8
Oct 15, 2026 7d ago
lw-cookie-1.9.4.zip
9
Oct 14, 2026 8d ago
lw-cookie-1.9.3.zip
3
Oct 11, 2026 11d ago
lw-cookie-1.9.2.zip
5
Oct 3, 2026 19d ago
lw-cookie-1.9.1.zip cohort
17
Oct 2, 2026 20d ago
lw-cookie-1.9.0.zip
5
Sep 26, 2026 26d ago
lw-cookie-1.8.3.zip
7
Sep 25, 2026 27d ago
lw-cookie-1.8.2.zip
4
Sep 25, 2026 27d ago
lw-cookie-1.8.1.zip
1
Sep 24, 2026 28d ago
lw-cookie-1.8.0.zip
3
Sep 22, 2026 1mo ago
lw-cookie-1.7.7.zip
5
Sep 22, 2026 1mo ago
lw-cookie-1.7.6.zip
2
Sep 17, 2026 1mo ago
lw-cookie-1.7.5.zip
12
Sep 17, 2026 1mo ago
lw-cookie-1.7.4.zip
4
Sep 6, 2026 1mo ago
lw-cookie-1.7.3.zip
14
Aug 20, 2026 2mo ago
lw-cookie-1.7.2.zip
10
Jul 26, 2026 2mo ago
lw-cookie-1.7.1.zip
13
Jul 18, 2026 3mo ago
lw-cookie-1.7.0.zip
0
May 3, 2026 5mo ago
lw-cookie-1.6.9.zip
30
Apr 30, 2026 5mo ago
lw-cookie-1.6.8.zip
4
Apr 26, 2026 5mo ago
lw-cookie-1.6.7.zip
0
Apr 23, 2026 6mo ago
lw-cookie-1.6.6.zip
2
Mar 22, 2026 7mo ago
lw-cookie-1.6.5.zip
14
All releases on GitHub →

Active-site estimate ≈20 comes from the v1.9.1 cohort. Method.