Table of Contents

  1. Installation
  2. Quick Start
  3. Consent Log Menu
  4. Sections Menu
  5. Categories Menu
  6. Cookies Menu
  7. Tools Menu
  8. Maintenance Menu
  9. Options Menu
  10. Cookies Block
  11. Delete Cookies Block
  12. Revisit Consent Block
  13. Caching Plugins
  14. Geolocation
  15. Button Actions
  16. Shortcodes
  17. Credits
  18. FAQ

Installation

Please use the installation guide for installation and update instructions. The information available in this document applies to all our WordPress plugins.

Quick Start

This section will guide you in creating the two most common types of cookie notices.

Cookie Notice with a cookie policy

A cookie notice with a cookie policy allows your visitors to read the cookie policy before accepting it.

With this procedure, you will be able to create a cookie notice with one button to read the cookie policy and one button to accept the use of the cookies:

  1. Install the plugin using the procedure described on the installation guide page.
  2. Customize the text displayed in the cookie notice with the Options -> Content -> Cookie Notice -> Message Text option.
  3. Customize the text of the first button with the Options → Content -> Cookie Notice -> Button 1 Text option.
  4. Customize the text of the second button with the Options -> Content -> Cookie Notice -> Button 2 Text option.
  5. Customize the content of the modal window with the Options -> Content -> Cookie Settings -> Description Header and Options -> Content -> Cookie Settings -> Description Footer options.

Cookie notice with cookie settings

A cookie notice with cookie settings allows your customer to enable or disable specific categories of cookies.

With this procedure, you will be able to create a cookie notice with one button to open the cookie settings and one button to accept the use of the cookies:

  1. Install the plugin using the procedure described on the installation guide page.
  2. Customize the text displayed in the cookie notice with the Options -> Content -> Cookie Notice -> Message Text option.
  3. Customize the text of the first button with the Options -> Content -> Cookie Notice -> Button 1 Text option.
  4. Customize the text of the second button with the Options -> Content -> Cookie Notice -> Button 2 Text option.
  5. Customize the text displayed in the modal window associated with the click performed on the first button with the Options -> Content -> Cookie Settings -> Description Header and Options -> Content -> Cookie Settings -> Description Footer options.
  6. Visit the Sections menu and create a section named “Main Section” with a custom description.
  7. Visit the Categories menu and create a category named “First Category”. Set a custom description. Associate the category with the “Main Section” section. Enter the scripts in the Script Head and Script Body fields. These scripts are added to the page when the cookie notice is accepted.
  8. Visit the Categories menu and create a category named “Second Category”. Set a custom description. Associate the category with the “Main Section” section. Enter the scripts in the Script Head and Script Body fields. These scripts are added to the page when the cookie notice is accepted.

The Consent Log menu allows you to explore the consent log data collected by the plugin, export the consent log data in CSV format, export the proof of consent of each consent log record, and export the consolidated state of each consent log record.

Consent Log data in CSV format

Click the Export button at the top of the menu to download all the consent log data as a CSV file.

Proof of Consent

The plugin can generate proof of consent for each consent log record. This document demonstrates that you have obtained valid authorization from the user before processing their data through cookies.

The information available in the proof of consent:

  • Consent ID: The unique identifier assigned to each user’s consent record.
  • Anonymized IP address: The user’s anonymized IP address at the time of consent. Note: IPv4 IP addresses are anonymized by removing the last 16 bits. IPv6 IP addresses are anonymized by removing the last 96 bits.
  • Country Code: The ISO 3166-1 alpha-2 country code of the user. This information is only collected if the plugin geolocation feature is enabled.
  • Consent date: The specific date on which a user provided their consent for the use of cookies.
  • User agent: The User-Agent request header of the user.
  • URL: The specific URL for which the user has given consent to the use of cookies.
  • Encrypted key: A key generated by applying the SHA-512 hashing algorithm to the collected consent state in JSON format. Note that the same key is also stored in the user’s browser as the value of the daextlwcn-encrypted-key cookie.

To download the proof of consent, click the Download button under the Proof of Consent column.

Consent state

The consent state includes all the information available in the cookie notice at the time of consent, along with the cookie preferences selected by the user.

You can download the consent state in JSON format by clicking the Download button under the State column.

Sections Menu

The Sections menu should be used to create sections. The sections are displayed in the cookie settings modal windows and used to group categories.

Each section has the following fields:

FieldDescription
NameThe name of the section. This value is displayed in the cookie settings modal window. 
DescriptionThe description of the section. This value is displayed in the cookie settings modal window.
PriorityThe priority value determines the order used to display the sections.

Categories Menu

The Categories menu should be used to create categories. The categories are displayed in the cookie settings modal window and used to give visitors the ability to enable or disable specific cookie categories.

Each category has the following fields:

FieldDescription
NameThe name of the category. This value is displayed in the cookie settings modal window. 
DescriptionThe description of the category. This value is displayed in the cookie settings modal window.  
Active ToggleThis option determines if the toggle should be enabled. An active toggle allows the visitor to enable or disable the cookie category.
Initial StateThis option determines the initial state of the category.
SectionThe section where the category will be displayed.
Script HeadThe plugin adds this script to the head section of the page when the cookie notice is accepted. Please note that the script tag should always wrap your code.
Accept Cookies ScriptThe JavaScript code that the plugin should execute when the user clicks a button associated with an “Accept Cookies” action, and this category is enabled.
Script BodyThe plugin adds this script just before the closing body tag when the cookie notice is accepted. Please note that the script tag should always wrap your code.
Consent Mode ParametersThe Google consent mode parameters that will be enabled when the user consents to this category.
PriorityThe priority value determines the order used to display the categories.

Cookies Menu

The Cookies menu should be used to store information about the individual cookies used on the website.

You can display the cookies added to this menu in the following contexts:

  • Inside post, page, or custom post types by using the Cookies Block
  • In a category displayed in the cookie settings modal window

It’s worth noting that the cookies defined in this menu are also used by the Delete Cookies Block.

Tools Menu

Import 

The Import section allows you to import the plugin data (categories, sections, cookies, and category acceptance statistics) previously exported with the Export menu.

Follow this procedure to import the plugin data:

  1. Click the Choose File button
  2. Select the XML file that includes the data
  3. Click the Upload file and import button

Export

With the Export section, you can generate an XML file that includes all the plugin data (categories, sections, cookies, and category acceptance statistics).

Follow this procedure to export your data:

  1. Click the Export button
  2. The browser will download the XML file in the default download folder of your operative system

Maintenance Menu

The Maintenance menu allows you to perform operations on the plugin data.

The following tasks are available:

TaskDescription
Reset PluginThis task restores the initial value of the plugin options and deletes all the plugin data.
Reset Consent LogThis task deletes all the consent log records.
Delete TransientThis task deletes the transient associated with the cookie notice.

 To execute a task, proceed as follows:

  1. Visit the Cookie Notice -> Maintenance menu
  2. With the Task field, select the task that you want to perform
  3. Click the Execute Task button

Options Menu

The Options menu includes a high number of options that you can use to customize aspects like:

  • The style and content of the cookie notice
  • The style and content of the cookie settings modal window
  • The geolocation feature
  • The capabilities required to access the plugin menu
  • Technical functionalities of the plugin

For more information about a single option, hover the mouse over the question mark on the right side of the option. The plugin will display a tooltip with additional information.

Cookies Block

The Cookies block allows you to include a table with the cookies defined in the Cookies Menu inside posts, pages, and custom post types.

General Information

To include the Cookies block in a post, page, or custom post type, proceed as follows:

  1. Edit a post, page, or custom post type.
  2. Enable the Visual Editor.
  3. Click on the Add Block button.
  4. Select the Cookies block.
  5. Customize the behavior of the block with the options available in the Settings Sidebar.
  6. Click the Publish/Update button to apply your changes.

Block options

The Cookies block includes the following options in the Settings Sidebar:

  • Category

Delete Cookies Block

The Delete Cookies block allows you to display a button that deletes:

  • The cookies set by this plugin
  • The cookies defined in the Cookies menu

The Revisit Consent block allows you to display a button that allows the user to change their cookie preferences.

General Information

To include the Delete Cookies block in a post, page, or custom post type, proceed as follows:

  1. Edit a post, page, or custom post type.
  2. Enable the Visual Editor.
  3. Click on the Add Block button.
  4. Select the Delete Cookies block.
  5. Click the Publish/Update button to apply your changes.

Caching Plugins

Lightweight Cookie Notice supports the most common caching plugins.

WP Super Cache

The plugin is already optimized to work with WP Super Cache. No actions are required.

W3 Total Cache

To use Lightweight Cookie Notice with the W3 Total Cache plugin, proceed as follows:

  1. In the Cookie Notice -> Advanced -> Behavior section of the Lightweight Cookie Notice plugin enable the Page Fragment Caching Exception (W3TC) option and save your changes.
  2. Visit the Performance -> General Settings menu of W3 Total Cache.
  3. In the Page Cache section, set the Page Cache Method option to “Disk: Basic”.
  4. Save your changes.
  5. Visit the Performance -> Page Cache menu of W3 Total Cache.
  6. In the Advanced section, enable the Late initialization option.
  7. Save your changes.
  8. Clear the W3 Total Cache plugin cache.

LiteSpeed Cache

To use Lightweight Cookie Notice with the LiteSpeed Cache plugin, proceed as follows:

  1. Visit the LiteSpeed Cache -> Cache menu
  2. Add “daextlwcn” in the Login Cookie option
  3. Save your changes
  4. Clear the cache

SG Optimizer

To use Lightweight Cookie Notice with the SG Optimizer plugin, you have to exclude the following cookies on the server level:

  • daextlwcn-accepted
  • daextlwcn-category-status
  • daextlwcn-encrypted-key

WP Fastest Cache

To use Lightweight Cookie Notice with the WP Fastest Cache plugin, proceed as follows:

  1. Visit the WP Fastest Cache menu.
  2. Select the Exclude tab.
  3. Click on the Add New Rule button.
  4. In the Exclude Page Wizard modal window select “Contain” and enter “daextlwcn” in the text field.
  5. Save your changes.
  6. Clear the cache.

Geolocation

Using the geolocation feature, you can optionally display the cookie notice to visitors from specific countries. The visitor’s position is retrieved with the HostIP.info service or the MaxMind GeoLite2 database.

Please note that:

  • The results provided by these two geolocation services are not 100% accurate.
  • You have to follow the terms of these services.

Geolocation with HostIP.info 

To enable the geolocation with HostIP.info please proceed as follows:

  1. Enable the Options -> Geolocation -> General -> Geolocation option.
  2. Set the Options -> Geolocation -> General -> Service to “HostIP.info”.
  3. Select the countries where the plugin should display the cookie notice with the Options -> Geolocation -> General -> Locale option.
  4. Save your changes.

Geolocation with MaxMind GeoLite2 

Lightweight Cookie Notice supports the GeoLite2 IP geolocation database provided by MaxMind.

To enable the geolocation with MaxMind GeoLite2, please proceed as follows:

  1. Set the Options -> Geolocation → General -> Geolocation option to “Enabled”.
  2. Set the Options -> Geolocation → General -> Service to “MaxMind GeoLite2”.
  3. Select the countries where the plugin should display the cookie notice with the Options -> Geolocation -> General -> Locale option.
  4. Enter the path where you have stored the GeoLite2 Country database in the Options -> Geolocation -> Maxmind Geolite2 -> Country Database File Path option.
  5. If you intend to use the Options -> Geolocation -> Maxmind Geolite2 → Subdivision option, enter the path where you have stored the GeoLite2 City database in the Options -> Geolocation -> Maxmind Geolite2 -> Country Database File Path option.

Button Actions

From the plugin settings, you can associate actions to the buttons available in the cookie notice and in the cookie settings modal window.

Below is a list of the actions with the related behavior and availability:

ActionBehaviorAvailability
Open Cookie SettingsThe cookie settings modal window is opened.Cookie Notice
Close Cookie SettingsThe cookie settings modal window is closed.Cookie Settings
Close Cookie NoticeThe cookie notice is closed.Cookie Notice
Redirect to URLPerforming a click on the button redirects the user to the defined URL.Cookie Notice and Cookie Settings
Accept CookiesThe cookie that stores the status of the categories is created. Note that the status of the cookie categories is based on the status defined in the back-end from the Cookie Notice -> Categories menu. If the user makes any change using the provided toggles available in the cookie settings modal window, these newly defined settings are used. After that, the cookie notice and the cookie settings modal window are closed.Cookie Notice and Cookie Settings
Accept All CookiesThe cookie that stores the status of the categories is created with all the cookie categories enabled. Then, the cookie notice and the cookie settings modal window are closed.Cookie Notice and Cookie Settings
Reject All CookiesThe cookie that stores the status of the categories is created with all the cookie categories disabled. Then, the cookie notice and the cookie settings modal window are closed.Cookie Notice and Cookie Settings

Shortcodes

As a secondary method to include the layout elements generated by the plugin in the posts, you can use the following WordPress shortcodes:

Layout ElementShortcode TagParameters
A table to list the defined cookies[ cookies ]category-id
A button to delete the plugin cookies and the defined cookies[ delete-cookies ]N/A
A button that allows the user to change their cookie preference[ revisit-consent ]N/A

 Example 1

Display the cookies that are not associated with a category.

[ cookies ]

Example 2

Display the cookies associated with the category with an ID equal to “2”.

[ cookies category-id="2" ]

Example 3

Display a button that deletes the cookies set by this plugin:

[ delete-cookies ]

Example 4

Display a button that allows the user to change their cookie preferences:

[ revisit-consent ]

Credits

This plugin makes use of the following resources:

Disclaimer

This product can include GeoLite2 data created by MaxMind, available from https://www.maxmind.com.

FAQ

Can I include HTML tags in the textarea fields available in the back-end?

Yes, the following HTML tags are supported:

  • p
  • a
  • strong
  • br
  • ol
  • ul
  • li

How do I share the plugin cookies on subdomains?

Using the Options -> Advanced -> Cookie Attributes -> Domain option you can define the host to which the cookie will be sent.

Setting the domain will make the cookie available to it, as well as to all its subdomains.

If omitted, this attribute defaults to the host of the current document URL, not including subdomains.

Example 1

To set the plugin cookies only on the main domain, set the Options -> Advanced -> Cookie Attributes -> Domain option to an empty value.

Example 2

To set the plugin cookies on the main domain and the subdomains, set the Options -> Advanced -> Cookie Attributes -> Domain option to your site domain (E.g., example.com).

How to enable Google Consent Mode?

The plugin supports Google Basic Consent Mode. To enable this feature via the plugin options, proceed as follows:

  1. Enable the Options -> Advanced -> Google Consent Mode -> GTM Basic Consent Mode option.
  2. Enter the Google Tag Manager container ID in the Options -> Advanced -> Google Consent Mode -> GTM Container ID option.
  3. Save your changes.

When this feature is enabled, you can select the consent mode parameters that will be enabled when the user consents to the categories using the Consent Mode Parameters option available in the Advanced section of the categories created using the Categories menu.

How do I add the revisit consent functionalities to custom HTML elements?

You can activate the revisit consent functionalities by adding the daextlwcn-revisit-consent-trigger class to any element on the page.

Example 1

Create a button HTML element that activates the revisit consent functionalities:

<button class="daextlwcn-revisit-consent-trigger">Revisit Consent</button>
Example 2

Create a span HTML element that activates the revisit consent functionalities:

<p>Change your cookie preferences by clicking <span class="daextlwcn-revisit-consent-trigger">here</span>.</p>

Which versions of PHP are supported?

 PHP 7.2.0 and later versions are supported.

Which versions of WordPress are supported?

 WordPress 5.0 and later versions are supported.