Skip to main content
Cookbook Content SureCookie

Add a Cookie Policy Page with SureCookie and AI

A cookie policy page with a cookie table that keeps itself current, drafted for your review and then linked from SureCookie's preferences window.

Difficulty Beginner
Time ~10 min

Prerequisites

A site connected to WPVibe running SureCookie 1.9 or newer (tested on 1.9.0, free) on WordPress 6.9 or newer, with an administrator account and SureCookie's Enable MCP switch on (SureCookie, Settings, Tools, MCP).

The prompt
My WordPress site uses SureCookie. Add a cookie policy page that lists my cookies, and let me review it before it goes live.

1. Run discover_abilities with category surecookie. If its abilities are not there, stop and tell me to install or update the free SureCookie plugin (1.9 or newer, on WordPress 6.9 or newer), then turn on its AI access: in SureCookie's Settings, open Tools, then MCP, switch on Enable MCP and save. SureCookie hides its abilities until that switch is on.
2. Run surecookie/manage-settings with action get and keys cookie_policy_page_id. If it is not 0, run surecookie/content-lookup with action get_posts, ids set to that ID and context policy. If found is true, tell me I already have one, with its title and link, and stop. If its reason is not_published, tell me SureCookie points to a page that isn't published, so its preferences window shows no Cookie Policy link, give me its preview link (as in step 4), and ask whether to publish it instead of making a new one. On my yes, go to step 5 with that page.
3. Run rest_api GET /wp/v2/pages with search cookie, status publish,draft,pending,private and context edit. If a page that looks like a cookie policy is there, show it with its status and ask whether to link that page or make a new one. To link it: if its status is not publish, tell me linking it means publishing it and wait for my yes; then go to step 5 with that page. Run surecookie/cookie-management with action list_scanned. If it finds no cookies, tell me the table would be nearly empty, suggest scanning my site first, and ask whether to go on.
4. Run rest_api_write POST /wp/v2/pages with title Cookie Policy, status draft, and content of two blocks: a paragraph block with one or two sentences in my site's voice saying what the page is for and that visitors can change their choice at any time [or give your own introduction], then a shortcode block holding SureCookie's cookie policy shortcode, surecookie_cookie_policy_content inside square brackets. Don't publish it. Give me its preview link (my site address followed by /?page_id=PAGE_ID&preview=true), and tell me the table fills itself from SureCookie's scan results. Wait for my yes.
5. If the page's status is not publish, run rest_api_write POST /wp/v2/pages/PAGE_ID with status publish. Run surecookie/manage-settings with action set and settings {"cookie_policy_page_id": PAGE_ID}, then surecookie/manage-settings with action get and keys cookie_policy_page_id, and confirm it reads PAGE_ID. Run surecookie/manage-settings with action get and keys policy_links_order. If it does not include cookie_policy, tell me the Cookie Policy link is hidden and ask whether to show it; on my yes, set policy_links_order to the same comma-separated text with cookie_policy added at the start (for example cookie_policy,privacy_policy,legal_notice) and read it back; if the other links are gone, put back the value you read before.
6. Give me the page's link, and tell me SureCookie's preferences window (opened from the banner's Preferences button) now links to it. If it is a page I already had and it has no cookie table, tell me it shows one if I add SureCookie's cookie policy shortcode, surecookie_cookie_policy_content inside square brackets. If I kept an older cookie policy page, remind me it is still public until I unpublish it.
Already connected?

Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:

Run the “Add a Cookie Policy Page with SureCookie and AI” recipe from the WPVibe cookbook on my connected site.

Privacy laws expect you to say which cookies your site sets and why. Writing that page by hand means copying names, purposes and durations from a scan, and it is out of date the next time you add a plugin.

The AI looks for a cookie policy page you already have and offers to link it. Otherwise it drafts one with a short introduction and SureCookie’s cookie policy table, which fills itself from your latest scan. You review the draft first. On your yes it publishes the page and links it in SureCookie, so the preferences window that opens from the banner points visitors to it.

The table lists only what SureCookie knows about, so scan your site first (this recipe does it). The introduction is yours to edit, and the page is not legal advice: have it checked if your business needs that.

Outcome

A published Cookie Policy page with SureCookie's cookie table, linked from SureCookie's preferences window.