Skip to main content
Cookbook Maintenance WPConsent

Check Your Cookie Consent Setup with WPConsent and AI

Settings, banner, scan, cookie list and your live page checked against each other, with nothing changed.

Difficulty Beginner
Time ~5 min

Prerequisites

A site connected to WPVibe running WPConsent 1.2.1 or newer (tested on 1.2.1, free) on WordPress 6.9 or newer, with an administrator account.

The prompt
My WordPress site uses WPConsent. Check that my cookie consent setup is complete and works on my live site. Don't change anything.

1. Run discover_abilities with category wpconsent-settings, then wpconsent-scanner and wpconsent-cookies. If the WPConsent abilities this needs are not there, stop and tell me to install or update the free WPConsent plugin (1.2.1 or newer, on WordPress 6.9 or newer).
2. Run wpconsent/get-settings and wpconsent/get-banner. Tell me in plain words: whether the banner is on (content.enable_consent_banner), script blocking, respect_gpc, consent_duration in days, and whether the accept, reject (cancel) and preferences buttons show: each needs its enabled flag on and its name in content.button_order. If default_allow is true, or the banner is on with script blocking off, flag it: every script loads before the visitor chooses. If the banner is off with script blocking on, flag it as broken: the scripts WPConsent recognizes stay held back for every visitor, with no banner to release them.
3. Google Consent Mode needs care: on a site where it was never saved, wpconsent/get-settings reports google_consent_mode false while WPConsent treats it as on (Microsoft Clarity's clarity_consent_mode works the same way). To know which, run run_wp_cli with option get wpconsent_settings --format=json: if there is no google_consent_mode key, or the option is not found, it is on. While it is on, script blocking lets Google Analytics, Google Tag Manager and Google Ads scripts load instead of holding them back, and WPConsent sends them the visitor's choice once they make it. It sets Google's consent default (denied until the visitor accepts; granted instead while default_allow is on) only when a Google service is in its service list: without one, Google's tags load and collect as if consent were given until the visitor chooses. While it is off, script blocking holds them back until the visitor accepts. Tags that Google Tag Manager loads follow its container's own rules: they wait for consent only if they are set up to (WPConsent pushes a wpconsent_consent_processed event to the dataLayer for that). Microsoft Clarity works like this too while clarity_consent_mode is on (no key means on): its script is not held back, WPConsent sets no consent default for it, and it sends Clarity the visitor's choice only when they make one in the banner. While it is off, script blocking holds Clarity back until the visitor accepts its category. Tell me which applies on my site.
4. If cookie_policy_page is not 0, run rest_api GET /wp/v2/pages/PAGE_ID with context edit and tell me its status. Flag it if it is not published, or not found. If it is 0, flag that there is no cookie policy page. Then run run_wp_cli with option get wp_page_for_privacy_policy: if it is 0 or that page is not published, flag that the banner's preferences panel ends its cookie policy sentence with "and ." (when 0) or links visitors to a privacy page they can't open (when a draft).
5. Run wpconsent/get-scan-results. If date is null, flag that the site was never scanned. Otherwise say when, and list the services the scan found (by name, from scripts). Run wpconsent/list-services and flag any service the scan found that is not in that list (services_needed keeps every service the scan found, set up or not, so compare by name). If the scan is more than [30] days old, suggest a new scan; don't run one.
6. Run wpconsent/list-categories and wpconsent/list-cookies. Flag any service with no cookies, any cookie with an empty description or duration, and anything in Essential that looks like analytics, advertising or chat: visitors can't decline Essential.
7. Read my home page and [one more page, for example your contact or checkout page] with get_page_html, in pieces: the banner and the scripts usually sit past the first 50,000 characters, so while a reply says it was truncated, read on with offset set a little before where the last piece ended (49000, 98000 and so on, since each piece starts with a short note) until the end. If the banner is on, check the page holds WPConsent's banner (elements with wpconsent in their class). If script blocking is on, list the scripts held back: type text/plain with a data-wpconsent-category. Then list every other script that loads a tracker normally, from my domain or another, and every iframe from another domain (videos, maps), and say whether each looks like analytics, ads, chat or embeds. WPConsent holds embeds back only while its content blocking setting (enable_content_blocking) is on, and WPConsent's free version only holds back scripts it recognizes (blocking others is in WPConsent Pro), and Google's tags and Clarity load on purpose while their consent mode is on, so say whether a Google service is in my list (step 5): without one, Google's consent default (denied until the visitor accepts) is not set, unless Google Site Kit's own consent mode is on, which then sets it instead. This reads the HTML as sent, before any script runs: tags a loader such as Google Tag Manager adds in the browser are not in it, so also list inline scripts that load a third-party tracker. If Tag Manager loads, tell me to check that the tags in its container wait for consent (WPConsent pushes a wpconsent_consent_processed event to the dataLayer they can trigger on). This read usually skips page caches; tell me visitors may still get an older cached copy if I changed WPConsent recently.
8. Finish with a short report: what works, what needs me, and the single most important thing to fix first.
Already connected?

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

Run the “Check Your Cookie Consent Setup with WPConsent and AI” recipe from the WPVibe cookbook on my connected site.

Cookie consent gets set up once and then drifts. You add a chat widget or an ad pixel, the scan you ran last year no longer matches the site, and nobody notices the policy page went to draft.

The AI reads WPConsent’s settings, banner, last scan and cookie list, then reads your home page the way a visitor gets it, and checks the two agree: the banner is there, the scripts that should wait for consent do, and the services the scan found are declared. It changes nothing and ends with the first thing to fix.

The free version of WPConsent holds back only the scripts it recognizes, so the report names any other third-party script in the page’s HTML that loads before consent. Tags that Google Tag Manager adds in the browser aren’t in that HTML: check those in your Tag Manager container. A new scan isn’t part of this check; to set things right, use the setup recipe.

Outcome

A short report of what works, what needs you and the first thing to fix, with nothing changed.