Shortcodes Used in GDPR Cookie Consent Plugin

The Ultimate WordPress Plugin for EU Cookie Law (GDPR) Compliance

Used by 400,000+ WooCommerce Stores

#1 in Customer Satisfaction

WebToffee Guarantee: Get Your Money Back if You Are Not Satisfied With The Product

Buy Now!

The GDPR Cookie Consent plugin helps to create a cookie notification bar on a WordPress Website and take consent to the use of cookies. It also helps easily customize the components of the cookie bar. In addition to this, the plugin gives a great flexibility with shortcodes for multiple purposes that can be used on any pages or posts on the website.

Below are all of the shortcodes used in the GDPR Cookie Consent plugin and what they are used for.

Cookie Bar Shortcodes

[cookie_accept]: This shortcode adds an Accept button that already styled, in green color, and closes the header when clicked on. The shortcode can be used on the cookie notification bar to take the consent of the user.

Button using [cookie_accept] shortcode
[cookie_accept]
[cookie_accept colour=”blue”]: You can change the color of the Accept button from the set of pre-defined value for the colour attribute. You can choose from the colors red, blue, yellow, orange, green, or pink. Make sure to use the UK spelling of ‘colour’.

[cookie_button]: This shortcode adds the Accept button wherever it is applied from the backend of the website. Clicking on the button will register the consent for the usage of the cookies. The button added using this shortcode can be customized with the customization options given in the Accept section of the Customize Buttons tab on the Cookie Law Settings page.

Accept button
[cookie_button]
[cookie_settings]: This is the cookie settings button rendering shortcode. The Settings button gives the users the granular control over the categories of cookies that they want to give consent to. When the user clicks on the Settings button, the user is shown a popup where they can select which cookie categories that they want to accept.

Settings Button
[cookie_settings]
[cookie_reject]: This shortcode adds the Reject button that can be customized from the Cookie Law Settings page. The reject buttons thus added records the denial of the user to the use of any cookies by the website, when clicked upon.

Reject button using [cookie_reject]
[cookie_reject]
[cookie_link]: This simple shortcode can be used to add the Read More link that can be linked to another URL or page on the website. This shortcode can be used to provide a link that can be redirected to the website’s privacy policy page. The URL or the page to which the shortcode links to is added from the Read More Link section under the Customize Buttons tab on the Cookie Law Settings page. The link can also be customized from the same page.

Read more link using [cookie_link]
[cookie_link]

Other Shortcodes

[cookie_audit]: Since the website owner is required to inform the users of the cookies that are used in the website, this simple shortcode can be used to display all the cookies and its related details to be displayed in a tabular format wherever the shortcode is added. You can add the shortcode to your privacy policy page to inform the users of the cookies that are used on the website.

Cookie audit table
Audit table using [cookie_audit] shortcode
The shortcode takes the attributes style with values simple, classic, modern, rounded, elegant, winter. The table by default has the style classic. For example, the shortcode [cookie_audit style=”winter”] will add an audit table that looks as below.

Cookie audit table with style="winter"
Cookie audit table with style=”winter”

To display a message in the table if there are cookies to display, you can use the attribute not_shown_message. For example: [cookie_audit style=”winter” not_shown_message=”No cookies found”]

Cookie audit table with no cookies found
Cookie audit table with no cookies found

[cookie_audit_category]: This shortcode is also used for displaying the cookies that have been added to the plugin in a tabular format but organized into categories. The table will list the cookies according to the categories that they belong to as defined by the user.

Cookie audit table with cookie category
Cookie audit table with cookie category

[cookie_popup_content]: This shortcode can be used to display the popup that appears when the Settings button is clicked, wherever the shortcode is applied.

Settings popup content using [cookie_popup_content]
Settings popup content using [cookie_popup_content]
[delete_cookies] or [delete_cookies text=”Click here to delete”]: This shortcode adds a link that when clicked upon deletes all the cookies that are specified in the plugin as a non-necessary cookie.

Delete cookies link using [delete_cookies] shortcode
[delete_cookies]
when the attribute text is used with the shortcode [delete_cookies] the link looks as shown below:

Cookie delete link with text="click here to delete"
text=”click here to delete”

[cookie_after_accept]Your Content goes here… [/cookie_after_accept]: Any content that is added in between these enclosing shortcodes will only be displayed if the cookie has been accepted. So this shortcode can be used to restrict any content to the users if they have not accepted the cookies.

[cookie_after_accept category=”category1-slug”]Your content goes here… [/cookie_after_accept]: The category attribute of the shortcode allows to restrict the content enclosed based on the category of the cookies specified. More than one categories can be specified and the content will be visible if all the categories of the cookies are enabled. For example, if you specify two categories in the “category” attribute of the shortcode, say Analytics and Marketing, if the user disables the cookies in the Analytics category, the content inside the shortcode will not be made available to the users. It is only when both the categories are enabled, that the users are able to access the content.

[cookie_after_accept category=”category1-slug, category2-slug” condition=”or”]Your content goes here… [/cookie_after_accept]: The attribute condition with value “or” allows you to display the content specified with the shortcode to be displayed if any of the categories mentioned are enabled. For example, if for there are two categories mentioned in the category attribute Analytics and Marketing, and the user enables any of the categories, the content inside the enclosing shortcodes will be made available to the users.

The Ultimate WordPress Plugin for EU Cookie Law (GDPR) Compliance

Used by 400,000+ WooCommerce Stores

#1 in Customer Satisfaction

WebToffee Guarantee: Get Your Money Back if You Are Not Satisfied With The Product

Buy Now!

Leave a Reply

Your email address will not be published. Required fields are marked *