Written for Cookie Rocks 2.11.0, checked on 6 November 2026. The current version is 2.11.2: some details may have changed.
What you can do here
- Show a cookie policy that keeps itself up to date, on any page.
- Add a “Manage cookies” or “Do Not Sell or Share” link to your footer or menu.
- Reopen the choices from any link or button of your theme, without a shortcode.
| Shortcode | What it shows | Plugin |
|---|---|---|
[cookie_rocks_policy] | The cookie policy of your site, kept up to date | Audit, and Pro |
[cookie_rocks_link] | A “Manage cookies” link that reopens the choices | Pro only |
[cookie_rocks_policy]
Shows the cookie policy of your site, written by Cookie Rocks from what it found on your pages. Put it alone on a page, or under your own introduction. With the Audit alone, it has no attributes. Cookie Rocks Pro adds two, which you can combine (since 2.9.13).
[cookie_rocks_policy]
[cookie_rocks_policy title="1"]
[cookie_rocks_policy width="60rem"]
[cookie_rocks_policy title="1" width="none"]
| Attribute (Pro) | Value | Effect |
|---|---|---|
title | 1 | Adds the title “Cookie policy” as a main heading (H1), in the language of the page. For a page whose theme or page builder hides the title. Without it, the policy adds no title. |
width | A width in px, rem, em, ch or %, or none | The largest width of the policy. By default, 48rem, that is 768 px at the usual text size of 16 px. With the Audit alone, there is no limit: the policy takes the width of your page. none lets it take the full width of the page. Any other value is ignored. |
- Open Cookie Rocks, Obligations, and click Create the page next to A cookie policy. It creates a draft page named “Cookie policy” with the shortcode, and opens it in the editor. Or add the shortcode to a page of your own.
- Publish the page.
- Cookie Rocks finds a published page with the shortcode by itself. To use another page, choose it as Cookie policy page on the Consent page, then click Save Changes.
The policy is written in the language of the page, and is the same for every visitor of that language, so it works with page caches. With the Audit alone, it adds no stylesheet: it takes the style of your theme.
What the scan cannot see. Cookie Rocks scans your pages as a visitor who has done nothing yet. Cookies and browser storage that your site creates only after a visitor acts (signing in, paying, choosing a language or a dark mode) may not show up. Add them to your policy by hand, under the shortcode: name, kind (cookie, local storage, session storage), purpose and duration.
What the policy contains
In this order:
- a short introduction, and how long the visitor’s choice is kept, when Cookie Rocks knows it;
- a Manage cookies button, when Cookie Rocks knows how to reopen your banner;
- a link to your privacy policy, when it is another page;
- one section per category used on your site, with one card per tool: its name and provider, what it is for, its cookies with their duration, what it keeps in the browser (local storage, session storage, browser databases), and a link to the privacy policy of the provider;
- the categories with no cookie, in one line: “Not used on this site: …”;
- the Manage cookies button again, then a note with the date of the last analysis of your site;
- when Credit is ticked, a short credit at the bottom (see below).
The “Necessary” section starts with the cookie of your banner that remembers the choice, and, when visitors can sign in to your site, the sign-in cookies of WordPress.
The cookies listed are those the scan found on your pages, and those declared as loaded by Google Tag Manager. Cookie names and durations come from the public descriptions of the publishers. Browser storage comes from what the scan saw, or else from the keys the tool usually keeps.
With the Audit alone
- The cookie of your banner, and how long the choice is kept, come from the cookie plugin you already use, when the Audit recognises it and can read its settings.
- The Manage cookies button appears only when the Audit knows how to reopen that banner. The Consent page says whether it does. Otherwise, add the reopen link of that plugin under the shortcode.
- The policy shows in a language once the language files of Cookie Rocks for it are on your site. WordPress downloads them with its translation updates. Until then, it shows in English.
The Cookie plugins page lists the banners the Audit reads.
The credit at the bottom of the policy
The Credit setting is on the Consent page, under Your policies with the Audit alone: “Support Cookie Rocks: show a short credit at the bottom of the cookie policy”.
When it is ticked, the policy ends with a thin frame and one sentence: “This cookie policy is written and kept up to date by Cookie Rocks, a free WordPress plugin. Its consent banner is free for non-commercial sites.” The frame has the class cr-policy__credit and its own inline styles, so it looks the same with every theme. Its link to cookierocks.com carries rel="nofollow".
- With the Audit alone, it is off until you tick it.
- With Cookie Rocks Pro, it is on by default, and you can untick it.
- With a free key for a non-commercial site, it is always shown: “Always shown with a free key for a non-commercial site: it is the condition of the free key.” Its link then carries
rel="sponsored".
[cookie_rocks_link]
This shortcode comes with Cookie Rocks Pro only. With the Audit alone, use the reopen link of the cookie plugin you already use.
It shows a Manage cookies link that opens the details panel, so visitors can change their choice at any time. Put it in your footer or menu, and always when you hide the cookie button. It works on pages where the banner is turned on. It loads a small stylesheet on the pages where it is used, and nowhere else.
| Attribute | Value | Effect |
|---|---|---|
text | Any text | Your own label instead of “Manage cookies”. |
type | do-not-sell | The label becomes “Do Not Sell or Share My Personal Information”, in the language of the page, for the United States. On a site that addresses the United States, it opens the “Do Not Sell or Share” view, with an Opt out of sale and sharing button. Elsewhere, it opens the details panel, where marketing can be turned off. |
type | policy | Since 2.9.8. A link to your cookie policy page, in the language of the page, labelled “Cookie policy” or with your own text. Nothing is shown when the site has no cookie policy page. |
type | privacy | Since 2.9.12. A link to your privacy policy page, in the language of the page, labelled “Privacy policy” or with your own text. The page is the one chosen on the Consent page, or else the privacy policy page of WordPress. Nothing is shown when it is not published. |
as | button | Since 2.9.14. A button instead of a link, as before 2.9.14. The button takes the style of the text around it. Without it, the shortcode gives a link that takes the style of the other links of your theme: colour, underline, hover. |
class | One or more CSS classes | Added to the link or the button, after cr-manage-link, for your own style. |
When text is set, it wins over the label of type. Examples:
[cookie_rocks_link]
[cookie_rocks_link text="Cookie settings"]
[cookie_rocks_link type="do-not-sell"]
[cookie_rocks_link type="policy"]
[cookie_rocks_link type="privacy"]
[cookie_rocks_link as="button"]
[cookie_rocks_link class="footer-link"]
The last one gives:
<a href="#cr-preferences" class="cr-manage-link footer-link">Manage cookies</a>
Other ways to reopen the choices
With Cookie Rocks Pro, you do not need the shortcode. A click on any of these opens the details panel:
- a link whose address ends with
#cr-preferences, for example a custom link in a WordPress menu; - any element with the
data-cr-openattribute; - any element with the
cr-open-preferencesclass; - the JavaScript call
CookieRocks.open().
<a href="#cr-preferences">Cookie settings</a>
<button type="button">Manage cookies</button>
<button type="button" class="cr-open-preferences">Change my cookie choices</button>
If you hide the cookie button. A link to your cookie policy page does not reopen the choices. Keep one of the elements above on every page. Cookie Rocks looks for it on your home page every day.
Next step: PHP filters, actions and REST API.