BACK TO DIRECTORY

ConsentSprout – Cookie Consent Manager

by Anand Bajrangi

0.0
(0 ratings)

ConsentSprout displays a configurable consent banner and preference panel. Visitors can accept all optional categories, reject them, or choose functional, analytics, and marketing categories separately. Necessary storage is always enabled.

Consent choices are stored in the visitor’s browser using localStorage. ConsentSprout does not send consent records to a remote server and does not set cookies or collect personal data. If browser storage is blocked, a choice remains effective only for the current page view.

This plugin is a technical consent tool. It does not guarantee legal compliance. Site owners are responsible for configuring the plugin and integrations for their own legal and operational requirements. ConsentSprout cannot automatically detect or block every script from themes, plugins, tag managers, or custom code; those integrations must be configured by the site owner.

No external services, remote assets, analytics, or telemetry are used.

Integration

For an external script, change src to data-src, set type="text/plain", and specify a category. Example:

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

For inline code, use the same type and category attributes and put the code in the element. Only do this for scripts you control. Do not put executable third-party code into unsanitized admin settings.

Categories are functional, analytics, and marketing. necessary is always true. This mechanism only applies to scripts explicitly marked for ConsentSprout. It cannot prevent a separate plugin or theme from loading the same script by another route.

JavaScript API

The API is available as window.ConsentSprout after the plugin script loads:

  • ConsentSprout.getConsent() returns the category object or null before a choice is saved.
  • ConsentSprout.hasConsent('analytics') returns a boolean.
  • ConsentSprout.openPreferences() opens the preference panel.
  • ConsentSprout.withdraw() withdraws optional consent by saving all optional categories as false.
  • ConsentSprout.onChange(function(categories) {}) registers a consent-change callback.
  • document emits consentsprout:consent-ready and consentsprout:consent-changed CustomEvents with consent data in event.detail.

Use [consentsprout_preferences] in a post or page to display a link-style button that opens preferences.

Privacy

ConsentSprout stores the category selection, policy version, choice time, and expiry time in localStorage on the visitor’s device. It does not transmit this data to the site or a third party. The storage key is consentsprout_consent. Clearing browser storage removes the saved choice. The site owner can change the consent lifetime in settings. Necessary storage supports remembering that choice; optional categories remain off until selected.

Screenshots

The consent banner on the front end, with Accept all, Reject non-essential, and Manage preferences buttons.

The consent banner on the front end, with Accept all, Reject non-essential, and Manage preferences buttons.

The preference panel lets visitors choose functional, analytics, and marketing categories. Strictly necessary storage is always on.

The preference panel lets visitors choose functional, analytics, and marketing categories. Strictly necessary storage is always on.

Settings &gt; ConsentSprout: banner text, privacy policy link, policy version, consent duration, banner position, and optional categories.

Settings > ConsentSprout: banner text, privacy policy link, policy version, consent duration, banner position, and optional categories.

The banner and preference panel on a mobile screen.

The banner and preference panel on a mobile screen.

After a choice is saved, a Privacy settings button lets visitors change their preferences at any time.

After a choice is saved, a Privacy settings button lets visitors change their preferences at any time.

Plugin Details

Active Installs
0
Total Downloads
132
Version
1.0.3
Requires WP
6.2
Requires PHP
7.4
Tested Up To
7.1.4
Added
2026-10-31
Last Updated
2026-10-31 8:57am GMT

Ratings

5
0
4
0
3
0
2
0
1
0