The GDPR Cookie Consent plugin creates a cookie notification bar on a WordPress website and obtains consent for the use of cookies. It uses shortcodes, simple codes that make it easy for website owners to add cookie consent banners and configure the banner settings. Understanding and utilizing these shortcodes effectively ensures a seamless user experience.
Shortcodes List
Shortcode | Description | Screenshot |
---|---|---|
[wcc_accept] | This shortcode adds an Accept button that closes the header when clicked. It can be used on the cookie notification bar to obtain the user’s consent. | |
[wcc_preference_button] | This shortcode will add a cookie settings link to the page, which, when clicked, opens the second layer of the banner. | |
[wcc_reject] | This shortcode adds the Reject button. When clicked, the reject button records the user’s denial of the website’s use of cookies. | |
[wcc_privacy_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 provide a link that can be redirected to the website’s cookie policy page. | |
[wcc_cookies_audit_table] | Since the website owner must inform users of the cookies used on the website, this simple shortcode can display all the cookies and their related details in a tabular format wherever the shortcode is added. You can add the shortcode to your cookie policy page to inform users of the cookies used on the website. | Cookie Audit Table |
[wcc_category_list] | This shortcode displays the cookies scanned by the plugin in a tabular format. The table lists the cookies according to the categories they belong to, as defined by the user. | Category Wise Listing of Cookies |
[wcc_preference_category] | This shortcode can display the popup that appears when the Customize button is clicked, wherever the shortcode is applied. | Preference Category |
Steps to add shortcode
You can add shortcodes to WordPress posts, pages, and cookie notice messages. Follow the steps mentioned below to add the shortcodes to the required location.
- To add a shortcode to a page or post, open the page or post where you want to add the shortcode, include the shortcode element, and type the required shortcode inside the shortcode element.
- To add a shortcode to the cookie notice bar, navigate to Cookie consent > Cookie banner > Content & Colors> Cookie Notice. Inside the Message textbox, add the required shortcode.
Related Articles :
maria jose
March 20, 2024
Hi
How Can I show the date of the last cookies scan in the cookies poilicy page
Thanks in advance
MJose
Hema
April 2, 2024
Hello Maria,
Thanks for reaching out. This feature is currently not available in the plugin. We will make sure to add this to our backlog for feature updation.
MIGUEL
November 25, 2022
Can shortcodes be used in the new version?
Thanks.
Mark
December 4, 2022
Hi Miguel,
Greetings from Webtoffee!
The latest premium and free versions of our plugin will support these shortcodes. However, if you are referring to the latest revamped free plugin that is available for newer websites, these shortcodes will not work on it.
Terry
February 19, 2022
I am not a coder so i don’t how or were to put the short code [reject_all] so it shows up as a button. Can you advise please. I have tried a few things but it doesn’t work for me. Thank you
Mark
February 22, 2022
Hi Terry,
We are here to assist!
Kindly add the short code [reject_all] to GDPR Cookie Consent > Settings > Customise Cookie Bar > Cookie Bar > Message box.
Rodrigo
August 19, 2021
Hi Mark! I’m here trying to use the “cookie_after_accept” with the modifier “category=functional-XX” where XX is a language identifier.. i.e: functional-en, functional-br, functional-es (for english, brazilian portuguese and spanish)… well, all the translations work very good with the slugs… but the same don’t occur with de modifier “category”. Ps.: I tried with the modified and with the “original” slugs.
Its mandatory the “condition” modifier use? Let’s supose i have all my consents set to “Disable” and i want to show some content only after the user set “Functional cookies” to “Enabled”. However, the user only set the “Performance” to “Enabled”… My content is being shown the same way =/
Mark
August 30, 2021
Hi Rodrigo,
Thanks for reaching out!
As this is custom requirement rather than a public topic for open discussion, kindly submit a ticket here with a sample content that you want to run based on consent.
mirko
May 24, 2021
Help! Per errore ho cancellato la categoria “Necessario” e ora “Sempre abilitato” non compare più.
By mistake I deleted the “Necessary” category and now “Always enabled” no longer appears.
Mark
May 24, 2021
Hi Mirko,
You can create the category again and set the category slug as ‘necessary’ to get it back.
Tiago Tulha
May 2, 2021
Hi, is it possible to change the value from the button “save&accept”?
I need to translate it.
Thanks 🙂
Mark
May 3, 2021
Hi Tiago,
Please mention which version of the plugin you are using and to which language you want it translated to.
Olivier
March 17, 2021
Hello, i would like to add a “cookies” link in my footer.
When i click the link, i want to show the categories cookie popup. How can i do this
Mark
March 17, 2021
Hi Oliver,
You can use the short [wt_cli_manage_consent] to add the cookie settings link anywhere in the site.
Enrique
March 11, 2021
Hello! I need help…I have my scripts ready to enable cookies in case the user agrees but in spain the default state must be disabled so if I click on the accept button all cookies are not accepted because the state remains disabled, any solution please? Thank you very much in advance
(I use the standard version)
Mark
March 16, 2021
Hi Enrique,
Our premium version plugin has an option to enable accept all where you can enable all categories at once. Kindly check it out.
Dennis B.
February 21, 2021
hi, is it possible to use the [cookie_accept_all] Button next to the “Save&Accept” Button at the Cookie settings view?
So that the visitor can Save&Accept the current setting or allow all cookies.
Mark
February 26, 2021
Currently, there is no option to add an accept all button to settings pop up. Sorry to let you down.
Gustavo Keinemann
November 19, 2020
Hello! I am trying to use [cookie_accept_all] and I also use Polylang. The “ACCEPT ALL” label doesn’t show up at all in the string translations page. Is there a way to customize the message displayed in the other languages? I mean, in the string translations I can see where I need to translate the pop-up window’s text, but I tried using [cookie_accept_all message="testing"] and [cookie_accept_all cookie_accept_all_message="testing"] but it doesn’t work (wishful thinking on my part). In the string translations page I can see the text and translation for all the other buttons. If it matters, my site is in English, Spanish and German.
Any ideas? Thanks!
Mark
December 16, 2020
As the button was recently added, there are some updates missing with regards to polylang translation support. We will add it in the next update.
Rene
October 30, 2020
Does [cookie_accept] only accept the settings of existing categories or is this a global “accept”.
example:
cat 1 = enabled (default state)
cat 2 = disabled (default state) & no changes
Will [cookie_accept] accept cookies of cat 1 and cat 2 OR will it accept only cat 1?
Mark
November 3, 2020
It just accepts the current state of categories. In the premium version, you can enable the accept all feature.
Hoa
August 28, 2020
Hi,
I’m trying to enable the function “Enable accept all feature?” in the settings of the [cookie_button] but every time I save the settings and refresh the page, the setting jumps back to “No”. What is the reason for this? This message appears when I select “Yes” on this function:
“Please note that you will not be able to extend the cookie consent bar with cookie settings once this option is enabled.”
So I now removed the [cookie_settings] shortcode from my text, however this doesn’t seem to have any effect. The problem stays the same: my selection of “Yes” doesn’t save and instead gets replaced by “No”. Please help!
Many thanks
Hoa
Mark
September 1, 2020
It will not work with cookie bar or popup themes that has cookie category checkboxes on the banner itself.
Mick
August 19, 2020
Hi there,
Is it possible to change the Button Text “Save&Accept” in the Popup? [cookie_popup_content]
Thanks.
Mark
August 26, 2020
Are you looking to translate it and if yes, which language?
Karl
June 4, 2020
Hi,
Is there a shortcode that can be put in our cookie page that allows the user to edit their cookie settings? I know we can enable the settings tab, but we don’t want that on every page as it gets in the way of some site elements.
Thanks,
Karl
Karl
June 4, 2020
I’ve tried: [user_consent_state] which puts the current state and a link – but the link does nothing:
Manage your consent.
Mark
June 4, 2020
You can use the shortcode [cookie_popup_content] that shows the cookie settings content.
Jose
September 20, 2021
This shortcode not working in custom template.
Mark
September 21, 2021
Please share the site URL and mention where you are trying to add it.
Roy Berrevoets
January 17, 2020
Hi,
Is there a way to edit the design of the ‘Privacy Overview-Pop up’?
Thanks,
Roy
Mark
January 20, 2020
You can apply style via CSS in your site theme. Hope you would be able to identify the classes to apply style via browser inspect tool. For any particular requirement, please reach us via support.
Thomas
November 22, 2019
Hi there,
if you use the shortcode [cookie_after_accept]Your Content goes here… [/cookie_after_accept] will there be an text shown to the User that he need to accept cookies to see the content?
Mark
November 26, 2019
Hi,
Currently, we have shortcode support for iframe-based contents only.
jth
March 1, 2019
Hi,
All styles seems to have disappeared. The following code [cookie_audit style="modern" not_shown_message="No cookies set"] display the same kind of table regardless of the style= setting (see
https://www.composition-project.eu/cookies/
)It used to work, but there must have been an update that removed the templates?
Jesper
Mark
March 6, 2019
Hi,
We are sorry about the inconvenience. However, we can confirm that we haven’t made any recent changes in the styling that would affect the shortcode functionality.
Please submit a ticket in the above support link with your site details so that we can have a deeper look.
f.duroy
November 29, 2018
Hi,
Is there any shortcode to display the different cookies belonging to a category within the Privacy Overview pop up like shown here https://www.webtoffee.com/wp-content/uploads/2018/05/cookie-settings-popup-category-description.png
Or do we have to write down the name ?
Thanks
Mark
November 30, 2018
Hi,
The above article talks about 2 short codes ie [cookie_audit] and [cookie_audit_category]. One will display the full list of cookies and other lists the cookies category wise. You can use them in the privacy overview content.
Read above for more info.