Shortcodes – GDPR Cookie Consent Plugin

Last updated on May 23, 2024

The GDPR Cookie Consent (CCPA) plugin uses shortcodes to customize your cookie consent banner according to your requirements. You can apply these shortcodes to any page or post.

Get Started

To customize your cookie banner using shortcodes:

  1. Install and activate the GDPR Cookie Consent plugin via Plugin Setup.
  2. Navigate to GDPR Cookie Consent > Settings.
  3. Go to the Customise Cookie Bar tab and select Message.
  4. Add the required shortcodes in the Message text box and click on Update Settings.
  5. Reload the website to view the changes in the cookie banner.
Customise Cookie Bar
[cookie_button]

This shortcode adds an Accept button that records users’ consent for the usage of cookies on your website. You can customize the accept button using the options provided in the Accept Button section of the Customize Buttons tab.

Accept Button
[cookie_settings]

This shortcode adds a Cookie Settings button, giving users detailed control over cookie categories they consent to. Clicking the Settings button opens a popup where users can select the cookie categories they want to accept. To customize this button, navigate to the Settings Button section of the Customize Buttons tab.

Settings Button
[cookie_reject] 

The Reject All button rendering shortcode records the users’ denial of the use of any cookies by the website. Customize the reject button to match your site’s theme by accessing the Reject Button section within the Customize Buttons tab.

Reject Button
[cookie_link]

This shortcode allows adds a Read More link, which directs users to another URL or page within the website. It allows users to link to the website’s privacy policy page.

Read More Link

You can add the URL or page to which the shortcode links from the Read More section under the Customize Buttons tab. The link can also be customized from the same page.

Customize Read More
[cookie_close]

The shortcode renders a Close button on the cookie banner.

Close Button

Other Shortcodes

[cookie_audit]

To inform users about the cookies used on the website, apply this shortcode. It will display all cookies and related details in a tabular format wherever it is placed.

Audit Table

The shortcode allows you to use style attributes with values such as simple, classic, modern, rounded, elegant, and winter. The table style is set to classic by default. For example, the provided shortcode generates an audit table with the ‘winter’ style.

[cookie_audit style="winter"]
Winter Style
[cookie_audit style="winter" not_shown_message="Not found"] 

or

[cookie_audit not_shown_message="No cookies found"]

You can use the attribute not_shown_message to display a message in the table when there are cookies to show.

No cookies found
[cookie_audit columns="cookie,description"]

The shortcode generates a cookie audit table displaying only the cookie names and descriptions.

Description
[cookie_audit heading="The below list details the cookies used in our website."]

To create a cookie audit table with the heading, ‘The list below details the cookies used in our website’, use this shortcode.

Table heading
[cookie_audit category="analytics"]


The above shortcode displays cookies within the analytics category. You can modify it to display only your desired category according to your requirements.

Category
[delete_cookies]

This shortcode generates a link that, upon clicking, deletes non-essential cookies specified in the plugin.

[delete_cookies text="Click here to delete"]

The shortcode uses the text attribute to display the text ‘Click here to delete’. Clicking it deletes non-essential cookies in the plugin.

[cookie_after_accept]Your Content goes here... [/cookie_after_accept]

Content placed between these enclosing shortcodes will only appear if the user has accepted the cookies. This shortcode restricts content to users who haven’t accepted the cookies.

Have more questions?

Reach out to us and we'll answer them.

Contact us