Shortcodes: the cookie table and preference links
ClearConsent ships shortcodes that connect your policy pages and footer to the consent system — including a cookie table that maintains itself.
Cookie / service Category Expiry Purpose clearconsentStrictly necessary 365 days Stores your cookie-consent choices for this website so they are respected on future visits. Contains no personal data. Google Analytics Analytics — Loads only after you allow it via the consent banner. Facebook Marketing Marketing — Loads only after you allow it via the consent banner.
— a cookie table that never goes stale
| Cookie / service | Category | Expiry | Purpose |
|---|---|---|---|
clearconsent | Strictly necessary | 365 days | Stores your cookie-consent choices for this website so they are respected on future visits. Contains no personal data. |
| Google Analytics | Analytics | — | Loads only after you allow it via the consent banner. |
| Facebook Marketing | Marketing | — | Loads only after you allow it via the consent banner. |
Paste this into your cookie or privacy policy page:
Cookie / service Category Expiry Purpose clearconsentStrictly necessary 365 days Stores your cookie-consent choices for this website so they are respected on future visits. Contains no personal data. Google Analytics Analytics — Loads only after you allow it via the consent banner. Facebook Marketing Marketing — Loads only after you allow it via the consent banner.
It renders a table generated from your live configuration:
- Your consent cookie — with the actual configured name and expiry from Developer options. Rename the cookie or change the expiry, and the table updates itself.
- The geo cookie (
cc_geo) — listed only while Geo-targeting is enabled; the row disappears when you turn geo off. - Every configured service — title, category (derived from its Groups tags), and a purpose description.
Because the table reads your settings on every page load, your policy page can’t drift out of date when you add a service or change a cookie setting — the maintenance problem that static “policy generators” create is simply gone.
Attributes
| Attribute | Values | Effect |
|---|---|---|
own |
yes (default) / no |
Include or hide ClearConsent’s own cookies |
services |
yes (default) / no |
Include or hide your configured services |
For example, renders only your services — useful if you describe the plugin’s cookies in prose elsewhere.Cookie / service Category Expiry Purpose Google Analytics Analytics — Loads only after you allow it via the consent banner. Facebook Marketing Marketing — Loads only after you allow it via the consent banner.
Richer rows with description and cookies
Services can carry two optional keys that make the table more informative: a description (shown in the Purpose column) and a cookies list (appended as “Sets: _ga, ga*.”). Services added from the template library include both automatically. For hand-built services, add them via the JSON view of the Services editor:
{
"name": "facebook-pixel",
"title": "Meta (Facebook) Pixel",
"purposes": ["marketing"],
"description": "Meta advertising measurement and retargeting.",
"cookies": ["_fbp", "fr"]
}
Services without a description get sensible fallback text (“Loads only after you allow it via the consent banner”). Developers can reshape any row with the clearconsent_cookie_table_row filter.
Cookie preferences — the “Cookie preferences” link
Cookie preferences
Outputs a link that reopens the consent preferences modal, where visitors can change their choices at any time. Most privacy regimes expect withdrawing consent to be as easy as giving it — a persistent footer link is the standard way to satisfy that. Customize it with text="Manage cookies" and class="my-footer-link".
Do Not Sell or Share My Personal Information — the CCPA/CPRA link
Do Not Sell or Share My Personal Information
Outputs a “Do Not Sell or Share My Personal Information” link — the wording California’s CCPA/CPRA expects from covered businesses. It opens the same preferences modal, where marketing services can be declined. The text attribute lets you use alternate statutory phrasings (e.g. “Your Privacy Choices”).
Together with ClearConsent’s automatic Global Privacy Control handling (GPC signals decline marketing services before the visitor even interacts), this completes the US opt-out picture: honored signal and manual link.
Where shortcodes work
Anywhere WordPress renders shortcodes: pages, posts, and — in most themes — footer/text widgets and block templates. If your footer builder doesn’t process shortcodes, add an HTML link instead; any element with the class cc-open-preferences opens the modal:
<a href="#" class="cc-open-preferences">Cookie preferences</a>
The links are wired via a delegated handler in ClearConsent’s front-end script, so they work on fully cached pages, need no inline JavaScript, and keep working even when a page builder injects the footer after page load. The only requirement is that ClearConsent is active — on a page where the plugin is disabled, the links have nothing to open.
FAQ
Do I still need a cookie policy if I use the table? The table documents what cookies exist; your policy still needs the surrounding explanations (legal bases, your contact details, how to complain). Think of the shortcode as replacing the tedious part, not the policy.
Does the table list the cookies each third-party service sets? It lists what you’ve declared in each service’s cookies key (template-added services come pre-filled). ClearConsent doesn’t guess at third-party cookie names beyond that — vendors change them frequently, and we’d rather show you accurate declared data than a stale guess.
Can I style the table? Yes — it’s a plain table with the class cc-cookie-table and light default styling. Target it in your theme’s CSS.