Shortcodes: the cookie table and preference links

4 min read Updated July 2026

CoreConsent ships shortcodes that connect your policy pages and footer to the consent system — including a cookie table that maintains itself.

Paste this into your cookie or privacy policy page:

[clearconsent_cookie_table]

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 CoreConsent’s own cookies
services yes (default) / no Include or hide your configured services

For example, [clearconsent_cookie_table own="no"] renders only your services — useful if you describe the plugin’s cookies in prose elsewhere.

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.

[clearconsent_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".

[clearconsent_do_not_sell]

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 CoreConsent’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 CoreConsent’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 CoreConsent 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). CoreConsent 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.

Was this article helpful?
Thanks for your feedback!

Related articles