WP Manifestindependent plugin directory
manifest / privacy / simple-consent-banner

Simple Consent Banner

a very simple consent banner plugin for wordpress

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/tran00/simple-consent-banner/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

A consent banner for managing user analytics preferences with localStorage persistence.

Description

Simple Consent Banner displays a GDPR-compliant consent banner on your WordPress site, allowing users to accept or reject analytics cookies. The plugin uses localStorage to persist user preferences and dispatches custom events for integrating with analytics solutions.

Features:

  • Simple, elegant consent banner UI
  • localStorage persistence of user preferences
  • Custom event dispatching for analytics integration
  • Automatic activation of deferred analytics scripts
  • Full i18n support for translations
  • Responsive design

Installation

  1. Upload the simple-consent-banner folder to /wp-content/plugins/
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. The banner will appear at the bottom of your site

Usage

Once activated, the banner appears automatically on all pages.

Analytics Script Integration

To defer analytics scripts until user consent:

<script type="text/plain" data-consent-category="analytics" src="https://example.com/analytics.js"></script>

JavaScript API

// Check if user has accepted analytics
window.inplaceConsent.hasAnalyticsConsent();

// Programmatically accept/reject
window.inplaceConsent.acceptAnalytics();
window.inplaceConsent.rejectAnalytics();

// Listen for consent changes
window.addEventListener('inplace-consent-change', function(event) {
  console.log('Analytics accepted:', event.detail.analytics);
});

Changelog

1.0.0

  • Initial release

License

This plugin is licensed under the GPL v2 or later.